org.javalid.core.validator
Class NotEmptyValidatorImpl
java.lang.Object
org.javalid.core.validator.AbstractJavalidValidatorImpl<NotEmpty>
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:
- Removed ValidatorSupport instance, using its static methods instead
Changes for 1.2:
- Refactored: Extends AbstractJavalidValidator
- Added support for java.lang.StringBuilder, any array and java.util.Collection
- Since:
- 1.0
- Version:
- 1.2
- Author:
- M.Reuvers
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotEmptyValidatorImpl
public NotEmptyValidatorImpl()
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>