org.javalid.core.validator
Class NotEmptyValidatorImpl

java.lang.Object
  extended by org.javalid.core.validator.AbstractJavalidValidatorImpl<NotEmpty>
      extended by org.javalid.core.validator.NotEmptyValidatorImpl
All Implemented Interfaces:
JavalidValidator<NotEmpty>

public class NotEmptyValidatorImpl
extends AbstractJavalidValidatorImpl<NotEmpty>

This class is responsible for validating the NotEmpty annotation. Checks if given value is not empty (for String / StringBuffer / StringBuilder / any array or java.util.Collection). A null value is seen as empty too. Can be a replacement for NotNull if you want notempty to be checked too. The handling by the framework is similar, NotNull aborts processing of remaining annotations (as its useless if something is null), the same goes for this annotation if it is violated.

Can be applied to methods returning: java.lang.String or java.lang.StringBuffer, java.lang.StringBuilder , any array, java.util.Collection). On error adds a ValidationMessage of: MessageCodes.MSG_NOT_EMPTY_ERROR for empty.

ValidationMessage's value property contains {currentValue}

Changes for 1.1:

Changes for 1.2:

Since:
1.0
Version:
1.2
Author:
M.Reuvers

Constructor Summary
NotEmptyValidatorImpl()
           
 
Method Summary
 java.util.List<ValidationMessage> doValidate(NotEmpty annotation, java.lang.Object value, java.lang.String path, JvConfigurationWrapper config)
           
 
Methods inherited from class org.javalid.core.validator.AbstractJavalidValidatorImpl
checkIsSingleExpression, requiresComplexCall, validate, validateComplex, validationMustBeAppliedToGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotEmptyValidatorImpl

public NotEmptyValidatorImpl()
Method Detail

doValidate

public java.util.List<ValidationMessage> doValidate(NotEmpty annotation,
                                                    java.lang.Object value,
                                                    java.lang.String path,
                                                    JvConfigurationWrapper config)
Specified by:
doValidate in class AbstractJavalidValidatorImpl<NotEmpty>