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 APIinsteadAParameteris a named item which has a value of typeObject.Every parameter has an associated
ParamPropertiesreference assigned to it which stores the properties such as type, value range and more. A singleParamPropertiesinstance can be shared over multipleParameterinstances.Parameters also have an
ParamEditorto let a user modify the value in a GUI and aParamValidatorto 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 voidaddParamChangeListener(ParamChangeListener listener)Deprecated.Adds a parameter change listener to this parameter.protected ParamEditorcreateEditor()Deprecated.protected ParamValidatorcreateValidator()Deprecated.booleanequalsValue(Object value)Deprecated.protected voidfireParamValueChanged(Parameter parameter, Object oldValue)Deprecated.StringformatValue(Object value)Deprecated.ParamEditorgetEditor()Deprecated.StringgetName()Deprecated.Returns the name of this parameterParamPropertiesgetProperties()Deprecated.Returns additional parameter information.ClassgetType()Deprecated.Returns the value type of this parameterParamValidatorgetValidator()Deprecated.ObjectgetValue()Deprecated.Returns the current value of this parameter.StringgetValueAsText()Deprecated.Returns the value of this parameter as string or an empty string.ClassgetValueType()Deprecated.Returns the value type of this parameter.booleanisLegalValue(Object value)Deprecated.Tests if the given value is a legal value for this parameter.booleanisTypeOf(Class valueType)Deprecated.Tests if this parameter's value type is a, is derived from or implements the given value type.booleanisUIEnabled()Deprecated.ObjectparseValue(String text)Deprecated.voidremoveParamChangeListener(ParamChangeListener listener)Deprecated.Removes the parameter change listener from this parameter.voidsetDefaultValue()Deprecated.Sets the value of this parameter to the default value specified in this parameter's attributes.voidsetProperties(ParamProperties properties)Deprecated.Sets the additional parameter information.voidsetPropertyValues(PropertyMap propertyMap)Deprecated.voidsetUIEnabled(boolean enabled)Deprecated.voidsetValue(Object newValue)Deprecated.Sets the given value as text.booleansetValue(Object newValue, ParamExceptionHandler handler)Deprecated.Sets the given value as text.voidsetValueAsText(String textValue)Deprecated.Sets the value given as text.booleansetValueAsText(String textValue, ParamExceptionHandler handler)Deprecated.Sets the value given as text.voidsetValueSet(String[] valueSet)Deprecated.voidupdateUI()Deprecated.voidvalidateValue(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
ParamValidateExceptionoccurring 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:
trueif this parameter's value has been changed- Throws:
IllegalArgumentException- if the value could not be set andhandleris 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
instanceofoperator 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, theinstanceofoperator 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:
trueif 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
ParamParseExceptionorParamValidateExceptionoccurring 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:
trueif this parameter's value has been changed- Throws:
IllegalArgumentException- if the value could not be set andhandleris 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
nullif 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
-
-