de.jstacs.parameters.validation
Interface ParameterValidator

All Superinterfaces:
Cloneable, Storable
All Known Implementing Classes:
ConstraintValidator, NumberValidator, StorableValidator

public interface ParameterValidator
extends Storable, Cloneable

Interface for a parameter validator, i.e. a class that can validate some possible parameter value.

Author:
Jan Grau

Method Summary
 boolean checkValue(Object value)
          Returns true if the value is valid and false otherwise
 ParameterValidator clone()
          This method returns a deep copy of the current instance.
 String getErrorMessage()
          Returns the error message if checkValue() returned false.
 
Methods inherited from interface de.jstacs.Storable
toXML
 

Method Detail

checkValue

boolean checkValue(Object value)
Returns true if the value is valid and false otherwise

Parameters:
value - the value to check
Returns:
if the value is valid

getErrorMessage

String getErrorMessage()
Returns the error message if checkValue() returned false.

Returns:
the error message

clone

ParameterValidator clone()
                         throws CloneNotSupportedException
This method returns a deep copy of the current instance.

Returns:
a deep copy
Throws:
CloneNotSupportedException - if the ParameterValidator could not be cloned
See Also:
Cloneable