Class Parameter
- java.lang.Object
-
- org.esa.snap.core.param.Parameter
-
@Deprecated public class Parameter extends Object
Deprecated.since BEAM 4.11, use theCeres Binding API
insteadAParameter
is a named item which has a value of typeObject
.Every parameter has an associated
ParamProperties
reference assigned to it which stores the properties such as type, value range and more. A singleParamProperties
instance can be shared over multipleParameter
instances.Parameters also have an
ParamEditor
to let a user modify the value in a GUI and aParamValidator
to parse, format and validate it.- Version:
- $Revision$ $Date$
- See Also:
ParamProperties
,ParamEditor
,ParamValidator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addParamChangeListener(ParamChangeListener listener)
Deprecated.Adds a parameter change listener to this parameter.protected ParamEditor
createEditor()
Deprecated.protected ParamValidator
createValidator()
Deprecated.boolean
equalsValue(Object value)
Deprecated.protected void
fireParamValueChanged(Parameter parameter, Object oldValue)
Deprecated.String
formatValue(Object value)
Deprecated.ParamEditor
getEditor()
Deprecated.String
getName()
Deprecated.Returns the name of this parameterParamProperties
getProperties()
Deprecated.Returns additional parameter information.Class
getType()
Deprecated.Returns the value type of this parameterParamValidator
getValidator()
Deprecated.Object
getValue()
Deprecated.Returns the current value of this parameter.String
getValueAsText()
Deprecated.Returns the value of this parameter as string or an empty string.Class
getValueType()
Deprecated.Returns the value type of this parameter.boolean
isLegalValue(Object value)
Deprecated.Tests if the given value is a legal value for this parameter.boolean
isTypeOf(Class valueType)
Deprecated.Tests if this parameter's value type is a, is derived from or implements the given value type.boolean
isUIEnabled()
Deprecated.Object
parseValue(String text)
Deprecated.void
removeParamChangeListener(ParamChangeListener listener)
Deprecated.Removes the parameter change listener from this parameter.void
setDefaultValue()
Deprecated.Sets the value of this parameter to the default value specified in this parameter's attributes.void
setProperties(ParamProperties properties)
Deprecated.Sets the additional parameter information.void
setPropertyValues(PropertyMap propertyMap)
Deprecated.void
setUIEnabled(boolean enabled)
Deprecated.void
setValue(Object newValue)
Deprecated.Sets the given value as text.boolean
setValue(Object newValue, ParamExceptionHandler handler)
Deprecated.Sets the given value as text.void
setValueAsText(String textValue)
Deprecated.Sets the value given as text.boolean
setValueAsText(String textValue, ParamExceptionHandler handler)
Deprecated.Sets the value given as text.void
setValueSet(String[] valueSet)
Deprecated.void
updateUI()
Deprecated.void
validateValue(Object value)
Deprecated.
-
-
-
Constructor Detail
-
Parameter
public Parameter(String name)
Deprecated.
-
Parameter
public Parameter(String name, ParamProperties properties)
Deprecated.
-
Parameter
public Parameter(String name, Object value, ParamProperties properties)
Deprecated.
-
-
Method Detail
-
getName
public String getName()
Deprecated.Returns the name of this parameter
-
getType
public Class getType()
Deprecated.Returns the value type of this parameter
-
getValue
public Object getValue()
Deprecated.Returns the current value of this parameter.
-
setValue
public void setValue(Object newValue) throws ParamValidateException
Deprecated.Sets the given value as text. The method first validates the given value before sets it to this parameter's value.- Parameters:
newValue
- the new value to be set- Throws:
ParamValidateException
-
setValue
public boolean setValue(Object newValue, ParamExceptionHandler handler)
Deprecated.Sets the given value as text. The method first validates the given value before sets it to this parameter's value.Any
ParamValidateException
occurring while performing the validation are delegated to the given exception handler (if any).- Parameters:
newValue
- the new value to be sethandler
- an exception handler- Returns:
true
if this parameter's value has been changed- Throws:
IllegalArgumentException
- if the value could not be set andhandler
is null or the handler did not handle the error
-
setDefaultValue
public void setDefaultValue()
Deprecated.Sets the value of this parameter to the default value specified in this parameter's attributes.
-
getValueType
public Class getValueType()
Deprecated.Returns the value type of this parameter. If the value type has not been specified in this parameter's attributes, the string type (java.lang.String.class
) is returned.- Returns:
- this parameter's value type, never
null
-
isTypeOf
public boolean isTypeOf(Class valueType)
Deprecated.Tests if this parameter's value type is a, is derived from or implements the given value type.The method should be used instead of the
instanceof
operator in order to determine whether this parameter's value is compatible with a given class (or interface). That is, if the parameter's value isnull
, theinstanceof
operator would simply returnfalse
.- Parameters:
valueType
- the value type- Returns:
true
, if this parameter's value type is a, is derived from or implements the given value type
-
isLegalValue
public boolean isLegalValue(Object value)
Deprecated.Tests if the given value is a legal value for this parameter.- Returns:
true
if so
-
getProperties
public ParamProperties getProperties()
Deprecated.Returns additional parameter information. Parameter informations are provided as a set of attributes. The value returned is guaranteed to be always different fromnull
.- Returns:
- the parameter information, never
null
-
setProperties
public void setProperties(ParamProperties properties)
Deprecated.Sets the additional parameter information. Parameter informations are provided as a set of attributes.- Parameters:
properties
- the additional parameter information, must not benull
-
setValueAsText
public void setValueAsText(String textValue) throws ParamParseException, ParamValidateException
Deprecated.Sets the value given as text.The method first parses the given text then validates the resulting object and finally sets this parameter to the validated object.
- Parameters:
textValue
- the text value to be parsed, validated and set- Throws:
ParamParseException
- if the given text value could not be converted to the required parameter typeParamValidateException
- if the parsed value is not valid
-
setValueAsText
public boolean setValueAsText(String textValue, ParamExceptionHandler handler)
Deprecated.Sets the value given as text.The method first parses the given text then validates the resulting object and finally sets this parameter to the validated object.
Any
ParamParseException
orParamValidateException
occurring during parsing and validation are delegated to the given exception handler (if any).- Parameters:
textValue
- the text value to be parsed, validated and sethandler
- an exception handler- Returns:
true
if this parameter's value has been changed- Throws:
IllegalArgumentException
- if the value could not be set andhandler
is null or the handler did not handle the error
-
getValueAsText
public String getValueAsText()
Deprecated.Returns the value of this parameter as string or an empty string.- Returns:
- the value of this parameter as string or an empty string.
-
parseValue
public Object parseValue(String text) throws ParamParseException
Deprecated.- Throws:
ParamParseException
-
formatValue
public String formatValue(Object value) throws ParamFormatException
Deprecated.- Throws:
ParamFormatException
-
validateValue
public void validateValue(Object value) throws ParamValidateException
Deprecated.- Throws:
ParamValidateException
-
equalsValue
public boolean equalsValue(Object value)
Deprecated.
-
setPropertyValues
public void setPropertyValues(PropertyMap propertyMap)
Deprecated.
-
getValidator
public ParamValidator getValidator()
Deprecated.
-
createValidator
protected ParamValidator createValidator()
Deprecated.
-
getEditor
public ParamEditor getEditor()
Deprecated.
-
isUIEnabled
public boolean isUIEnabled()
Deprecated.
-
setUIEnabled
public void setUIEnabled(boolean enabled)
Deprecated.
-
updateUI
public void updateUI()
Deprecated.
-
createEditor
protected ParamEditor createEditor()
Deprecated.- Returns:
- an appropriate _editor for this parameter _properties, can be
null
if an instantiation error occurs
-
setValueSet
public void setValueSet(String[] valueSet)
Deprecated.
-
addParamChangeListener
public void addParamChangeListener(ParamChangeListener listener)
Deprecated.Adds a parameter change listener to this parameter.- Parameters:
listener
- the listener to be added
-
removeParamChangeListener
public void removeParamChangeListener(ParamChangeListener listener)
Deprecated.Removes the parameter change listener from this parameter.- Parameters:
listener
- the listener to be removed
-
-