|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.runtime.validator.BeanValidator<B>
B - type of the bean to validate.
@Deprecated public class BeanValidator<B>
A customized validator for a given bean.
Note: The bean must be listenable on properyChange events (means must have public addPropertychangeListener and removePropertyChangeListener methods).
| Field Summary | |
|---|---|
protected B |
bean
Deprecated. bean to be watched |
static String |
BEAN_PROERTY
Deprecated. la nom de la propriété bean |
protected Class<B> |
beanClass
Deprecated. the type of bean to watch |
protected EventSetDescriptor |
beanEventDescriptor
Deprecated. to add and remove PropertyChangeListener on watched beans |
protected boolean |
changed
Deprecated. state to indicate that validator has changed since the last time bean was setted |
static String |
CHANGED_PROERTY
Deprecated. la nom de l'état changed |
static String |
CONTEXT_NAME_PROPERTY
Deprecated. la nom de la propriété contextName |
protected String |
contextName
Deprecated. the validation named context (can be null) |
protected Map<String,String> |
conversionErrors
Deprecated. map of conversion errors detected by this validator |
protected Set<BeanValidatorField<B>> |
fields
Deprecated. list of fields watched by this validator |
protected static BeanValidatorScope[] |
FILTER_SCOPES_EMPTY
Deprecated. |
protected BeanValidatorScope[] |
filterScopes
Deprecated. filter scopes (if null, no filter on scopes) |
protected PropertyChangeListener |
l
Deprecated. listener that listens on bean modification |
protected EventListenerList |
listenerList
Deprecated. A list of event listeners for this validators |
protected static org.apache.commons.logging.Log |
log
Deprecated. Logger |
protected BeanValidator<?> |
parentValidator
Deprecated. to chain to a prent validator |
protected PropertyChangeSupport |
pcs
Deprecated. delegate property change support |
protected boolean |
valid
Deprecated. state of the validator (is true if no errors of error scope is found) |
static String |
VALID_PROERTY
Deprecated. la nom de l'état valid |
protected EnumMap<BeanValidatorScope,XWorkBeanValidator<B>> |
validators
Deprecated. xworks scope validator * |
| Constructor Summary | |
|---|---|
BeanValidator(Class<B> beanClass,
String contextName)
Deprecated. |
|
BeanValidator(Class<B> beanClass,
String contextName,
BeanValidatorScope... filterScopes)
Deprecated. |
|
| Method Summary | ||
|---|---|---|
void |
addBeanValidatorListener(BeanValidatorListener listener)
Deprecated. |
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Deprecated. |
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Deprecated. |
|
protected boolean |
canValidate()
Deprecated. |
|
boolean |
containsField(String fieldName)
Deprecated. Test a the validator contains the field given his name |
|
|
convert(String fieldName,
String value,
Class<T> valueClass)
Deprecated. Convert a value. |
|
void |
doValidate()
Deprecated. Methode pour forcer la revalidation d'un bean en mettant a jour les etats internes. |
|
protected void |
fireFieldChanged(BeanValidatorField<B> field,
BeanValidatorScope scope,
String[] toAdd,
String[] toDelete)
Deprecated. |
|
B |
getBean()
Deprecated. |
|
Class<B> |
getBeanClass()
Deprecated. |
|
protected EventSetDescriptor |
getBeanEventDescriptor(B bean)
Deprecated. |
|
BeanValidatorListener[] |
getBeanValidatorListeners()
Deprecated. |
|
String |
getContextName()
Deprecated. |
|
BeanValidatorField<B> |
getField(String fieldName)
Deprecated. |
|
Set<BeanValidatorField<B>> |
getFields()
Deprecated. |
|
BeanValidator<?> |
getParentValidator()
Deprecated. |
|
Set<BeanValidatorScope> |
getScopes()
Deprecated. |
|
boolean |
hasErrors()
Deprecated. |
|
boolean |
hasFatalErrors()
Deprecated. |
|
boolean |
hasInfos()
Deprecated. |
|
boolean |
hasWarnings()
Deprecated. |
|
protected void |
initFields()
Deprecated. |
|
boolean |
isChanged()
Deprecated. Retourne vrai si l'objet bean a ete modifie depuis le dernier setBean(B) |
|
boolean |
isValid()
Deprecated. |
|
boolean |
isValid(String fieldName)
Deprecated. |
|
void |
removeBeanValidatorListener(BeanValidatorListener listener)
Deprecated. |
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deprecated. |
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Deprecated. |
|
void |
setBean(B bean)
Deprecated. |
|
void |
setChanged(boolean changed)
Deprecated. Permet de force la remise a false de l'etat de changement du bean |
|
void |
setContextName(String contextName)
Deprecated. |
|
void |
setFilterScopes(BeanValidatorScope... filterScopes)
Deprecated. Sets the filter scopes. |
|
void |
setParentValidator(BeanValidator<?> parentValidator)
Deprecated. |
|
void |
setValid(boolean valid)
Deprecated. |
|
String |
toString()
Deprecated. |
|
protected void |
validate()
Deprecated. il faut eviter le code re-intrant (durant une validation, une autre est demandee). |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String BEAN_PROERTY
public static final String CONTEXT_NAME_PROPERTY
public static final String VALID_PROERTY
public static final String CHANGED_PROERTY
protected static final org.apache.commons.logging.Log log
protected static final BeanValidatorScope[] FILTER_SCOPES_EMPTY
protected final Class<B> beanClass
protected String contextName
protected BeanValidator<?> parentValidator
protected boolean changed
protected boolean valid
protected B bean
protected EventSetDescriptor beanEventDescriptor
protected Set<BeanValidatorField<B>> fields
protected Map<String,String> conversionErrors
protected EnumMap<BeanValidatorScope,XWorkBeanValidator<B>> validators
protected BeanValidatorScope[] filterScopes
null, no filter on scopes)
protected PropertyChangeListener l
protected PropertyChangeSupport pcs
protected EventListenerList listenerList
| Constructor Detail |
|---|
public BeanValidator(Class<B> beanClass,
String contextName)
public BeanValidator(Class<B> beanClass,
String contextName,
BeanValidatorScope... filterScopes)
| Method Detail |
|---|
public Class<B> getBeanClass()
public BeanValidator<?> getParentValidator()
public String getContextName()
public Set<BeanValidatorField<B>> getFields()
public Set<BeanValidatorScope> getScopes()
public boolean isChanged()
setBean(B)
true if bean was modify since last setBean(Object) invocationpublic boolean isValid()
public B getBean()
public BeanValidatorField<B> getField(String fieldName)
public boolean hasFatalErrors()
public boolean hasErrors()
public boolean hasWarnings()
public boolean hasInfos()
public boolean containsField(String fieldName)
fieldName - the name of the searched field
true if validator contaisn this field,
false otherwisepublic boolean isValid(String fieldName)
public void setChanged(boolean changed)
changed - flag to force reset of property changedpublic void setValid(boolean valid)
public void setBean(B bean)
public void setContextName(String contextName)
public void setFilterScopes(BeanValidatorScope... filterScopes)
filterScopes - the scopes to usedpublic void setParentValidator(BeanValidator<?> parentValidator)
public <T> T convert(String fieldName,
String value,
Class<T> valueClass)
T - the type of conversionfieldName - the name of the bean propertyvalue - the value to convertvalueClass - the type of converted value
public void doValidate()
validate() puis met à jour les etats internes
valid et changed.
protected void validate()
PropertyChangeListener
Note: la methode est protected et on utilise la methode
doValidate() car la méthode ne modifie pas les etats
internes et cela en rend son utilisation delicate (le validateur entre
dans un etat incoherent par rapport aux messages envoyés).
public String toString()
toString in class Objectpublic void addBeanValidatorListener(BeanValidatorListener listener)
public void removeBeanValidatorListener(BeanValidatorListener listener)
public BeanValidatorListener[] getBeanValidatorListeners()
public void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
protected boolean canValidate()
true if validation is enabled, false
otherwise.
protected void fireFieldChanged(BeanValidatorField<B> field,
BeanValidatorScope scope,
String[] toAdd,
String[] toDelete)
protected void initFields()
protected EventSetDescriptor getBeanEventDescriptor(B bean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||