com.sun.xml.tree
Interface ElementEx
- All Known Implementing Classes:
- ElementNode
- public abstract interface ElementEx
- extends Element, NodeEx, NamespaceScoped, XmlReadable
This extends the DOM Element interface with features including XML
namespace support. An ID attribute may be visible, and applications
may request that memory usage be reduced.
There is also support for a single strongly associated object,
permitting trees of XML objects to be coupled to other frameworks
without requiring either subclassing or external tables to manage
such associations. Such techniques will be required in some cases,
perhaps in conjunction with this userObject.
Fields inherited from class org.w3c.dom.Node |
ATTRIBUTE_NODE,
CDATA_SECTION_NODE,
COMMENT_NODE,
DOCUMENT_FRAGMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_TYPE_NODE,
ELEMENT_NODE,
ENTITY_NODE,
ENTITY_REFERENCE_NODE,
NOTATION_NODE,
PROCESSING_INSTRUCTION_NODE,
TEXT_NODE |
Fields inherited from class org.w3c.dom.Node |
ATTRIBUTE_NODE,
CDATA_SECTION_NODE,
COMMENT_NODE,
DOCUMENT_FRAGMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_TYPE_NODE,
ELEMENT_NODE,
ENTITY_NODE,
ENTITY_REFERENCE_NODE,
NOTATION_NODE,
PROCESSING_INSTRUCTION_NODE,
TEXT_NODE |
Fields inherited from class org.w3c.dom.Node |
ATTRIBUTE_NODE,
CDATA_SECTION_NODE,
COMMENT_NODE,
DOCUMENT_FRAGMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_TYPE_NODE,
ELEMENT_NODE,
ENTITY_NODE,
ENTITY_REFERENCE_NODE,
NOTATION_NODE,
PROCESSING_INSTRUCTION_NODE,
TEXT_NODE |
Method Summary |
java.lang.String |
getAttribute(java.lang.String uri,
java.lang.String name)
Returns the value of an element attribute, as named according
to the XML Namespaces draft specification. |
Attr |
getAttributeNode(java.lang.String uri,
java.lang.String name)
Returns the value of an element attribute, as named according
to the XML Namespaces draft specification. |
java.lang.String |
getIdAttributeName()
Returns the name of the attribute declared to hold the element's ID,
or null if no such declaration is known. |
java.lang.Object |
getUserObject()
Returns the object associated with this element. |
void |
setUserObject(java.lang.Object obj)
Assigns an object to be associated with this element. |
void |
trimToSize()
Requests that the element minimize the amount of space it uses,
to conserve memory. |
getAttribute
public java.lang.String getAttribute(java.lang.String uri,
java.lang.String name)
- Returns the value of an element attribute, as named according
to the XML Namespaces draft specification. If there is no
such attribute, an empty string is returned.
- Parameters:
uri
- The namespace for the name; may be null to indicate
the document's default namespace.name
- The "local part" of the name, without a colon.- Returns:
- the attribute value, or an empty string
getAttributeNode
public Attr getAttributeNode(java.lang.String uri,
java.lang.String name)
- Returns the value of an element attribute, as named according
to the XML Namespaces draft specification. If there is no
such attribute, null is returned.
- Parameters:
uri
- The namespace for the name; may be null to indicate
the document's default namespace.name
- The "local part" of the name, without a colon.- Returns:
- the attribute node, or null
getIdAttributeName
public java.lang.String getIdAttributeName()
- Returns the name of the attribute declared to hold the element's ID,
or null if no such declaration is known. This is normally declared
in the Document Type Declaration (DTD). Parsers are not required to
parse DTDs, and document trees constructed without a parser may not
have access to the DTD, so such declarations may often not be known.
ID attributes are used within XML documents to support links
using IDREF and IDREFS attributes. They are also used in current
drafts of XPointer and XSL specifications.
- Returns:
- the name of the ID attribute
getUserObject
public java.lang.Object getUserObject()
- Returns the object associated with this element. In cases where
more than one such object must be so associated, the association
must be maintained externally.
setUserObject
public void setUserObject(java.lang.Object obj)
- Assigns an object to be associated with this element.
trimToSize
public void trimToSize()
- Requests that the element minimize the amount of space it uses,
to conserve memory. Children are not affected.
Submit Feedback to xml-feedback@java.sun.com