public class StringParamController extends java.lang.Object implements InputParamController
| Constructor and Description |
|---|
StringParamController(java.lang.String paramName)
Builds a controller of the specified String parameter.
|
StringParamController(java.lang.String paramName,
java.lang.String defaultValue,
java.lang.String[] possibleValues,
boolean allowModif)
Builds a controller of the specified String parameter and configures it.
|
StringParamController(java.lang.String paramName,
java.lang.String defaultValue,
java.lang.String regExp,
boolean allowModif)
Builds a controller of the specified String parameter and configures it.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowModification()
Tells whether the controlled parameter may be modified after initialization.
|
void |
allowModification(boolean allowModif)
Lets telling if the parameter can be modified after it initialization.
|
java.lang.Object |
check(java.lang.Object value)
Checks the value of the controlled parameter and builds a new object from this value.
|
java.lang.Object |
getDefault()
Returns the default value of the controlled parameter.
|
java.lang.String |
getDefaultValue()
Gets the default value of the parameter.
|
protected java.lang.String |
getExpectedFormat()
Gets a string which lists all the allowed values.
|
java.lang.String[] |
getPossibleValues()
Gets the list of all allowed values.
|
java.lang.String |
getRegExp()
Gets the Regular Expression that all values of this parameter must match.
|
void |
setDefaultValue(java.lang.String defaultValue)
Sets the default value of the parameter.
|
void |
setPossibleValues(java.lang.String[] possibleValues)
Sets the list of all allowed values.
|
void |
setRegExp(java.lang.String regExp)
Sets the Regular Expression that all values of this parameter must match.
|
public StringParamController(java.lang.String paramName)
paramName - Name of the controlled parameter.StringParamController(String, String, String[], boolean)public StringParamController(java.lang.String paramName,
java.lang.String defaultValue,
java.lang.String[] possibleValues,
boolean allowModif)
paramName - Name of the controlled parameter.defaultValue - Default value of this parameter. note: It may be NULL. If the next parameter is not NULL or empty, the default value must be one of its values.possibleValues - List of all allowed values. note: It may be NULL or empty. In this case, any value is allowed.allowModif - true to allow the modification of the specified parameter after its initialization, false otherwise.public StringParamController(java.lang.String paramName,
java.lang.String defaultValue,
java.lang.String regExp,
boolean allowModif)
paramName - Name of the controlled parameter.defaultValue - Default value of this parameter. note: It may be NULL. If the next parameter is not NULL or empty, the default value must be one of its values.regExp - Regular Expression that any value of this parameter must match. note: It may be NULL or empty. In this case, any value is allowed.allowModif - true to allow the modification of the specified parameter after its initialization, false otherwise.public final java.lang.String getDefaultValue()
public final void setDefaultValue(java.lang.String defaultValue)
defaultValue - The new default value. (MAY BE NULL)public final java.lang.String getRegExp()
public final void setRegExp(java.lang.String regExp)
Warning: setting a non empty regular expression will set to null
any list of allowed values eventually set in this controller.
regExp - The new Regular Expression. note: If NULL or empty, any value is allowed.public final java.lang.String[] getPossibleValues()
public final void setPossibleValues(java.lang.String[] possibleValues)
Warning: setting a non empty list of values will set to null
any regular expression eventually set in this controller.
possibleValues - The new allowed values. note: If NULL or empty, any value is allowed.public final boolean allowModification()
InputParamControllerallowModification in interface InputParamControllerpublic final void allowModification(boolean allowModif)
allowModif - true to allow its modification after initialization, false otherwise.public java.lang.Object check(java.lang.Object value)
throws UWSException
InputParamControllerChecks the value of the controlled parameter and builds a new object from this value.
check in interface InputParamControllervalue - Parameter value to check.UWSException - If the given value is strongly incorrect.protected final java.lang.String getExpectedFormat()
public java.lang.Object getDefault()
InputParamControllergetDefault in interface InputParamController