|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jbbres.lib.actions.tools.elements.SimpleElement com.jbbres.lib.actions.tools.elements.SimpleVariable<C>
public abstract class SimpleVariable<C>
This abstract class provides default implementations for most of the methods
in the Variable
interface.
it is recommended to create your own variables as subclasses of
RuntimeVariable
or StorageVariable
.
v1.1.0:
isValidValueClass(Class)
)
Constructor Summary | |
---|---|
SimpleVariable(Workflow workflow)
Instantiates a new variable. |
Method Summary | |
---|---|
void |
addVariableServiceListener(VariableServiceListener l)
Adds a listener to this variable. |
void |
fireVariableInstanceNameChanges(java.lang.String oldInstanceName)
Calls the variableInstanceNameChanges method of all the
listener. |
void |
fireVariableValueChanges(java.lang.Object oldValue)
Calls the variableValueChanges method of all the listener. |
VariableDescription |
getDescription()
Returns the description of the element. |
java.lang.String |
getInstanceName()
Returns the variable instance name. |
VariableService |
getService()
Returns the service associated to the element. |
VariableServiceListener[] |
getVariableListeners()
Returns the variables listeners. |
boolean |
isValidValueClass(java.lang.Class<? extends java.lang.Object> clazz)
Returns true if an instance of the given class is an
acceptable value for the variable. |
void |
removeVariableServiceListener(VariableServiceListener l)
Removes a listener to this variable. |
void |
setInstanceName(java.lang.String name)
Sets the variable instance name. |
java.lang.Object |
setValue(java.lang.Object newValue)
Overriden for internal use. |
abstract void |
setVariableValue(C newValue)
Sets the variable value. |
java.lang.Class<? extends java.lang.Object> |
valueClass()
Returns the type of the object returned by the getValue
method. |
Methods inherited from class com.jbbres.lib.actions.tools.elements.SimpleElement |
---|
getWorkflow |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jbbres.lib.actions.elements.Variable |
---|
getEditor, getRenderer |
Methods inherited from interface com.jbbres.lib.actions.elements.Element |
---|
getParameters, setParameters |
Methods inherited from interface com.jbbres.lib.actions.elements.VariableService |
---|
getValue, isEditable |
Constructor Detail |
---|
public SimpleVariable(Workflow workflow)
workflow
- - the workflowMethod Detail |
---|
public VariableService getService()
Element
getService
in interface Element
getService
in interface Variable
getService
in class SimpleElement
ElementService
public abstract void setVariableValue(C newValue) throws InvalidVariableValueException
newValue
- the new variable value
InvalidVariableValueException
- the invalid variable value exceptionpublic java.lang.Object setValue(java.lang.Object newValue) throws InvalidVariableValueException
Use setVariableValue(Object)
instead.
setValue
in interface VariableService
newValue
- - the new value of the variable.
null
if the
variable had no value before the call of this method.
InvalidVariableValueException
- if an invalid value is trying to be assigned to the variableVariableService.getValue()
,
VariableService.isValidValueClass(Class)
public java.lang.Class<? extends java.lang.Object> valueClass()
VariableService
getValue
method.
valueClass
in interface VariableService
getValue
methodVariableService.getValue()
public boolean isValidValueClass(java.lang.Class<? extends java.lang.Object> clazz)
VariableService
true
if an instance of the given class is an
acceptable value for the variable.
isValidValueClass
in interface VariableService
clazz
- - the clazz
true
if an instance of the given class is an
acceptable value for the variable. false
otherwise.VariableService.setValue(Object)
public java.lang.String getInstanceName()
VariableService
getInstanceName
in interface VariableService
VariableService.setInstanceName(String)
public void setInstanceName(java.lang.String name) throws InvalidVariableInstanceNameException
VariableService
setInstanceName
in interface VariableService
name
- - new instance name
InvalidVariableInstanceNameException
- if the instance name is not valid, for example if another
variable in the workflow has a similar instance name.VariableService.getInstanceName()
public VariableDescription getDescription()
Element
getDescription
in interface Element
getDescription
in interface Variable
getDescription
in class SimpleElement
ElementDescription
public void addVariableServiceListener(VariableServiceListener l)
VariableService
addVariableServiceListener
in interface VariableService
l
- - the new listenerVariableService.removeVariableServiceListener(VariableServiceListener)
public void removeVariableServiceListener(VariableServiceListener l)
VariableService
removeVariableServiceListener
in interface VariableService
l
- - the listener to removeVariableService.addVariableServiceListener(VariableServiceListener)
public VariableServiceListener[] getVariableListeners()
public void fireVariableValueChanges(java.lang.Object oldValue)
variableValueChanges
method of all the listener.
oldValue
- - previous value of the variablepublic void fireVariableInstanceNameChanges(java.lang.String oldInstanceName)
variableInstanceNameChanges
method of all the
listener.
oldInstanceName
- - previous instanceName
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |