Class Parameter


  • @Deprecated
    public class Parameter
    extends Object
    Deprecated.
    since BEAM 4.11, use the Ceres Binding API instead
    A Parameter is a named item which has a value of type Object.

    Every parameter has an associated ParamProperties reference assigned to it which stores the properties such as type, value range and more. A single ParamProperties instance can be shared over multiple Parameter instances.

    Parameters also have an ParamEditor to let a user modify the value in a GUI and a ParamValidator to parse, format and validate it.

    Version:
    $Revision$ $Date$
    See Also:
    ParamProperties, ParamEditor, ParamValidator
    • 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 set
        handler - an exception handler
        Returns:
        true if this parameter's value has been changed
        Throws:
        IllegalArgumentException - if the value could not be set and handler 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 is null, the instanceof operator would simply return false.

        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 from null.
        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 be null
      • 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 type
        ParamValidateException - 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 or ParamValidateException occurring during parsing and validation are delegated to the given exception handler (if any).

        Parameters:
        textValue - the text value to be parsed, validated and set
        handler - an exception handler
        Returns:
        true if this parameter's value has been changed
        Throws:
        IllegalArgumentException - if the value could not be set and handler 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.
      • equalsValue

        public boolean equalsValue​(Object value)
        Deprecated.
      • setPropertyValues

        public void setPropertyValues​(PropertyMap propertyMap)
        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
      • fireParamValueChanged

        protected void fireParamValueChanged​(Parameter parameter,
                                             Object oldValue)
        Deprecated.