Schnittstelle Validator<T>
- Alle bekannten Implementierungsklassen:
BigDecimalValidator,BooleanValidator,DateRangeValidator,DateStringValidator,DefaultValidator,DoubleValidator,FileValidator,FloatValidator,IntegerRangeValidator,IntegerValidator,LongValidator,NumberValidator,ShortValidator,StringValidator
public interface Validator<T>
Validator api.
- Version:
- $Id$
- Autor:
- John McNally, Thomas Vandahl
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String"flexible" Rule, used in DateFormat Validatorstatic final String"format" Rule, used in DateFormat Validatorstatic final String"invalidNumber" Rule, used in the various Number Validatorsstatic final String"mask" Rule, used in StringValidatorstatic final String"maxLength" Rule, used in all validatorsstatic final String"maxValue" Rule, used in the various Number Validatorsstatic final String"minLength" Rule, used in all validatorsstatic final String"minValue" Rule, used in the various Number Validatorsstatic final String"required" Rule, used in all validators -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidassertValidity(String testValue) Determine whether a testValue meets the criteria specified in the constraints defined for this validatorvoidassertValidity(Field<T> field) Determine whether a field meets the criteria specified in the constraints defined for this validatorGet the last error message resulting from invalid input.booleanVeraltet.use isValid(Field) insteadbooleanDetermine whether a field meets the criteria specified in the constraints defined for this validator
-
Felddetails
-
FLEXIBLE_RULE_NAME
"flexible" Rule, used in DateFormat Validator- Siehe auch:
-
FORMAT_RULE_NAME
"format" Rule, used in DateFormat Validator- Siehe auch:
-
INVALID_NUMBER_RULE_NAME
"invalidNumber" Rule, used in the various Number Validators- Siehe auch:
-
MASK_RULE_NAME
"mask" Rule, used in StringValidator- Siehe auch:
-
MAX_LENGTH_RULE_NAME
"maxLength" Rule, used in all validators- Siehe auch:
-
MAX_VALUE_RULE_NAME
"maxValue" Rule, used in the various Number Validators- Siehe auch:
-
MIN_LENGTH_RULE_NAME
"minLength" Rule, used in all validators- Siehe auch:
-
MIN_VALUE_RULE_NAME
"minValue" Rule, used in the various Number Validators- Siehe auch:
-
REQUIRED_RULE_NAME
"required" Rule, used in all validators- Siehe auch:
-
-
Methodendetails
-
isValid
Determine whether a field meets the criteria specified in the constraints defined for this validator- Parameter:
field- aFieldto be tested- Gibt zurück:
- true if valid, false otherwise
-
assertValidity
Determine whether a field meets the criteria specified in the constraints defined for this validator- Parameter:
field- aFieldto be tested- Löst aus:
ValidationException- containing an error message if the testValue did not pass the validation tests.
-
isValid
Veraltet.use isValid(Field) insteadDetermine whether a testValue meets the criteria specified in the constraints defined for this validator- Parameter:
testValue- aStringto be tested- Gibt zurück:
- true if valid, false otherwise
-
assertValidity
Determine whether a testValue meets the criteria specified in the constraints defined for this validator- Parameter:
testValue- aStringto be tested- Löst aus:
ValidationException- containing an error message if the testValue did not pass the validation tests.
-
getMessage
String getMessage()Get the last error message resulting from invalid input.- Gibt zurück:
- a
Stringmessage, or the empty String "".
-