JAVA中判断某详细信息列表中是否有空项(经验总结)

类别:Java 点击:0 评论:0 推荐:

   /**
     * 明細抜けフラグの設定 .
     *
     * @param lineVoList
     *            明細VOオブジェクトリスト
     */
    private void setDetailNukeFlg(List lineVoList) {
        logger.info("-------setDetailNukeFlg:START-------");

        for (int i = 0; i < lineVoList.size(); i++) {
            // ■1.明細VOオブジェクト
            POHakkouIraiNyuuryokuLineVo lineVo = (POHakkouIraiNyuuryokuLineVo) lineVoList
                    .get(i);

            // 製品コードが入力された場合、「false」に設定される
            if (StringUtil.isNullOrSpace(lineVo.getBuhinCD())
                    && StringUtil.isNullOrSpace(lineVo.getBuhinMeisyou())
                    && StringUtil.isNullOrSpace(lineVo.getKaigaiBuhinCD())
                    && StringUtil.isNullOrSpace(lineVo.getKaigaiBuhinMeisyou())
                    && StringUtil.isNullOrSpace(lineVo.getSiyouYouteigetu())
                    && StringUtil.isNullOrSpace(lineVo.getKanryouKibouhi())
                    && StringUtil.isNullOrSpace(lineVo.getEdaCD())
                    && StringUtil.isNullOrSpace(lineVo.getSizeCD())
                    && StringUtil.isNullOrSpace(lineVo.getSize())
                    && StringUtil.isNullOrSpace(lineVo.getSuuryou())
                    && StringUtil.isNullOrSpace(lineVo.getTanka())
                    && StringUtil.isNullOrSpace(lineVo.getGaika())
                    && StringUtil.isNullOrSpace(lineVo.getTankaCheck())
                    && StringUtil.isNullOrSpace(lineVo.getSyouhinKenti())
                    && StringUtil.isNullOrSpace(lineVo.getYusouhouhou())
                    && StringUtil.isNullOrSpace(lineVo.getSyutukaKibouhi())
                    && StringUtil.isNullOrSpace(lineVo.getTorihikisakiMeisyou())
                    && StringUtil.isNullOrSpace(lineVo.getNouhinsakiMeisyou())) {
                lineVo.setIsNukeGyouFlg("1");
            } else {
                lineVo.setIsNukeGyouFlg("0");
            }
        }

        logger.info("setDetailNukeFlg:START");
    }

 public static boolean isNullOrSpace(String sSource) {
  boolean returnResult = true;
  if (sSource != null) {
   if (!sSource.equals("")) {
    returnResult = false;
   }
  }
  return returnResult;
 }

本文地址:http://com.8s8s.com/it/it11013.htm