Package org.nuiton.validator
Interface NuitonValidator<O>
-
- All Known Implementing Classes:
XWork2NuitonValidator
public interface NuitonValidator<O>
Contract of a validator. To obtain validator, see theNuitonValidatorFactory
api.- Since:
- 2.0
- Author:
- Tony Chemit - chemit@codelutin.com
- See Also:
NuitonValidatorFactory
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
validate
NuitonValidatorResult validate(O object) throws NullPointerException
Validates the given object and returns the result of validation.- Parameters:
object
- the object to validate- Returns:
- the result of validation for the given object
- Throws:
NullPointerException
- if object isnull
.
-
getModel
NuitonValidatorModel<O> getModel()
Obtains the model of the validator.- Returns:
- the model of the validator
-
getEffectiveScopes
Set<NuitonValidatorScope> getEffectiveScopes()
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.- Returns:
- the set of effective scopes of the validator
-
getEffectiveFields
Set<String> getEffectiveFields()
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.- Returns:
- the set of effective fields of the validator
-
getEffectiveFields
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. This is a subset of effective fields of the validator.- Parameters:
scope
- given scope to use- Returns:
- the set of effective fields of the validator for the given scope
-
-