org.openxml
Class XMLElement

java.lang.Object
  |
  +--org.openxml.dom.NodeImpl
        |
        +--org.openxml.dom.ElementImpl
              |
              +--org.openxml.XMLElement

Deprecated. Alternative API will be introduced in OpenXML 1.1

public class XMLElement
extends org.openxml.dom.ElementImpl
implements Element

Base class for user XML elements. XMLDocument is designed to create elements of classes derived from XMLElement. In addition to several API extensions, user XML elements can be used to map XML documents directly into application data structures.

XMLElement extends the DOM Element with the following methods:

In order to support user elements, a document class must extend XMLDocument. It then registers tag name to element class associations using DocumentImpl.registerElement(java.lang.String, java.lang.Class), or uses an external element factory with DocumentImpl.useElementFactory(org.openxml.XMLElementFactory).

The user elements will be returns whenever DocumentImpl.createElement(java.lang.String) is called on the document, or when a document of this type is parsed.

A user element derived from XMLElement must pass the owner document and tag name to its constructor. The class and its constructor must be declared public and the constructor must have the same signature as the XMLElement constructor. The last three requirements may be relaxed if an external element factory is used.

Version:
$Revision: 1.5 $ $Date: 1999/03/30 06:49:04 $
Author:
Assaf Arkin
See Also:
Element, DocumentImpl.registerElement(java.lang.String, java.lang.Class), XMLElementFactory

Field Summary
protected  java.lang.Object _userObject
          Deprecated. Holds a user object.
 
Fields inherited from class org.openxml.dom.NodeImpl
ATTLIST_DECL_NODE, ELEMENT_DECL_NODE, PARAM_ENTITY_NODE
 
Constructor Summary
XMLElement(Document owner, java.lang.String tagName)
          Deprecated. Constructor requires owner document and element tag name.
 
Method Summary
 java.lang.String getID()
          Deprecated. Returns the identifier of this element.
 java.lang.Object getUserObject()
          Deprecated. Returns the user object associated with this element.
 void setUserObject(java.lang.Object userObject)
          Deprecated. Associates this element with a user object.
 
Methods inherited from class org.openxml.dom.ElementImpl
clone, cloneInto, cloneNode, equals, getAttribute, getAttributeNode, getAttributes, getElementsByTagName, getNodeType, getTagName, normalize, removeAttribute, removeAttributeNode, setAttribute, setAttributeNode, setNodeValue, supportsChildern, toString
 
Methods inherited from class org.openxml.dom.NodeImpl
appendChild, castNewChild, castOldChild, createNodeIterator, createTreeIterator, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, isReadOnly, makeReadOnly, notifyIterators, removeChild, removeInnerIterator, replaceChild, setOwnerDocument
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_userObject

protected java.lang.Object _userObject
Deprecated. 
Holds a user object. Any object can be associated with this element using the appropriate set/get methods.
Constructor Detail

XMLElement

public XMLElement(Document owner,
                  java.lang.String tagName)
Deprecated. 
Constructor requires owner document and element tag name. This will be provided when an element of this or a derived class is being constructed by an XMLDocument. The arguments must pass to this constructor unaffected. Derived classes must implement at least one constructor with the exact same signature to support element class registration; this requirement is relaxed if an external element factory is used.
Parameters:
owner - The owner document
tagName - The element's tag name
Method Detail

setUserObject

public void setUserObject(java.lang.Object userObject)
Deprecated. 
Associates this element with a user object. There is no limit on what the user object may hold.
Parameters:
userObject - The user object

getUserObject

public java.lang.Object getUserObject()
Deprecated. 
Returns the user object associated with this element. There is no limit on what the user object may hold.
Returns:
The user object

getID

public java.lang.String getID()
Deprecated. 
Returns the identifier of this element. Unless specifies otherwise in the DTD, this would be the value of the id attribute. It may be a textual value or null.
Returns:
The identifier of this element