eu.esdihumboldt.util.validator
Class LengthValidator
java.lang.Object
eu.esdihumboldt.util.validator.AbstractValidator
eu.esdihumboldt.util.validator.LengthValidator
- All Implemented Interfaces:
- Validator
public class LengthValidator
- extends AbstractValidator
Validator for input lengths.
- Author:
- Kai Schwierczek
Nested Class Summary |
static class |
LengthValidator.Type
Type specifies what the LengthValidator should check. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LengthValidator
public LengthValidator(LengthValidator.Type type,
int length)
- Construct a validator that checks the length of the input to match the
given type and value.
- Parameters:
type
- the length attribute to check forlength
- the length to check for
validate
public String validate(Object value)
- Description copied from interface:
Validator
- Checks whether the given value is valid.
- Parameters:
value
- the value to check
- Returns:
- null, if the value is valid, otherwise the reason why it's
invalid
- See Also:
Validator.validate(Object)
getDescription
public String getDescription()
- Description copied from interface:
Validator
- Returns a human readable representation of this Validator.
- Returns:
- a human readable representation of this Validator
- See Also:
Validator.getDescription()
Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d