Package org.esa.snap.core.param
Interface ParamValidator
- All Known Implementing Classes:
AbstractExpressionValidator,AbstractParamValidator,BooleanExpressionValidator,BooleanValidator,ColorValidator,FileValidator,GeneralExpressionValidator,NumberValidator,ProductNodeNameValidator,StringArrayValidator,StringValidator
public interface ParamValidator
A
ParamValidator is an interface for parameter type specific value-to-text and text-to-value
conversions, data validation and comparision.
This interface strictly defines algorithms, implementors of this interface should refrain from defining any data
in their implementing classes. Any information required to correctly perform the operations defined in
ParamValidator shall be supplied by the given Parameter.
Parameter validators for a given Java class can be permanently registered in ParamValidator
- Version:
- $Revision$ $Date$
-
Method Summary
Modifier and TypeMethodDescriptionbooleanequalValues(Parameter parameter, Object value1, Object value2) Tests if the given two values are equal taking the given parameter information into account.Converts the given value into a text taking the given parameter information into account.Converts the given text into a value taking the given parameter information into account.voidTests if the given value passes all constraints given in the supplied parameter information.
-
Method Details
-
parse
Converts the given text into a value taking the given parameter information into account.- Parameters:
parameter- the parameter, must not benulltext- the text to be converted into a value, must not benull- Returns:
- the value represented by the text
- Throws:
ParamParseException
-
format
Converts the given value into a text taking the given parameter information into account.- Parameters:
parameter- the parameter, must not benullvalue- the value to be converted into a text, can benull- Returns:
- the value represented by the text, never
null. - Throws:
ParamFormatException
-
validate
Tests if the given value passes all constraints given in the supplied parameter information. The value can also benullsince parameters can be allowed to have the value 'null'.- Parameters:
parameter- the parameter, must not benullvalue- the value to be tested, can benull- Throws:
ParamValidateException
-
equalValues
Tests if the given two values are equal taking the given parameter information into account.- Parameters:
parameter- the parameter, must not benullvalue1- the first value, can benullvalue2- the second value, can also benull- Returns:
trueif the value are equal,falseotherwise
-