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 Stringcontextthe validation named context (can be null)protected static Map<String,List<String>>EMPTY_RESULTprotected Set<String>fieldNamesthe list of field names detected for this validatorprotected Class<O>typethe type of bean to validateprotected com.opensymphony.xwork2.validator.DelegatingValidatorContextvalidationContextprotected com.opensymphony.xwork2.ValidationAwareSupportvalidationSupportprotected com.opensymphony.xwork2.validator.ActionValidatorManagervalidatorprotected com.opensymphony.xwork2.util.ValueStackvs
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsField(String fieldName)Test if the validator contains the field given his nameStringgetContext()Set<String>getFieldNames()Class<O>getType()com.opensymphony.xwork2.validator.ActionValidatorManagergetValidator()StringtoString()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:
trueif validator contaisn this field,falseotherwise
-
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é.
-
-