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 TypMethodeBeschreibungvoid
assertValidity
(String testValue) Determine whether a testValue meets the criteria specified in the constraints defined for this validatorvoid
assertValidity
(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.boolean
Veraltet.use isValid(Field) insteadboolean
Determine 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
- aField
to 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
- aField
to 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
- aString
to 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
- aString
to 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
String
message, or the empty String "".
-