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 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 to exists(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 to getValue(null).
        Returns:
        the variable's value, or 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.
        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 to 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.

        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 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.

        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 - 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.