org.naturalcli
Interface IParameterType

All Known Implementing Classes:
BinaryParamType, ByteParamType, DoubleParamType, EmailParamType, FileParamType, FloatParamType, HexadecimalParamType, IdentifierParamType, IntegerParamType, LongParamType, OctalParamType, ShortParamType, StringParamType, URLParamType, WorkingURLParamType

public interface IParameterType

A parameter type for all the commands.

Author:
Ferran Busquets

Method Summary
 java.lang.Object convertParameterValue(java.lang.String strRepresentation)
          Converts the string representing the parameter value to the corresponding type value.
 java.lang.String getParameterTypeName()
          Gets the parameter type name.
 boolean validateParameter(java.lang.String value)
          Checks if a parameter value is of this type of parameter.
 java.lang.String validationMessage(java.lang.String value)
          Checks if a parameter value is of this type of parameter and returns a detailed message if the validation fails.
 

Method Detail

getParameterTypeName

java.lang.String getParameterTypeName()
Gets the parameter type name.

Returns:
the name of the parameter type

validateParameter

boolean validateParameter(java.lang.String value)
Checks if a parameter value is of this type of parameter.

Parameters:
the - string to be validated as this parameter type
Returns:
true if the validation it's right; false otherwise

validationMessage

java.lang.String validationMessage(java.lang.String value)
Checks if a parameter value is of this type of parameter and returns a detailed message if the validation fails.

Parameters:
the - string to be validated as this parameter type
Returns:
null if the validation it's right; a detailed message if something it's wrong

convertParameterValue

java.lang.Object convertParameterValue(java.lang.String strRepresentation)
Converts the string representing the parameter value to the corresponding type value.

Parameters:
strRepresentation - the string representation of the value
Returns:
real object value