jaxx.runtime.validator
Class BeanValidatorField<B>
java.lang.Object
jaxx.runtime.validator.BeanValidatorField<B>
- Type Parameters:
B - the type of the bean handled by the validator and this field of
validation.
public class BeanValidatorField<B>
- extends Object
Definition of a field to be handled in a BeanValidator.
A such class is only registred in BeanValidator when the field of
the bean was found in validator xml configuration file for a FieldValidator only.
This class use properties beanClass, name to define his
naturel order.
- Since:
- 1.3
- Author:
- tchemit
beanClass
protected final Class<B> beanClass
- the class of bean
name
protected final String name
- name of field in bean
messages
protected EnumMap<BeanValidatorScope,Set<String>> messages
BeanValidatorField
public BeanValidatorField(Class<B> beanClass,
String name,
List<BeanValidatorScope> scopes)
getName
public String getName()
getBeanClass
public Class<B> getBeanClass()
isValid
public boolean isValid()
- Returns:
true if this field is valid (says is in error scope
and has errors), false otherwise.
getScope
public BeanValidatorScope getScope()
getScopes
public Set<BeanValidatorScope> getScopes()
hasErrors
public boolean hasErrors()
hasWarnings
public boolean hasWarnings()
hasInfos
public boolean hasInfos()
getErrors
public Set<String> getErrors()
getWarnings
public Set<String> getWarnings()
getInfos
public Set<String> getInfos()
hasMessages
public boolean hasMessages(BeanValidatorScope scope)
getMessages
public Set<String> getMessages(BeanValidatorScope scope)
updateMessages
public void updateMessages(BeanValidator<B> validator,
BeanValidatorScope scope,
List<String> messages)
getI18nError
public String getI18nError(String error)
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class Object
clearMessages
protected void clearMessages(BeanValidatorScope scope,
BeanValidator<B> validator)
Copyright © 2008-2010 CodeLutin. All Rights Reserved.