Interface SystemVariable


public interface SystemVariable
The SystemVariable interface represents a single system variable.

Individual system variables can be accessed via the SystemVariables interface.

Further documentation.

Since:
V4.4
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getType()
    Returns the type for the system variable (see method getValue() for a list of types).
    java.lang.Object getValue()
    Returns an Object representing the value of the system variable.
    void setValue​(java.lang.Object value)
    Sets a value for the system variable, when the system variable supports this.
    java.lang.String toString()
    Returns a String value for the system variable.
  • Method Details

    • setValue

      void setValue​(java.lang.Object value) throws com.ebasetech.xi.exceptions.FormRuntimeException
      Sets a value for the system variable, when the system variable supports this. Most system variables are read only.

      The object types that can be used for value vary according to the field type as shown in the table below. The field type for each system variable can be obtained with method getType(). In most cases, the mapping between object types and field types is handled automatically. Date and time fields require special consideration, particularly when calculations are performed.

      Field TypeSupported Object Types
      Boolean Boolean: any value
      String: true values are "true", "Y", "Yes", "1", false values are "false", "N", "No", "0"
      Number: 1 is true, 0 is false
      Character String: any value
      Boolean: true becomes "Y", false becomes "N"
      Number: any value
      Integer
      Number
      Currency
      String: any numeric value
      Number: any value
      Date Date: both Java Date (java.util.Date) and Javascript Date objects can be used
      String: must be in the format specified in parameter Ufs.dateFormat in file UFSSetup.properties
      Number: represents the number of milliseconds since 1st January 1970
      Datetime Date: both Java Date (java.util.Date) and Javascript Date objects can be used
      String: Date followed by a space then Time.
      Date must be in the format specified in parameter Ufs.dateFormat in file UFSSetup.properties
      Time is in the format hh:mm:ss.ttt
      Number: represents the number of milliseconds since 1st January 1970
      Time Date: both Java Date (java.util.Date) and Javascript Date objects can be used
      String: must be in the format hh:mm:ss.ttt
      Number: represents the number of milliseconds since 1st January 1970
      Object Any object type can be used. Note that these objects become part of the form state and must therefore implement the Java Serializable interface.

      Further documentation.

      Parameters:
      value -
      Throws:
      com.ebasetech.xi.exceptions.FormRuntimeException - if the value is not appropriate for the system variable type
      Since:
      V4.4
      See Also:
      Field.setValue(Object)
    • getValue

      java.lang.Object getValue()
      Returns an Object representing the value of the system variable. The Java object type returned depends on the field type which can be obtained with method getType(). Field types and their corresponding returned object types are as follows:
      • Boolean - returns a Boolean (Javascript boolean)
      • Character - returns a String (Javascript string)
      • Currency - returns a BigDecimal (Javascript number)
      • Date - returns a Long representing the number of milliseconds since 1st January 1970, where the time portion is initially set to 00:00 (Javascript number)
      • Datetime - returns a Long representing the number of milliseconds since 1st January 1970 (Javascript number)
      • Integer - returns a BigInteger (Javascript number)
      • Numeric - returns a BigDecimal (Javascript number)
      • Object - returns the object set using the setValue() method
      • Time - returns a Long representing the number of milliseconds since 1st January 1970, where the date portion is set to the current date (Javascript number)
      Further documentation.
      Returns:
      the value of the system variable
      Since:
      V4.4
      See Also:
      Field.getValue()
    • getType

      java.lang.String getType()
      Returns the type for the system variable (see method getValue() for a list of types).

      Further documentation.

      Returns:
      the system variable type
      Since:
      V4.4
    • toString

      java.lang.String toString()
      Returns a String value for the system variable.
      Overrides:
      toString in class java.lang.Object
      Since:
      V4.4