|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crimson.tree.NodeBase org.apache.crimson.tree.ParentNode org.apache.crimson.tree.NamespacedNode
This adds the notion of namespaces to the ParentNode class for certain types of nodes such as DOM Element and Attr nodes. See XML Namespaces REC for more info.
Nested Class Summary | |
(package private) class |
ParentNode.TagList
|
(package private) class |
ParentNode.TagListNS
|
Field Summary | |
protected String |
namespaceURI
|
(package private) XmlDocument |
ownerDocument
|
protected String |
qName
Field "qName" can be used to hold any XML REC "[5] Name" including a Namespaces REC "[6] QName". |
(package private) boolean |
readonly
|
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 |
Constructor Summary | |
(package private) |
NamespacedNode(String namespaceURI,
String qName)
|
Method Summary | |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
DOM: Appends the child to the set of this node's children. |
(package private) abstract void |
checkChildType(int type)
|
org.w3c.dom.NamedNodeMap |
getAttributes()
DOM: returns null. |
org.w3c.dom.NodeList |
getChildNodes()
DOM: Returns an object which permits "live" access to all this node's children. |
org.w3c.dom.NodeList |
getElementsByTagName(String tagname)
DOM: Returns a "live" list view of the elements below this one which have the specified tag name. |
org.w3c.dom.NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
|
org.w3c.dom.Node |
getFirstChild()
DOM: Returns the first child of this node, else null if there are no children. |
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. |
org.w3c.dom.Node |
getLastChild()
DOM: Returns the last child of this node, else null if there are no children. |
int |
getLength()
DOM: Returns the number of children |
String |
getLocalName()
Returns the local part of the qualified name of this node. |
(package private) String |
getMessage(String messageId)
|
(package private) String |
getMessage(String messageId,
Object[] parameters)
|
String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getNextSibling()
DOM: Returns the node immediately following this node in a breadth first traversal of the tree, or null if there is no such sibling. |
String |
getNodeName()
Returns the nodeName of this node |
String |
getNodeValue()
DOM: Returns null; overridden by subclasses as needed. |
org.w3c.dom.Document |
getOwnerDocument()
DOM: Returns the document to which this node belongs. |
(package private) ParentNode |
getParentImpl()
|
org.w3c.dom.Node |
getParentNode()
DOM: Returns the node's parent. |
String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getPreviousSibling()
DOM: Returns the node immediately preceding this node in a breadth first traversal of the tree, or null if there is no such sibling. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
DOM: Returns true if there are children to this node. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
DOM: Inserts the new child before the specified child, which if null indicates appending the new child to the current set of children. |
boolean |
isReadonly()
Method to allow easy determination of whether a node is read only. |
boolean |
isSupported(String feature,
String version)
DOM2: |
org.w3c.dom.Node |
item(int i)
DOM: Returns the Nth child, or null |
void |
normalize()
DOM2: noop. |
(package private) void |
reduceWaste()
|
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
DOM: removes child if present, returning argument. |
int |
removeWhiteSpaces(char[] buf)
|
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
DOM: Replaces the specified child with the new node, returning the original child or throwing an exception. |
void |
setNodeValue(String value)
DOM: does nothing; overridden by subclasses as needed. |
protected void |
setOwnerDocument(XmlDocument doc)
|
(package private) void |
setParentNode(ParentNode arg,
int index)
|
void |
setPrefix(String prefix)
Sets the namespace prefix of this node. |
void |
setReadonly(boolean deep)
Sets the node to be readonly; applies recursively to the children of this node if the parameter is true. |
void |
trimToSize()
Called to minimize space utilization. |
void |
writeChildrenXml(XmlWriteContext context)
Writes each of the child nodes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
cloneNode, getNodeType |
Methods inherited from interface org.apache.crimson.tree.XmlWritable |
writeXml |
Field Detail |
protected String qName
protected String namespaceURI
XmlDocument ownerDocument
boolean readonly
Constructor Detail |
NamespacedNode(String namespaceURI, String qName)
Method Detail |
public String getNamespaceURI()
null
if it is
unspecified. This is not a computed value.
getNamespaceURI
in interface org.w3c.dom.Node
getNamespaceURI
in class NodeBase
public String getPrefix()
null
if it is
unspecified.
getPrefix
in interface org.w3c.dom.Node
getPrefix
in class NodeBase
public void setPrefix(String prefix) throws org.w3c.dom.DOMException
setPrefix
in interface org.w3c.dom.Node
setPrefix
in class NodeBase
org.w3c.dom.DOMException
public String getLocalName()
getLocalName
in interface org.w3c.dom.Node
getLocalName
in class NodeBase
public String getNodeName()
public void trimToSize()
void reduceWaste()
public void writeChildrenXml(XmlWriteContext context) throws IOException
writeChildrenXml
in interface XmlWritable
writeChildrenXml
in class NodeBase
context
- describes how the children should be printed
IOException
abstract void checkChildType(int type) throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
public final boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
hasChildNodes
in class NodeBase
public final org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
getFirstChild
in class NodeBase
public final org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
getLastChild
in class NodeBase
public final int getLength()
getLength
in interface org.w3c.dom.NodeList
getLength
in class NodeBase
public final org.w3c.dom.Node item(int i)
item
in interface org.w3c.dom.NodeList
item
in class NodeBase
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
appendChild
in interface org.w3c.dom.Node
appendChild
in class NodeBase
newChild
- the new child to be appended
org.w3c.dom.DOMException
- thrown always.public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
insertBefore
in interface org.w3c.dom.Node
insertBefore
in class NodeBase
newChild
- the new child to be insertedrefChild
- node before which newChild is to be inserted
org.w3c.dom.DOMException
- thrown always.public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
replaceChild
in interface org.w3c.dom.Node
replaceChild
in class NodeBase
newChild
- the new child to be insertedrefChild
- node which is to be replaced
org.w3c.dom.DOMException
- thrown always.public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
removeChild
in interface org.w3c.dom.Node
removeChild
in class NodeBase
oldChild
- the node which is to be removed
org.w3c.dom.DOMException
- thrown always.public org.w3c.dom.NodeList getElementsByTagName(String tagname)
tagname
- the tag name to show; or "*" for all elements.
public org.w3c.dom.NodeList getElementsByTagNameNS(String namespaceURI, String localName)
public final int getIndexOf(org.w3c.dom.Node maybeChild)
getIndexOf
in interface NodeEx
getIndexOf
in class NodeBase
maybeChild
- the node which may be a child of this one
public void normalize()
NodeBase
normalize
in interface org.w3c.dom.Node
normalize
in class NodeBase
As a compatible extension to DOM, this normalizes treatment of whitespace except when the xml:space='preserve' attribute value applies to a node. All whitespace is normalized to one space. This ensures that text which is pretty-printed and then reread (and normalized) retains the same content.
public int removeWhiteSpaces(char[] buf)
ParentNode getParentImpl()
public boolean isReadonly()
NodeEx
isReadonly
in interface NodeEx
true
if the node is read onlypublic void setReadonly(boolean deep)
NodeEx
setReadonly
in interface NodeEx
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
readonlypublic String getLanguage()
xml:lang
attribute) applicable to this node, if known. Traces up
through ancestors as needed.
getLanguage
in interface NodeEx
public String getInheritedAttribute(String name)
getInheritedAttribute
in interface NodeEx
name
- identifies the attribute; colons may be included,
but namespace prefixes are not interpreted
public org.w3c.dom.Node getParentNode()
getParentNode
in interface org.w3c.dom.Node
void setParentNode(ParentNode arg, int index) throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
protected void setOwnerDocument(XmlDocument doc)
public org.w3c.dom.Document getOwnerDocument()
getOwnerDocument
in interface org.w3c.dom.Node
public void setNodeValue(String value)
setNodeValue
in interface org.w3c.dom.Node
public String getNodeValue()
getNodeValue
in interface org.w3c.dom.Node
public org.w3c.dom.NodeList getChildNodes()
In this implementation, nodes provide such access without needing another node as an intermediary; "this" is returned.
getChildNodes
in interface org.w3c.dom.Node
public org.w3c.dom.Node getNextSibling()
getNextSibling
in interface org.w3c.dom.Node
public org.w3c.dom.Node getPreviousSibling()
getPreviousSibling
in interface org.w3c.dom.Node
public org.w3c.dom.NamedNodeMap getAttributes()
getAttributes
in interface org.w3c.dom.Node
public boolean isSupported(String feature, String version)
isSupported
in interface org.w3c.dom.Node
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
String getMessage(String messageId)
String getMessage(String messageId, Object[] parameters)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |