jaxx.runtime.validator
Class BeanValidatorField<B>

java.lang.Object
  extended by jaxx.runtime.validator.BeanValidatorField<B>
Type Parameters:
B - the type of the bean handled by the validator and this field of validation.
All Implemented Interfaces:
Serializable

public class BeanValidatorField<B>
extends Object
implements Serializable

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
See Also:
Serialized Form

Field Summary
protected  Class<B> beanClass
          the class of bean
protected  EnumMap<BeanValidatorScope,Set<String>> messages
           
protected  String name
          name of field in bean
 
Constructor Summary
BeanValidatorField(Class<B> beanClass, String name, List<BeanValidatorScope> scopes)
           
 
Method Summary
protected  void clearMessages(BeanValidatorScope scope, BeanValidator<B> validator)
           
 boolean equals(Object o)
           
 Class<B> getBeanClass()
           
 Set<String> getErrors()
           
 String getI18nError(String error)
           
 Set<String> getInfos()
           
 Set<String> getMessages(BeanValidatorScope scope)
           
 String getName()
           
 BeanValidatorScope getScope()
           
 Set<BeanValidatorScope> getScopes()
           
 Set<String> getWarnings()
           
 boolean hasErrors()
           
 int hashCode()
           
 boolean hasInfos()
           
 boolean hasMessages(BeanValidatorScope scope)
           
 boolean hasWarnings()
           
 boolean isValid()
           
 String toString()
           
 void updateMessages(BeanValidator<B> validator, BeanValidatorScope scope, List<String> messages)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

BeanValidatorField

public BeanValidatorField(Class<B> beanClass,
                          String name,
                          List<BeanValidatorScope> scopes)
Method Detail

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.