org.loom.validator
Class AbstractPropertyValidator
java.lang.Object
org.loom.validator.AbstractPropertyValidator
- All Implemented Interfaces:
- FormInputDecorator, PropertyValidator
- Direct Known Subclasses:
- AbstractRequiredValidator, DateValidator, MethodValidator, NumberValidator, StringValidator
public abstract class AbstractPropertyValidator
- extends java.lang.Object
- implements PropertyValidator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractPropertyValidator
public AbstractPropertyValidator()
decorate
public void decorate(FormInputTag tag)
- Add attributes to the tag based on this Validator instance metadata
- Specified by:
decorate
in interface FormInputDecorator
- Parameters:
tag
- the tag to be modified
pushPropertyPath
public void pushPropertyPath(java.lang.String prefix)
- Adds a property node to the beginning of this property path
getPropertyPath
public java.lang.String getPropertyPath()
- Description copied from interface:
PropertyValidator
- The property path that will be evaluated. Must be not-null and non-empty
- Specified by:
getPropertyPath
in interface PropertyValidator
setPropertyPath
public void setPropertyPath(java.lang.String propertyPath)
validateCollectionContainer
public boolean validateCollectionContainer()
- Specified by:
validateCollectionContainer
in interface PropertyValidator
- Returns:
- true if this validation must be 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.
Defaults false
getOverridenMessageKey
public java.lang.String getOverridenMessageKey()
- Description copied from interface:
PropertyValidator
- If not null, this will be the error message key used instead of the one suggested by the
validator class.
- Specified by:
getOverridenMessageKey
in interface PropertyValidator
- Returns:
- the message key to be used from the
MessagesRepository
, default null.
setOverridenMessageKey
public void setOverridenMessageKey(java.lang.String message)
getMessagePrefix
protected java.lang.String getMessagePrefix()
setMessagePrefix
protected void setMessagePrefix(java.lang.String messagePrefix)
isValidateCollectionContainer
protected boolean isValidateCollectionContainer()
setValidateCollectionContainer
protected void setValidateCollectionContainer(boolean validateCollectionContainer)
isBindMessages
public boolean isBindMessages()
- Specified by:
isBindMessages
in interface PropertyValidator
- Returns:
- true to bind error messages to the property name, false to use unbound
Message
setBindMessages
public void setBindMessages(boolean bindMessages)