public interface ScriptVariable
Modifier and Type | Method and Description |
---|---|
void |
delete()
Delete the variable.
|
void |
delete(Object event)
Delete the variable.
|
boolean |
exists()
Determine if the variable exists without the need of an event object.
|
boolean |
exists(Object event)
Determine if the variable exists in the given event object.
|
String |
getName()
Get the name of the variable.
|
VariableType |
getType()
Get the type of the variable.
|
Object |
getValue()
Get the variable's value.
|
Object |
getValue(Object event)
Get the variable's value.
|
void |
setValue(Object value)
Set the variable's value.
|
void |
setValue(Object event,
Object value)
Set the variable's value.
|
String getName()
VariableType getType()
boolean exists()
exists(null)
.true
if the variable exists without supplying an event object,
false
otherwise.boolean exists(Object event)
event
- the event to examine to determine the presence of the variable (if necessary).true
if the variable exists given the specified event object,
false
otherwise.Object getValue()
getValue(null)
.null
if the variable has no current value.
A null
value will also be returned if the variable relates to an
event parameter as no such parameter was supplied.exists()
Object getValue(Object event)
event
- the event to get the variable's value from (if necessary).null
if the variable has no current value.exists(Object)
void setValue(Object value) throws NullPointerException, UnsupportedOperationException, ClassCastException
setValue(null, value)
.
If the variable type is not VariableType.STRING
but a value of type String
is provided, the SIS will attempt to parse the string value in the same way as performed
during composition, trigger, or macro parsing in order to try to find a real assignable
value for the variable.
value
- the new value. The value must be the correct object type for the variable,
or a string value that is valid for the variable type.NullPointerException
- if the variable cannot be assigned without providing an
event object.UnsupportedOperationException
- if the variable is a read-only variable.IllegalArgumentException
- if the value is not the correct type for the variable,
or is a string that cannot be parsed to a suitable value for the variable.ClassCastException
- if the value is neither a string nor an object of the correct
type for the variable.void setValue(Object event, Object value) throws NullPointerException, UnsupportedOperationException, ClassCastException
If the variable type is not VariableType.STRING
but a value of type String
is provided, the SIS will attempt to parse the string value in the same way as performed
during composition, trigger, or macro parsing in order to try to find a real assignable
value for the variable.
event
- the event to set the variable's value in (if necessary).value
- the new value. The value must be the correct object type for the variable,
or a string value that is valid for the variable type.NullPointerException
- if event
is null
and the variable
cannot be assigned without providing an event object.UnsupportedOperationException
- if the variable is a read-only variable.IllegalArgumentException
- if the value is not the correct type for the variable,
or is a string that cannot be parsed to a suitable value for the variable.ClassCastException
- if the value is neither a string nor an object of the correct
type for the variable.void delete() throws NullPointerException, UnsupportedOperationException
delete(Object)
delete(null)}.NullPointerException
- if the variable cannot be deleted without providing an
event object.UnsupportedOperationException
- if the variable is a read-only variable or cannot
be deleted for other reasons.void delete(Object event) throws NullPointerException, UnsupportedOperationException
event
- the event to delete the variable's value from (if necessary).NullPointerException
- if event
is null
and the variable
cannot be deleted without providing an event object.UnsupportedOperationException
- if the variable is a read-only variable or cannot
be deleted for other reasons.