Package org.nuiton.validator.xwork2
Class XWork2NuitonValidator<O>
- java.lang.Object
-
- org.nuiton.validator.xwork2.XWork2NuitonValidator<O>
-
- All Implemented Interfaces:
NuitonValidator<O>
public class XWork2NuitonValidator<O> extends Object implements NuitonValidator<O>
Implementation ofNuitonValidator
usingXWork2
validators.- Since:
- 2.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected NuitonValidatorModel<O>
model
protected Map<NuitonValidatorScope,XWork2ScopeValidator<O>>
validators
xworks scope validators *
-
Constructor Summary
Constructors Constructor Description XWork2NuitonValidator(NuitonValidatorModel<O> model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getEffectiveFields()
Obtains the set of effective fields for the validator : means the very fields validated by the validator.Set<String>
getEffectiveFields(NuitonValidatorScope scope)
Obtains the set of effective fields for the validator for the given scope : means the very fields validated by the validator.Set<NuitonValidatorScope>
getEffectiveScopes()
Obtains the set of effective scopes for the validator : means the very scopes that the validator is dealing with.NuitonValidatorModel<O>
getModel()
Obtains the model of the validator.NuitonValidatorResult
validate(O object)
Validates the given object and returns the result of validation.
-
-
-
Field Detail
-
model
protected NuitonValidatorModel<O> model
-
validators
protected Map<NuitonValidatorScope,XWork2ScopeValidator<O>> validators
xworks scope validators *
-
-
Constructor Detail
-
XWork2NuitonValidator
public XWork2NuitonValidator(NuitonValidatorModel<O> model)
-
-
Method Detail
-
validate
public NuitonValidatorResult validate(O object) throws NullPointerException
Description copied from interface:NuitonValidator
Validates the given object and returns the result of validation.- Specified by:
validate
in interfaceNuitonValidator<O>
- Parameters:
object
- the object to validate- Returns:
- the result of validation for the given object
- Throws:
NullPointerException
- if object isnull
.
-
getEffectiveScopes
public Set<NuitonValidatorScope> getEffectiveScopes()
Description copied from interface:NuitonValidator
Obtains the set of effective scopes for the validator : means the very scopes that the validator is dealing with. This is a subset of the model authorized scopes.- Specified by:
getEffectiveScopes
in interfaceNuitonValidator<O>
- Returns:
- the set of effective scopes of the validator
-
getEffectiveFields
public Set<String> getEffectiveFields()
Description copied from interface:NuitonValidator
Obtains the set of effective fields for the validator : means the very fields validated by the validator. This is a sub set of fields of the object to validate.- Specified by:
getEffectiveFields
in interfaceNuitonValidator<O>
- Returns:
- the set of effective fields of the validator
-
getEffectiveFields
public Set<String> getEffectiveFields(NuitonValidatorScope scope)
Description copied from interface:NuitonValidator
Obtains the set of effective fields for the validator for the given scope : means the very fields validated by the validator. This is a subset of effective fields of the validator.- Specified by:
getEffectiveFields
in interfaceNuitonValidator<O>
- Parameters:
scope
- given scope to use- Returns:
- the set of effective fields of the validator for the given scope
-
getModel
public NuitonValidatorModel<O> getModel()
Description copied from interface:NuitonValidator
Obtains the model of the validator.- Specified by:
getModel
in interfaceNuitonValidator<O>
- Returns:
- the model of the validator
-
-