public class CollectionFieldExpressionValidator extends NuitonFieldExpressionValidator
FieldExpressionValidator qui valide sur une
collection de propriéte.| Modifier and Type | Class and Description |
|---|---|
static class |
CollectionFieldExpressionValidator.Mode |
class |
CollectionFieldExpressionValidator.WalkerContext |
| Modifier and Type | Field and Description |
|---|---|
protected CollectionFieldExpressionValidator.WalkerContext |
c
le context de parcours
|
protected String |
collectionFieldName
pour indiquer la propriété qui contient la liste à valider.
|
protected String |
expressionForFirst
expression a valider sur la premiètre entrée de la collection.
|
protected String |
expressionForLast
expression a valider sur la dernière entrée de la collection.
|
protected String[] |
keys
la liste des propriétés d'une entrée de la collection qui définit la
clef unique (en mode UNIQUE_KEY).
|
protected CollectionFieldExpressionValidator.Mode |
mode
le mode de validation sur la liste
|
protected com.opensymphony.xwork2.util.ValueStack |
stack |
protected boolean |
useSensitiveContext
drapeau pour utiliser le contexte de parcours pour valider
l'expression, on dispose donc alors des variables previous, current,
index, size et empty dans l'expression.
|
skip| Constructor and Description |
|---|
CollectionFieldExpressionValidator() |
evaluateSkipParameter, setSkip, validategetExpression, setExpressiongetFieldName, setFieldName, setValidatorTypeaddActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessageKey, getMessageParameters, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setMessageParameters, setParse, setShortCircuit, setValidatorContextprotected CollectionFieldExpressionValidator.Mode mode
protected String collectionFieldName
FieldValidatorSupport.getFieldName() pour obtenir la collection.
Cela permet d'effectuer une validation si une collection mais portant
en fait sur un autre champsprotected boolean useSensitiveContext
protected String expressionForFirst
protected String expressionForLast
protected String[] keys
protected CollectionFieldExpressionValidator.WalkerContext c
protected com.opensymphony.xwork2.util.ValueStack stack
public CollectionFieldExpressionValidator.Mode getMode()
public void setMode(CollectionFieldExpressionValidator.Mode mode)
public String getCollectionFieldName()
public void setCollectionFieldName(String collectionFieldName)
public boolean isUseSensitiveContext()
public void setUseSensitiveContext(boolean useSensitiveContext)
public String getExpressionForFirst()
public void setExpressionForFirst(String expressionForFirst)
public String getExpressionForLast()
public void setExpressionForLast(String expressionForLast)
public String[] getKeys()
public void setKeys(String[] keys)
public void validateWhenNotSkip(Object object) throws com.opensymphony.xwork2.validator.ValidationException
NuitonFieldExpressionValidatortrue.validateWhenNotSkip in class NuitonFieldExpressionValidatorobject - the object to be validated.com.opensymphony.xwork2.validator.ValidationException - is thrown if there is validation error(s).public void setValueStack(com.opensymphony.xwork2.util.ValueStack stack)
setValueStack in interface com.opensymphony.xwork2.validator.ValidatorsetValueStack in class com.opensymphony.xwork2.validator.validators.ValidatorSupportpublic String getMessage(Object object)
getMessage in interface com.opensymphony.xwork2.validator.ValidatorgetMessage in class com.opensymphony.xwork2.validator.validators.ValidatorSupportprotected Boolean validateAllEntries(Collection<?> col) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected Boolean validateNoneEntry(Collection<?> col) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected Boolean validateAtLeastOneEntry(Collection<?> col) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected Boolean validateExtacltyOneEntry(Collection<?> col) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected Boolean validateUniqueKey(Collection<?> col) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected boolean validateOneEntry(Object object) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected boolean evaluateExpression(String expression, Object object) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected Collection<?> getCollection(Object object) throws com.opensymphony.xwork2.validator.ValidationException
object - the incoming object containing the collection to testcom.opensymphony.xwork2.validator.ValidationException - if any pb to retreave the collectionprotected Integer getUniqueKeyHashCode(Object o) throws com.opensymphony.xwork2.validator.ValidationException
o - l'entree de la collection dont on va calculer le hash de la clef uniquecom.opensymphony.xwork2.validator.ValidationException - if any pb to retreave properties valuespublic String getValidatorType()
getValidatorType in interface com.opensymphony.xwork2.validator.ValidatorgetValidatorType in class com.opensymphony.xwork2.validator.validators.FieldValidatorSupportCopyright © 2011-2012 CodeLutin. All Rights Reserved.