Table of Contents Markup Tutorial Interfacing with Java™ Web Services

eNode UI Markup Language conforms to the W3C Recommendation for XML version 1.0, and adjunct standards. Because of this, eNode content is amenable to other XML-based standards, such as XSL Transformations, and can be easily authored, parsed and manipulated using standard XML tools. This section presents a brief overview of some of the unique language features.

Advanced Presentation Infrastructure

eNode UI Markup Language provides comprehensive support for Java™ Foundation Classes. It defines a rich collection of element types, such as:

  • frame element type to represent a top-level window
  • label element type to represent a label
  • scrollPane element type to represent a scrolling pane
  • splitPane element type to represent a split pane
  • tabbedPane element type to represent a tabbed pane
    and so on.

Objects are described in markup using elements of these and other types. An application can manifest or reconstruct objects described in the markup using a process called object realization. The process causes an element to manifest itself at run time in a form dictated by a class that implements the element’s core functionality. Object realization is also known as element realization, especially from an element’s point of view.

Pervasive Support for User-Defined Classes

Whenever possible, elements are mapped directly to standard Java classes for their core functionality. For example, a frame element is realized as an instance of javax.swing.JFrame, and a label element is realized as an instance of javax.swing.JLabel.

eNode UI Markup Language allows you to override the core class for an element type on a per element basis by specifying the name of an API-compatible class in the class attribute for an element.

Controlling the realized form of an element through its class attribute is an extremely powerful feature. See Customizing Core Functionality for an example of how to use the class attribute type.

Arbitrary Objects and JavaBeans

eNode UI Markup Language defines a large, but finite number of specialized element types. Since no language can realistically define element types to represent all conceivable types of objects, eNode UI Markup Language defines a catch all element type called object among its built-in element types. Together with the class attribute, an object element can be used to describe any arbitrary object whose class has a default public constructor, that is, a public constructor with no arguments.

Since all Java beans, by definition, have a default public constructor, you can use an object element to realize any Java bean.

See Java Beans for an example of how to realize beans and set their properties through markup.

Reference Elements

While an object is typically represented by a single element in the markup, you can define any number of equivalent representations of an object using reference elements.

A reference element refers to another element through a URI reference, and acts as a proxy for the element that it refers to — It can be used anywhere the referenced element can be used. eNode UI Markup Language defines reference element types for all built-in element types.

Reference elements are useful in situations where an object graph requires a single object to be associated with more than one object, but the most natural way to describe the associations in markup is through element containment. Using reference elements, multi-way associations can be described easily by defining as many proxies as necessary for a single element, and using a proxy in each of the places where you would normally put the referenced element.

See Button Group for an example of how to use reference elements.

A reference element that refers to another element describes an equality relation between the realized forms of both elements. Reference relations are transitive. If an element a refers to another element b, and element b, in turn, refers to yet another element c, then, provided there are no cyclical references, the relations imply that element a effectively refers to element c — meaning that the realized form of element a is the same as the realized form of element c.

It must be stressed that XML entities cannot be used to replicate the functionality of reference elements. While each reference to a given element is represented by a separate element in the DOM tree, they all share a single realized object, or core. An XML entity, on the other hand, would give you a separate realized object for each expansion of the entity. In other words, expansions of an entity are not proxies for the same element.

Reserves

eNode UI Markup Language defines a reserve element type whose content model is the wildcard content type “any.” This allows you to put any kind of content inside a reserve element. In many respects, this element type is analogous to the SVG defs element type.

A reserve element is used to hold arbitrary elements that may be needed downstream in order to describe other objects. The contents of a reserve element may be accessed by other elements through URI references, or not referenced at all.

The reserve element type is particularly useful given the restrictions on URI references. As such, all element types that allow element content, also support the reserve element type. When used, a reserve element is usually the first child element under its parent.

See Font, Border and Button Group for examples of how to use the reserve element type.

Start Tutorial.


Copyright © 2002 eNode, Inc. All Rights Reserved.