Interface ScriptVariable
-
public interface ScriptVariable
Descriptor class for a composition script variable obtainable by an SBB via an SCS Activity, Interceptor Activity, or Composition Activity.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getName
String getName()
Get the name of the variable.- Returns:
- the name of the variable.
-
getType
VariableType getType()
Get the type of the variable.- Returns:
- the type of the variable.
-
exists
boolean exists()
Determine if the variable exists without the need of an event object. This method is equivalent toexists(null)
.- Returns:
true
if the variable exists without supplying an event object,false
otherwise.
-
exists
boolean exists(Object event)
Determine if the variable exists in the given event object. The value of some variables are independent from an event object so may exist regardless of the event type.- Parameters:
event
- the event to examine to determine the presence of the variable (if necessary).- Returns:
true
if the variable exists given the specified event object,false
otherwise.
-
getValue
Object getValue()
Get the variable's value. This method should only be used by variables that exist without the need of an event object.and is equivalent togetValue(null)
.- Returns:
- the variable's value, or
null
if the variable has no current value. Anull
value will also be returned if the variable relates to an event parameter as no such parameter was supplied. - See Also:
exists()
-
getValue
Object getValue(Object event)
Get the variable's value.- Parameters:
event
- the event to get the variable's value from (if necessary).- Returns:
- the variable's value, or
null
if the variable has no current value. - See Also:
exists(Object)
-
setValue
void setValue(Object value) throws NullPointerException, UnsupportedOperationException, ClassCastException
Set the variable's value. This method should only be used by variables that exist without the need of an event object.and is equivalent tosetValue(null, value)
.If the variable type is not
VariableType.STRING
but a value of typeString
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.- Parameters:
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.- Throws:
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.
-
setValue
void setValue(Object event, Object value) throws NullPointerException, UnsupportedOperationException, ClassCastException
Set the variable's value.If the variable type is not
VariableType.STRING
but a value of typeString
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.- Parameters:
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.- Throws:
NullPointerException
- ifevent
isnull
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.
-
delete
void delete() throws NullPointerException, UnsupportedOperationException
Delete the variable. This method should only be used by variables that exist without the need of an event object and is equivalent todelete(Object)
delete(null)}.- Throws:
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.- Since:
- SIS 2.3.1
-
delete
void delete(Object event) throws NullPointerException, UnsupportedOperationException
Delete the variable.- Parameters:
event
- the event to delete the variable's value from (if necessary).- Throws:
NullPointerException
- ifevent
isnull
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.- Since:
- SIS 2.3.1
-
-