Package org.nuiton.validator.xwork2
Class XWork2ScopeValidator<O>
- java.lang.Object
-
- org.nuiton.validator.xwork2.XWork2ScopeValidator<O>
-
- Type Parameters:
O
- type of the bean to validate.
public class XWork2ScopeValidator<O> extends Object
A customized validator for a given bean. Use the methodvalidate(Object)
to obtain the messages detected by the validator for the given bean.- Since:
- 2.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected String
context
the validation named context (can be null)protected static Map<String,List<String>>
EMPTY_RESULT
protected Set<String>
fieldNames
the list of field names detected for this validatorprotected Class<O>
type
the type of bean to validateprotected com.opensymphony.xwork2.validator.DelegatingValidatorContext
validationContext
protected com.opensymphony.xwork2.ValidationAwareSupport
validationSupport
protected com.opensymphony.xwork2.validator.ActionValidatorManager
validator
protected com.opensymphony.xwork2.util.ValueStack
vs
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsField(String fieldName)
Test if the validator contains the field given his nameString
getContext()
Set<String>
getFieldNames()
Class<O>
getType()
com.opensymphony.xwork2.validator.ActionValidatorManager
getValidator()
String
toString()
Map<String,List<String>>
validate(O bean)
Valide le bean donné et retourne les messages produits.
-
-
-
Field Detail
-
context
protected String context
the validation named context (can be null)
-
validationSupport
protected com.opensymphony.xwork2.ValidationAwareSupport validationSupport
-
validationContext
protected com.opensymphony.xwork2.validator.DelegatingValidatorContext validationContext
-
validator
protected com.opensymphony.xwork2.validator.ActionValidatorManager validator
-
vs
protected com.opensymphony.xwork2.util.ValueStack vs
-
-
Method Detail
-
getContext
public String getContext()
-
getValidator
public com.opensymphony.xwork2.validator.ActionValidatorManager getValidator()
-
containsField
public boolean containsField(String fieldName)
Test if the validator contains the field given his name- Parameters:
fieldName
- the name of the searched field- Returns:
true
if validator contaisn this field,false
otherwise
-
validate
public Map<String,List<String>> validate(O bean)
Valide le bean donné et retourne les messages produits.- Parameters:
bean
- le bean a valider (il doit etre non null)- Returns:
- le dictionnaire des messages produits par la validation indexées par le nom du champs du bean impacté.
-
-