jaxx.runtime.validator.field
Class CollectionFieldExpressionValidator

java.lang.Object
  extended by com.opensymphony.xwork2.validator.validators.ValidatorSupport
      extended by com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
          extended by com.opensymphony.xwork2.validator.validators.FieldExpressionValidator
              extended by jaxx.runtime.validator.field.CollectionFieldExpressionValidator
All Implemented Interfaces:
com.opensymphony.xwork2.validator.FieldValidator, com.opensymphony.xwork2.validator.ShortCircuitableValidator, com.opensymphony.xwork2.validator.Validator

Deprecated. since 2.2.4, the code is moved into the org.nuiton:nuiton-validator project, will be removed in version 2.3

@Deprecated
public class CollectionFieldExpressionValidator
extends com.opensymphony.xwork2.validator.validators.FieldExpressionValidator

Un validateur basé sur FieldExpressionValidator qui valide sur une collection de propriéte.

Author:
tchemit

Nested Class Summary
static class CollectionFieldExpressionValidator.Mode
          Deprecated.  
 class CollectionFieldExpressionValidator.WalkerContext
          Deprecated.  
 
Field Summary
protected  CollectionFieldExpressionValidator.WalkerContext c
          Deprecated. le context de parcours
protected  String collectionFieldName
          Deprecated. pour indiquer la propriété qui contient la liste à valider.
protected  String expressionForFirst
          Deprecated. expression a valider sur la premiètre entrée de la collection.
protected  String expressionForLast
          Deprecated. expression a valider sur la dernière entrée de la collection.
protected  String[] keys
          Deprecated. 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
          Deprecated. le mode de validation sur la liste
protected  com.opensymphony.xwork2.util.ValueStack stack
          Deprecated.  
protected  boolean useSensitiveContext
          Deprecated. 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.
 
Fields inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
defaultMessage, log, messageKey
 
Constructor Summary
CollectionFieldExpressionValidator()
          Deprecated.  
 
Method Summary
protected  boolean evaluateExpression(String expression, Object object)
          Deprecated.  
protected  Collection<?> getCollection(Object object)
          Deprecated.  
 String getCollectionFieldName()
          Deprecated.  
 String getExpressionForFirst()
          Deprecated.  
 String getExpressionForLast()
          Deprecated.  
 String[] getKeys()
          Deprecated.  
 String getMessage(Object object)
          Deprecated.  
 CollectionFieldExpressionValidator.Mode getMode()
          Deprecated.  
protected  Integer getUniqueKeyHashCode(Object o)
          Deprecated. Calcule pour une entrée donné, le hash de la clef unique
 String getValidatorType()
          Deprecated.  
 boolean isUseSensitiveContext()
          Deprecated.  
 void setCollectionFieldName(String collectionFieldName)
          Deprecated.  
 void setExpressionForFirst(String expressionForFirst)
          Deprecated.  
 void setExpressionForLast(String expressionForLast)
          Deprecated.  
 void setKeys(String[] keys)
          Deprecated.  
 void setMode(CollectionFieldExpressionValidator.Mode mode)
          Deprecated.  
 void setUseSensitiveContext(boolean useSensitiveContext)
          Deprecated.  
 void setValueStack(com.opensymphony.xwork2.util.ValueStack stack)
          Deprecated.  
 void validate(Object object)
          Deprecated.  
protected  Boolean validateAllEntries(Collection<?> col)
          Deprecated.  
protected  Boolean validateAtLeastOneEntry(Collection<?> col)
          Deprecated.  
protected  Boolean validateExtacltyOneEntry(Collection<?> col)
          Deprecated.  
protected  Boolean validateNoneEntry(Collection<?> col)
          Deprecated.  
protected  boolean validateOneEntry(Object object)
          Deprecated.  
protected  Boolean validateUniqueKey(Collection<?> col)
          Deprecated.  
 
Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldExpressionValidator
getExpression, setExpression
 
Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
getFieldName, setFieldName, setValidatorType
 
Methods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
addActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessageKey, getMessageParameters, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setMessageParameters, setParse, setShortCircuit, setValidatorContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.opensymphony.xwork2.validator.Validator
getDefaultMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext
 

Field Detail

mode

protected CollectionFieldExpressionValidator.Mode mode
Deprecated. 
le mode de validation sur la liste


collectionFieldName

protected String collectionFieldName
Deprecated. 
pour indiquer la propriété qui contient la liste à valider.

Si cette prorpiété n'est pas renseignée alors on utilise la FieldValidatorSupport.getFieldName() pour obtenir la collection.

Cela permet d'effectuer une validation si une collection mais portant en fait sur un autre champs

Since:
1.5

useSensitiveContext

protected boolean useSensitiveContext
Deprecated. 
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.

Sinon l'expression s'applique directement sur l'entrée courant dans le parcours sans préfixe.


expressionForFirst

protected String expressionForFirst
Deprecated. 
expression a valider sur la premiètre entrée de la collection.

Note : Pour le moment, on autorise uniquement cela en mode ALL.


expressionForLast

protected String expressionForLast
Deprecated. 
expression a valider sur la dernière entrée de la collection.

Note : Pour le moment, on autorise uniquement cela en mode ALL.


keys

protected String[] keys
Deprecated. 
la liste des propriétés d'une entrée de la collection qui définit la clef unique (en mode UNIQUE_KEY).


c

protected CollectionFieldExpressionValidator.WalkerContext c
Deprecated. 
le context de parcours


stack

protected com.opensymphony.xwork2.util.ValueStack stack
Deprecated. 
Constructor Detail

CollectionFieldExpressionValidator

public CollectionFieldExpressionValidator()
Deprecated. 
Method Detail

getMode

public CollectionFieldExpressionValidator.Mode getMode()
Deprecated. 

setMode

public void setMode(CollectionFieldExpressionValidator.Mode mode)
Deprecated. 

getCollectionFieldName

public String getCollectionFieldName()
Deprecated. 

setCollectionFieldName

public void setCollectionFieldName(String collectionFieldName)
Deprecated. 

isUseSensitiveContext

public boolean isUseSensitiveContext()
Deprecated. 

setUseSensitiveContext

public void setUseSensitiveContext(boolean useSensitiveContext)
Deprecated. 

getExpressionForFirst

public String getExpressionForFirst()
Deprecated. 

setExpressionForFirst

public void setExpressionForFirst(String expressionForFirst)
Deprecated. 

getExpressionForLast

public String getExpressionForLast()
Deprecated. 

setExpressionForLast

public void setExpressionForLast(String expressionForLast)
Deprecated. 

getKeys

public String[] getKeys()
Deprecated. 

setKeys

public void setKeys(String[] keys)
Deprecated. 

validate

public void validate(Object object)
              throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Specified by:
validate in interface com.opensymphony.xwork2.validator.Validator
Overrides:
validate in class com.opensymphony.xwork2.validator.validators.FieldExpressionValidator
Throws:
com.opensymphony.xwork2.validator.ValidationException

setValueStack

public void setValueStack(com.opensymphony.xwork2.util.ValueStack stack)
Deprecated. 
Specified by:
setValueStack in interface com.opensymphony.xwork2.validator.Validator
Overrides:
setValueStack in class com.opensymphony.xwork2.validator.validators.ValidatorSupport

getMessage

public String getMessage(Object object)
Deprecated. 
Specified by:
getMessage in interface com.opensymphony.xwork2.validator.Validator
Overrides:
getMessage in class com.opensymphony.xwork2.validator.validators.ValidatorSupport

validateAllEntries

protected Boolean validateAllEntries(Collection<?> col)
                              throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

validateNoneEntry

protected Boolean validateNoneEntry(Collection<?> col)
                             throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

validateAtLeastOneEntry

protected Boolean validateAtLeastOneEntry(Collection<?> col)
                                   throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

validateExtacltyOneEntry

protected Boolean validateExtacltyOneEntry(Collection<?> col)
                                    throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

validateUniqueKey

protected Boolean validateUniqueKey(Collection<?> col)
                             throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

validateOneEntry

protected boolean validateOneEntry(Object object)
                            throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

evaluateExpression

protected boolean evaluateExpression(String expression,
                                     Object object)
                              throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Throws:
com.opensymphony.xwork2.validator.ValidationException

getCollection

protected Collection<?> getCollection(Object object)
                               throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Parameters:
object - the incoming object containing the collection to test
Returns:
the collection of the incoming object given by the fieldName property
Throws:
com.opensymphony.xwork2.validator.ValidationException - if any pb to retreave the collection

getUniqueKeyHashCode

protected Integer getUniqueKeyHashCode(Object o)
                                throws com.opensymphony.xwork2.validator.ValidationException
Deprecated. 
Calcule pour une entrée donné, le hash de la clef unique

Parameters:
o - l'entree de la collection dont on va calculer le hash de la clef unique
Returns:
le hashCode calclé de la clef unique sur l'entrée donné
Throws:
com.opensymphony.xwork2.validator.ValidationException - if any pb to retreave properties values

getValidatorType

public String getValidatorType()
Deprecated. 
Specified by:
getValidatorType in interface com.opensymphony.xwork2.validator.Validator
Overrides:
getValidatorType in class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport


Copyright © 2008-2011 CodeLutin. All Rights Reserved.