org.apache.crimson.tree
Interface NodeEx

All Superinterfaces:
org.w3c.dom.Node, XmlWritable
All Known Subinterfaces:
ElementEx
All Known Implementing Classes:
ElementNode2, NodeBase

public interface NodeEx
extends org.w3c.dom.Node, XmlWritable

This interface defines accessors to inherited attributes of nodes, and provides support for using XML Namespaces.

Author:
David Brownell

Field Summary
 
Fields inherited from interface 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
 int getIndexOf(org.w3c.dom.Node maybeChild)
          Returns the index of the node in the list of children, such that item() will return that child.
 String getInheritedAttribute(String name)
          Returns the value of a given attribute, tracing up through ancestors if needed.
 String getLanguage()
          Returns the language id (value of xml:lang attribute) applicable to this node, if known.
 boolean isReadonly()
          Method to allow easy determination of whether a node is read only.
 void setReadonly(boolean deep)
          Sets the node to be readonly; applies recursively to the children of this node if the parameter is true.
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.apache.crimson.tree.XmlWritable
writeChildrenXml, writeXml
 

Method Detail

getInheritedAttribute

public String getInheritedAttribute(String name)
Returns the value of a given attribute, tracing up through ancestors if needed. In the XML standard, two attributes are inherited: xml:lang and xml:space. A very similar mechanism is involved with Cascading Style Sheets (CSS). XML Namespaces also use inheritance, using attributes with names like xmlns:foo to declare namespace prefixes.

Parameters:
name - The name of the attribute to be found. Colons in this are ignored.
Returns:
the value of the identified attribute, or null if no such attribute is found.

getLanguage

public String getLanguage()
Returns the language id (value of xml:lang attribute) applicable to this node, if known. Traces up through ancestors as needed.

Returns:
the value of the xml:lang attribute, or null if no such attribute is found.

getIndexOf

public int getIndexOf(org.w3c.dom.Node maybeChild)
Returns the index of the node in the list of children, such that item() will return that child.

Parameters:
maybeChild - the node which may be a child of this one
Returns:
the index of the node in the set of children, or else -1 if that node is not a child of this node.

setReadonly

public void setReadonly(boolean deep)
Sets the node to be readonly; applies recursively to the children of this node if the parameter is true.

Parameters:
deep - If true recursively set the nodes in the subtree under the current node to be read only. If false then set only the current node to be readonly

isReadonly

public boolean isReadonly()
Method to allow easy determination of whether a node is read only.

Returns:
true if the node is read only