Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.2 Online Documentation (MoTW) Revision 3
%Class Special Method (databasic_sp_method_class.htm)
This method is used with a connection object to create a reference to a class object on the language server. The %Static method is a synonym for the %Class method.
%Class(Class)
Class | The Java class name to create a reference to. |
Var = %Class(Integer)->MAX_VALUE
Return the static fields MAX_VALUE of the Integer class. This is equivalent to the Java syntax
int Var = Integer.MAX_VALUE;
The class reference can be saved in a DBO:
Int = SecondCon->%Class(Integer)
Var = Int->MAX_VALUE
Save a reference to the class Integer to be used later (in this case in the “Var =” line)
The %Class method can be used with any class, but it is essential to provide access to static fields and methods in classes that do not have a constructor.