/**
  * @param toValidate
  * @param propertyValue
  * @param messages
  * @see
  *     nl.knowlogy.validation.metadata.PropertyValidation#doValidatePropertyValue(java.lang.Object,
  *     nl.knowlogy.validation.iMessages)
  */
 public void doValidatePropertyValue(Object toValidate, Object propertyValue, iMessages messages) {
   String stringValue = (String) propertyValue;
   if ((stringValue != null)
       && (allowedValuesList != null)
       && (!allowedValuesList.contains(stringValue))) {
     messages.addPropertyMessage(MessageType.ERROR, toValidate, getPropertyName(), getErrorCode());
   }
 }
예제 #2
0
 public void doValidatePropertyValue(Object toValidate, Object propertyValue, iMessages errors) {
   // System.out.println(this.getClass().getName());
   if (propertyValue != null) {
     if (!org.apache.commons.validator.EmailValidator.getInstance()
         .isValid((String) propertyValue)) {
       errors.addPropertyMessage(MessageType.ERROR, toValidate, getPropertyName(), getErrorCode());
     }
   } else {
     if (logger.isLoggable(Level.CONFIG)) {
       logger.log(Level.WARNING, "Skipping validation propertyvalue == null for {0}", this);
     }
   }
 }