Access a field, either static or in a Java object.
read-java-field full-field-name &optional object => field-value
checked-read-java-field full-field-name &optional object => field-value-or-nil, nil-or-condition
set-java-field full-field-name value &optional object => value
check-java-field full-field-name static-p => result
java-field-class-name-for-setting full-field-name static-p => class-name or nil
A Java object or
The value of the field.
The value of the field or
nil or a
set-java-field access the value of a field in a Java Object or a static field.
java-field-class-name-for-setting are used to check whether it is possible to access the value of the field.
full-field-name needs to be a full field name including the package and class, for example
If object is supplied and is non-nil, it must be a Java object from which to read/to which set the value. The field must be non-static in this case. If object is
nil, the field must be static.
read-java-field returns the value of the field. If it fails to get it, it signals an error. If the class is not found, this is a java-class-error, if the field is not found it is a java-field-error.
checked-read-java-field returns the value like
read-java-field and another value which is
nil when the read is successful. If the class or the field is not found,
nil and a condition specifying the error (java-field-error or java-class-error). Note that it may still signal other errors, for example if full-field-name does not look like a proper field name.
set-java-field sets the field to the value. value must be of an acceptable type (see Types and conversion between Lisp and Java) and the field must not be final, otherwise it signals java-field-setting-error.
check-java-field checks whether the field exists and matches the value of static-p, and returns a boolean result accordingly.
java-field-class-name-for-setting checks whether the field exists and matches the value of static-p and whether it is not final, and if it is returns the class name of the field. It returns
java-field-class-name-for-setting is useful for checking whether
set-java-field can be used on a a field, and whether a value is suitable to be stored in his field, by using jobject-of-class-p.
LispWorks User Guide and Reference Manual - 20 Sep 2017