Package com.ebasetech.xi.api
Interface SystemVariable
public interface SystemVariable
The
SystemVariable
interface represents a single system variable.
Individual system variables can be accessed via the SystemVariables
interface.
- Since:
- V4.4
-
Method Summary
Modifier and Type Method Description java.lang.String
getType()
Returns the type for the system variable (see methodgetValue()
for a list of types).java.lang.Object
getValue()
Returns anObject
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.FormRuntimeExceptionSets 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 Type Supported 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 falseCharacter String: any value
Boolean: true becomes "Y", false becomes "N"
Number: any valueInteger
Number
CurrencyString: any numeric value
Number: any valueDate Date: both Java Date (java.util.Date) and Javascript Date objects can be used
String: must be in the format specified in parameterUfs.dateFormat
in fileUFSSetup.properties
Number: represents the number of milliseconds since 1st January 1970Datetime 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 parameterUfs.dateFormat
in fileUFSSetup.properties
Time is in the format hh:mm:ss.ttt
Number: represents the number of milliseconds since 1st January 1970Time 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 1970Object Any object type can be used. Note that these objects become part of the form state and must therefore implement the Java Serializable
interface.- 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 anObject
representing the value of the system variable. The Java object type returned depends on the field type which can be obtained with methodgetType()
. Field types and their corresponding returned object types are as follows:- Boolean - returns a
Boolean
(Javascriptboolean
) - Character - returns a
String
(Javascriptstring
) - Currency - returns a
BigDecimal
(Javascriptnumber
) - Date - returns a
Long
representing the number of milliseconds since 1st January 1970, where the time portion is initially set to 00:00 (Javascriptnumber
) - Datetime - returns a
Long
representing the number of milliseconds since 1st January 1970 (Javascriptnumber
) - Integer - returns a
BigInteger
(Javascriptnumber
) - Numeric - returns a
BigDecimal
(Javascriptnumber
) - 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 (Javascriptnumber
)
- Returns:
- the value of the system variable
- Since:
- V4.4
- See Also:
Field.getValue()
- Boolean - returns a
-
getType
java.lang.String getType()Returns the type for the system variable (see methodgetValue()
for a list of types).- Returns:
- the system variable type
- Since:
- V4.4
-
toString
java.lang.String toString()Returns a String value for the system variable.- Overrides:
toString
in classjava.lang.Object
- Since:
- V4.4
-