Property annotation

Property identifies functions that get and set the EGL field values in an external type; for example, in an external type that implements a widget or provides access to a Java class.

EGL package name

eglx.lang

Example use

If you declare an UpperLimit field for use by EGL developers, you can specify the declaration as follows to indicate use of functions that you coded:

UpperLimit INT { @Property{ getMethod = getUpper, 
                               setMethod = setUpper };
You can avoid specifying function names if the names of the functions are specified with the word get or set followed by the variable name. For example, if the variable is UpperLimit and a Rich UI Widget type includes functions named getUpperLimit() and setUpperLimit(), you only need to add the annotation as follows:
UpperLimit INT { @Property{} };
Annotation detail
Record Property type Annotation{
   targets = [ElementKind.FieldMbr]
}
   getMethod String;
   setMethod String;
end
Annotation fields
getMethod
A reference to the get method for the specified variable. The method has no parameters, and its return value is of the same type as the field.
setMethod
A reference to the set method for the specified variable. The method has one parameter that has the same type as the field. By convention the setMethod does not have a return value, but no error condition results if the method returns a value.
Comments

To indicate that a field is read only or write only, you can specify only one of the two annotation fields. If the application tries to read or write to an application field for which the read or write is not supported, an error occurs during compilation.

An annotation that is equivalent to Property is available for widgets that are implemented as handlers, stereotype RUIWidget. For details, see EGLProperty.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.