org.loom.validator
Interface PropertyValidator

All Superinterfaces:
FormInputDecorator
All Known Implementing Classes:
AbstractPropertyValidator, AbstractRequiredValidator, DateValidator, MethodValidator, NumberValidator, RequiredArrayValidator, RequiredBooleanValidator, RequiredCollectionValidator, RequiredMapValidator, RequiredObjectValidator, RequiredStringValidator, StringValidator

public interface PropertyValidator
extends FormInputDecorator

A Validator bound to a property. Subclasses must be thread-safe.


Method Summary
 java.lang.String getOverridenMessageKey()
          If not null, this will be the error message key used instead of the one suggested by the validator class.
 java.lang.String getPropertyPath()
          The property path that will be evaluated.
 boolean isBindMessages()
           
 void validate(ValidationRequest request, java.lang.Object value)
          Validates one input value and adds to errors any validation error found
 boolean validateCollectionContainer()
           
 
Methods inherited from interface org.loom.validator.FormInputDecorator
decorate
 

Method Detail

validate

void validate(ValidationRequest request,
              java.lang.Object value)
Validates one input value and adds to errors any validation error found

Parameters:
value - the value to validate

getPropertyPath

java.lang.String getPropertyPath()
The property path that will be evaluated. Must be not-null and non-empty


getOverridenMessageKey

java.lang.String getOverridenMessageKey()
If not null, this will be the error message key used instead of the one suggested by the validator class.

Returns:
the message key to be used from the MessagesRepository, default null.

validateCollectionContainer

boolean validateCollectionContainer()
Returns:
true if this validation is applied to containers (lists, maps, arrays) instead of its contents. If false, the validation will be applied to each content, if true it will be applied to the container.

isBindMessages

boolean isBindMessages()
Returns:
true to bind error messages to the property name, false to use unbound Message