Table of Contents Markup Tutorial Interfacing with Java™ Web Services

You can realize arbitrary objects by using an object element whose class attribute identifies an accessible Java class with a default public constructor, that is, a public constructor with no arguments. User-defined Java Beans for which there are no predefined tags can also be realized using object elements.

Example: Realizing Arbitrary Objects

The following example realizes a Date object from the java.util package.

Since a Date object is not a presentation component, eNode Sandbox tries to show the object’s string representation in an information dialog if the object is successfully realized. The information dialog is actually a feature of eNode Sandbox, not of eNode Object Realizer, which simply realizes an instance of java.util.Date, as instructed.

Make this object in eNode Sandbox. The result should be similar to the following:

Now, try to realize the following objects one at a time:

<font/>

<color value="textHighlight"/>

<object class="javax.swing.JLabel"/>

In the last case, even though a label is clearly a presentation component, eNode Object Realizer treats it as a generic object. Using a label element instead of an object element would, in effect, typecast the object to an instance of javax.swing.JLabel. eNode Object Realizer would then show the realized label in the proper presentation context instead of showing a generic string reprsentation in the information dialog.


Copyright © 2002 eNode, Inc. All Rights Reserved.