eu.esdihumboldt.util.validator
Class AbstractValidator
java.lang.Object
eu.esdihumboldt.util.validator.AbstractValidator
- All Implemented Interfaces:
- Validator
- Direct Known Subclasses:
- DigitCountValidator, EnumerationValidator, LengthValidator, NumberValidator, PatternValidator
public abstract class AbstractValidator
- extends Object
- implements Validator
Abstract validator implementation containing helper methods for conversion.
- Author:
- Kai Schwierczek
Method Summary |
|
getObjectAs(Object o,
Class<T> type)
Converts the given object to the given class if possible. |
boolean |
isAlwaysTrue()
Returns true, if this Validator validates all values to true.
The result must not necessarily be correct. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractValidator
public AbstractValidator()
getObjectAs
public <T> T getObjectAs(Object o,
Class<T> type)
throws org.springframework.core.convert.ConversionException
- Converts the given object to the given class if possible.
- Parameters:
o
- the object to converttype
- the target type
- Returns:
- the converted object
- Throws:
org.springframework.core.convert.ConversionException
- if the object couldn't be converted to the
target type
isAlwaysTrue
public boolean isAlwaysTrue()
- Description copied from interface:
Validator
- Returns true, if this Validator validates all values to true.
The result must not necessarily be correct. If the validator does not
know its result for sure it must return false.
- Specified by:
isAlwaysTrue
in interface Validator
- Returns:
- true, iff the validator knows for sure, that it validates all
values to true
- See Also:
Validator.isAlwaysTrue()
Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d