Ceres Binding API
instead@Deprecated public class Parameter extends Object
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.
ParamProperties
,
ParamEditor
,
ParamValidator
Constructor and Description |
---|
Parameter(String name)
Deprecated.
|
Parameter(String name,
Object value)
Deprecated.
|
Parameter(String name,
Object value,
ParamProperties properties)
Deprecated.
|
Parameter(String name,
ParamProperties properties)
Deprecated.
|
Modifier and Type | Method and 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 parameter
|
ParamProperties |
getProperties()
Deprecated.
Returns additional parameter information.
|
Class |
getType()
Deprecated.
Returns the value type of this parameter
|
ParamValidator |
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.
|
public Parameter(String name)
public Parameter(String name, ParamProperties properties)
public Parameter(String name, Object value, ParamProperties properties)
public String getName()
public Class getType()
public Object getValue()
public void setValue(Object newValue) throws ParamValidateException
newValue
- the new value to be setParamValidateException
public boolean setValue(Object newValue, ParamExceptionHandler handler)
Any ParamValidateException
occurring while performing the validation are delegated to the given
exception handler (if any).
newValue
- the new value to be sethandler
- an exception handlertrue
if this parameter's value has been changedIllegalArgumentException
- if the value could not be set and handler
is null or the handler
did not handle the errorpublic void setDefaultValue()
public Class getValueType()
java.lang.String.class
) is returned.null
public boolean isTypeOf(Class valueType)
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
.valueType
- the value typetrue
, if this parameter's value type is a, is derived from or implements the given value
typepublic boolean isLegalValue(Object value)
true
if sopublic ParamProperties getProperties()
null
.null
public void setProperties(ParamProperties properties)
properties
- the additional parameter information, must not be null
public void setValueAsText(String textValue) throws ParamParseException, ParamValidateException
The method first parses the given text then validates the resulting object and finally sets this parameter to the validated object.
textValue
- the text value to be parsed, validated and setParamParseException
- if the given text value could not be converted to the required parameter typeParamValidateException
- if the parsed value is not validpublic boolean setValueAsText(String textValue, ParamExceptionHandler handler)
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).
textValue
- the text value to be parsed, validated and sethandler
- an exception handlertrue
if this parameter's value has been changedIllegalArgumentException
- if the value could not be set and handler
is null or the handler
did not handle the errorpublic String getValueAsText()
public Object parseValue(String text) throws ParamParseException
ParamParseException
public String formatValue(Object value) throws ParamFormatException
ParamFormatException
public void validateValue(Object value) throws ParamValidateException
ParamValidateException
public boolean equalsValue(Object value)
public void setPropertyValues(PropertyMap propertyMap)
public ParamValidator getValidator()
protected ParamValidator createValidator()
public ParamEditor getEditor()
public boolean isUIEnabled()
public void setUIEnabled(boolean enabled)
public void updateUI()
protected ParamEditor createEditor()
null
if an instantiation error
occurspublic void setValueSet(String[] valueSet)
public void addParamChangeListener(ParamChangeListener listener)
listener
- the listener to be addedpublic void removeParamChangeListener(ParamChangeListener listener)
listener
- the listener to be removedCopyright © 2002–2014 Brockmann Consult GmbH. All rights reserved.