O - type of bean to validate@Deprecated public abstract class AbstractValidator<O> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
canValidate
Deprecated.
State to know if the validator can be used (we keep this state for
performance reasons : do not want to compute this value each time a
validation is asked...).
|
protected boolean |
changed
Deprecated.
State to indicate that validator has changed since the last time bean was
setted.
|
static String |
CHANGED_PROPERTY
Deprecated.
Name of the bounded property
changed. |
static String |
CONTEXT_PROPERTY
Deprecated.
Name of the bounded property
context. |
protected PropertyChangeListener |
l
Deprecated.
Listener that listens on bean modification.
|
protected EventListenerList |
listenerList
Deprecated.
A list of event listeners for this validators
|
protected PropertyChangeSupport |
pcs
Deprecated.
delegate property change support
|
static String |
SCOPES_PROPERTY
Deprecated.
Name of the bounded property
scopes. |
protected boolean |
valid
Deprecated.
State of the validator (is true if no errors of error scope is found).
|
static String |
VALID_PROPERTY
Deprecated.
Name of the bounded property
valid. |
protected NuitonValidatorProvider |
validatorProvider
Deprecated.
The provider of delegate validators.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractValidator(NuitonValidatorProvider validatorProvider,
Class<O> beanClass)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Deprecated.
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Deprecated.
|
boolean |
containsField(String fieldName)
Deprecated.
Test a the validator contains the field given his name
|
abstract <T> T |
convert(O bean,
String fieldName,
String value,
Class<T> valueClass)
Deprecated.
|
abstract void |
doValidate()
Deprecated.
|
protected abstract void |
doValidate(O bean)
Deprecated.
|
void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Deprecated.
|
String |
getContext()
Deprecated.
|
protected abstract NuitonValidator<O> |
getDelegate()
Deprecated.
|
Set<String> |
getEffectiveFields()
Deprecated.
|
Set<String> |
getEffectiveFields(NuitonValidatorScope scope)
Deprecated.
|
Set<NuitonValidatorScope> |
getEffectiveScopes()
Deprecated.
|
abstract NuitonValidatorScope |
getHighestScope(String field)
Deprecated.
|
protected NuitonValidatorModel<O> |
getModel()
Deprecated.
|
Set<NuitonValidatorScope> |
getScopes()
Deprecated.
|
Class<O> |
getType()
Deprecated.
|
abstract boolean |
hasErrors()
Deprecated.
|
abstract boolean |
hasFatalErrors()
Deprecated.
|
abstract boolean |
hasInfos()
Deprecated.
|
abstract boolean |
hasWarnings()
Deprecated.
|
boolean |
isCanValidate()
Deprecated.
|
boolean |
isChanged()
Deprecated.
Obtain the
changed property value. |
boolean |
isValid()
Deprecated.
Obtain the
valid property value. |
abstract boolean |
isValid(String fieldName)
Deprecated.
|
protected abstract void |
rebuildDelegateValidator(Class<O> beanType,
String context,
NuitonValidatorScope... scopes)
Deprecated.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deprecated.
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Deprecated.
|
void |
setCanValidate(boolean canValidate)
Deprecated.
|
void |
setChanged(boolean changed)
Deprecated.
To force the value of the property
changed. |
void |
setContext(String context)
Deprecated.
|
void |
setScopes(NuitonValidatorScope... scopes)
Deprecated.
|
void |
setValid(boolean valid)
Deprecated.
Change the value of the
valid property. |
public static final String CONTEXT_PROPERTY
context.getContext(),
setContext(String),
Constant Field Valuespublic static final String SCOPES_PROPERTY
scopes.public static final String VALID_PROPERTY
valid.valid,
isValid(),
setValid(boolean),
Constant Field Valuespublic static final String CHANGED_PROPERTY
changed.changed,
isChanged(),
setChanged(boolean),
Constant Field Valuesprotected boolean changed
protected boolean valid
protected boolean canValidate
protected final PropertyChangeListener l
protected final PropertyChangeSupport pcs
protected final EventListenerList listenerList
protected final NuitonValidatorProvider validatorProvider
NuitonValidatorProviderprotected AbstractValidator(NuitonValidatorProvider validatorProvider, Class<O> beanClass)
public boolean isChanged()
changed property value.
Returns true if bean was modified since last
time a bean was attached.true if bean was modified since last attachement of
a bean.public void setChanged(boolean changed)
changed.changed - flag to force reset of property changedpublic boolean isCanValidate()
public void setCanValidate(boolean canValidate)
public boolean isValid()
valid property value.true if attached bean is valid (no error or fatal messages)public void setValid(boolean valid)
valid property.valid - the new value of the propertypublic String getContext()
public void setContext(String context)
public Set<NuitonValidatorScope> getScopes()
public Set<NuitonValidatorScope> getEffectiveScopes()
public Set<String> getEffectiveFields(NuitonValidatorScope scope)
public void setScopes(NuitonValidatorScope... scopes)
public abstract void doValidate()
public abstract boolean hasFatalErrors()
public abstract boolean hasErrors()
public abstract boolean hasWarnings()
public abstract boolean hasInfos()
public abstract boolean isValid(String fieldName)
public abstract NuitonValidatorScope getHighestScope(String field)
public abstract <T> T convert(O bean, String fieldName, String value, Class<T> valueClass)
protected abstract void doValidate(O bean)
protected abstract NuitonValidator<O> getDelegate()
protected abstract void rebuildDelegateValidator(Class<O> beanType, String context, NuitonValidatorScope... scopes)
public boolean containsField(String fieldName)
fieldName - the name of the searched fieldtrue if validator contaisn this field,
false otherwisepublic void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
protected NuitonValidatorModel<O> getModel()
Copyright © 2011-2013 CodeLutin. All Rights Reserved.