コード例 #1
0
  private boolean isAddressInfoPresent(Address address) {
    boolean retVal = false;

    retVal |= StringUtils.isNotEmpty(address.getCity());
    retVal |= StringUtils.isNotEmpty(address.getStreet1());
    retVal |= StringUtils.isNotEmpty(address.getStreet2());
    retVal |= StringUtils.isNotEmpty(address.getZip());
    retVal |= StringUtils.isNotEmpty(address.getZipCdExt());

    return retVal;
  }
コード例 #2
0
 /**
  * @param errors
  * @param address Address object
  * @param fieldBaseValue base field mapping for JSP <-> form fields
  */
 private void validateSpecialMailingAddress(Errors errors, Address address) {
   if (!DataDictionaryValidator.validateStreetAddress1(address.getStreet1(), true)) {
     errors.rejectValue(
         "billingAddress.street1",
         "error.li.billingAddress.street1",
         null,
         "Invalid Special Mailing Street Address 1");
   }
   if (!DataDictionaryValidator.validateStreetAddress2(address.getStreet2(), false)) {
     errors.rejectValue(
         "billingAddress.street2",
         "error.li.billingAddress.street2",
         null,
         "Invalid Special Mailing Street Address 2");
   }
   if (!DataDictionaryValidator.validateCity(address.getCity(), true)) {
     errors.rejectValue(
         "billingAddress.city",
         "error.li.billingAddress.city",
         null,
         "Invalid Special Mailing  City");
   }
   if (!DataDictionaryValidator.validateZipCode(address.getZip(), true)) {
     errors.rejectValue(
         "billingAddress.zip",
         "error.li.billingAddress.zip",
         null,
         "Invalid Special Mailing  zip");
   }
   if (!DataDictionaryValidator.validateZipCodeExtension(address.getZipExt(), false)) {
     errors.rejectValue(
         "billingAddress.zipExt",
         "error.li.billingAddress.zipext",
         null,
         "Invalid Special Mailing zip extension");
   }
   if (!DataDictionaryValidator.validateState(address.getState(), true)) {
     errors.rejectValue(
         "billingAddress.state",
         "error.li.billingAddress.state",
         null,
         "Invalid Special Mailing state");
   }
 }