Reserved Attribute: var

Description

This attribute is to instruct CookXml to assign this object to the variable specified, in addition to call the adders/setters this element may have. Note that this assignment activity may be delayed in case a helper object is used.

Attribute Values

The attribute value corresponds to the variable name.

Additional Notes

The default VarLookUp looks up variables inside an object. One can change the way to lookup the variable, even while doing XML decoding.

If the default variable lookup method is used, by default only public variables are writable. By setting the "defaultaccessible" or "accessible" property of CookXml to true, one can write private and protected variables as well, if there is no SecurityManager. Sandbox Java Web Start has a SecurityManager, so if you are going to run the application in a Sandbox Java Web Start, then do not set the accessible properties.

Examples

The following XML code create a panel object and assign it to the variable named "myPanel".

<panel var="myPanel"/>