public interface SystemVariable
SystemVariable
interface represents a single system variable.
Individual system variables can be accessed via the SystemVariables
interface.
Modifier and Type | Method and 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.
|
void setValue(java.lang.Object value) throws com.ebasetech.xi.exceptions.FormRuntimeException
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 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.
|
value
- com.ebasetech.xi.exceptions.FormRuntimeException
- if the value is not appropriate for the system variable typeField.setValue(Object)
java.lang.Object getValue()
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
(Javascript boolean
)
String
(Javascript string
)
BigDecimal
(Javascript number
)
Long
representing the number of milliseconds since 1st January 1970,
where the time portion is initially set to 00:00 (Javascript number
)
Long
representing the number of milliseconds since 1st January 1970 (Javascript number
)
BigInteger
(Javascript number
)
BigDecimal
(Javascript number
)
Long
representing the number of milliseconds since 1st January 1970,
where the date portion is set to the current date (Javascript number
)
Field.getValue()
java.lang.String getType()
getValue()
for a list of types).
java.lang.String toString()
toString
in class java.lang.Object