Methods Summary |
---|
public org.w3c.dom.Node | appendChild(org.w3c.dom.Node newChild)
return insertBefore(newChild, null);
|
public org.w3c.dom.Node | cloneNode(boolean deep)
IIOMetadataNode cloned = new IIOMetadataNode(nodeName);
cloned.setUserObject(getUserObject());
if (deep) { // Clone recursively
IIOMetadataNode c = firstChild;
while (c != null) {
cloned.insertBefore(c.cloneNode(true), null);
c = c.nextSibling;
}
}
return cloned; // To change body of implemented methods use File |
// Settings | File Templates.
|
public short | compareDocumentPosition(org.w3c.dom.Node other)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
Compares the reference node, i.e. the node on which this method is being
called, with a node, i.e. the one passed as a parameter, with regard to
their position in the document and according to the document order.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public java.lang.String | getAttribute(java.lang.String name)
Attr attrNode = (Attr)attrs.getNamedItem(name);
return (attrNode == null) ? "" : attrNode.getValue();
|
public java.lang.String | getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
return getAttribute(localName);
|
public org.w3c.dom.Attr | getAttributeNode(java.lang.String name)
return (Attr)attrs.getNamedItem(name);
|
public org.w3c.dom.Attr | getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
return getAttributeNode(localName);
|
public org.w3c.dom.NamedNodeMap | getAttributes()
return attrs;
|
public java.lang.String | getBaseURI()Description copied from interface: org.w3c.dom.Node (DOM Level 3)
The absolute base URI of this node or null if the implementation wasn't
able to obtain an absolute URI. This value is computed as described in.
However, when the Document supports the feature "HTML" [DOM Level 2
HTML], the base URI is computed using first the value of the href
attribute of the HTML BASE element if any, and the value of the
documentURI attribute from the Document interface otherwise.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public org.w3c.dom.NodeList | getChildNodes()
return this;
|
public org.w3c.dom.NodeList | getElementsByTagName(java.lang.String name)
ArrayList<IIOMetadataNode> nodes = new ArrayList<IIOMetadataNode>();
// Non-recursive tree walk
Node pos = this;
while (pos != null) {
if (pos.getNodeName().equals(name)) {
nodes.add((IIOMetadataNode)pos);
}
Node nextNode = pos.getFirstChild();
while (nextNode == null) {
if (pos == this) {
break;
}
nextNode = pos.getNextSibling();
if (nextNode == null) {
pos = pos.getParentNode();
if (pos == null || pos == this) {
nextNode = null;
break;
}
}
}
pos = nextNode;
}
return new IIOMetadataNodeList(nodes);
|
public org.w3c.dom.NodeList | getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
return getElementsByTagName(localName);
|
public java.lang.Object | getFeature(java.lang.String feature, java.lang.String version)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
This method returns a specialized object which implements the specialized
APIs of the specified feature and version, as specified in. The
specialized object may also be obtained by using binding-specific casting
methods but is not necessarily expected to, as discussed in. This method
also allow the implementation to provide specialized objects which do not
support the Node interface.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public org.w3c.dom.Node | getFirstChild()
return firstChild;
|
public org.w3c.dom.Node | getLastChild()
return lastChild;
|
public int | getLength()
return nChildren;
|
public java.lang.String | getLocalName()
return nodeName;
|
public java.lang.String | getNamespaceURI()
return null;
|
public org.w3c.dom.Node | getNextSibling()
return nextSibling;
|
public java.lang.String | getNodeName()
return nodeName;
|
public short | getNodeType()
return ELEMENT_NODE;
|
public java.lang.String | getNodeValue()
return nodeValue;
|
public org.w3c.dom.Document | getOwnerDocument()
return null;
|
public org.w3c.dom.Node | getParentNode()
return parent;
|
public java.lang.String | getPrefix()
return null;
|
public org.w3c.dom.Node | getPreviousSibling()
return previousSibling;
|
public java.lang.String | getTagName()
return nodeName;
|
public java.lang.String | getTextContent()Description copied from interface: org.w3c.dom.Node (DOM Level 3)
This attribute returns the text content of this node and its descendants.
When it is defined to be null, setting it has no effect. On setting, any
possible children this node may have are removed and, if it the new
string is not empty or null, replaced by a single Text node containing
the string this attribute is set to. On getting, no serialization is
performed, the returned string does not contain any markup. No whitespace
normalization is performed and the returned string does not contain the
white spaces in element content (see the attribute
Text.isElementContentWhitespace). Similarly, on setting, no parsing is
performed either, the input string is taken as pure textual content. The
string returned is made of the text content of this node depending on its
type, as defined below:
Node type |
Content |
ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
DOCUMENT_FRAGMENT_NODE |
concatenation of the textContent attribute value of every child node,
excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes. This is the
empty string if the node has no children. |
TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
PROCESSING_INSTRUCTION_NODE |
nodeValue |
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE |
null |
return textContent;
|
public java.lang.Object | getUserData(java.lang.String key)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
Retrieves the object associated to a key on a this node. The object must
first have been set to this node by calling setUserData with the same
key.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public java.lang.Object | getUserObject()Gets the user object associated with this node.
return userObject;
|
public boolean | hasAttribute(java.lang.String name)
return attrs.getNamedItem(name) != null;
|
public boolean | hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
return hasAttribute(localName);
|
public boolean | hasAttributes()
return attrs.list.size() > 0;
|
public boolean | hasChildNodes()
return nChildren != 0;
|
public org.w3c.dom.Node | insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
if (newChild == null) {
throw new IllegalArgumentException("newChild == null!");
}
IIOMetadataNode newIIOChild = (IIOMetadataNode)newChild;
IIOMetadataNode refIIOChild = (IIOMetadataNode)refChild;
newIIOChild.parent = this;
if (refIIOChild == null) {
newIIOChild.nextSibling = null;
newIIOChild.previousSibling = lastChild;
// Fix this node
lastChild = newIIOChild;
if (firstChild == null) {
firstChild = newIIOChild;
}
} else {
newIIOChild.nextSibling = refIIOChild;
newIIOChild.previousSibling = refIIOChild.previousSibling;
// Fix this node
if (firstChild == refIIOChild) {
firstChild = newIIOChild;
}
// Fix next node
if (refIIOChild != null) {
refIIOChild.previousSibling = newIIOChild;
}
}
// Fix prev node
if (newIIOChild.previousSibling != null) {
newIIOChild.previousSibling.nextSibling = newIIOChild;
}
nChildren++;
return newIIOChild;
|
public boolean | isDefaultNamespace(java.lang.String namespaceURI)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
This method checks if the specified namespaceURI is the default namespace
or not.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public boolean | isEqualNode(org.w3c.dom.Node arg)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
Tests whether two nodes are equal. This method tests for equality of
nodes, not sameness (i.e., whether the two nodes are references to the
same object) which can be tested with Node.isSameNode(). All nodes that
are the same will also be equal, though the reverse may not be true. Two
nodes are equal if and only if the following conditions are satisfied:
The two nodes are of the same type.
The following string attributes are equal: nodeName, localName,
namespaceURI, prefix, nodeValue . This is: they are both null, or they
have the same length and are character for character identical.
The attributes NamedNodeMaps are equal. This is: they are both null,
or they have the same length and for each node that exists in one map
there is a node that exists in the other map and is equal, although not
necessarily at the same index.
The childNodes NodeLists are equal. This is: they are both null, or
they have the same length and contain equal nodes at the same index. Note
that normalization can affect equality; to avoid this, nodes should be
normalized before being compared.
For two DocumentType nodes to be equal, the following conditions must
also be satisfied:
The following string attributes are equal: publicId, systemId,
internalSubset.
The entities NamedNodeMaps are equal.
The notations NamedNodeMaps are equal.
On the other hand, the following do not affect equality: the
ownerDocument, baseURI, and parentNode attributes, the specified
attribute for Attr nodes, the schemaTypeInfo attribute for Attr and
Element nodes, the Text.isElementContentWhitespace attribute for Text
nodes, as well as any user data or event listeners registered on the
nodes.
Note: As a general rule, anything not mentioned in the description above
is not significant in consideration of equality checking. Note that
future versions of this specification may take into account more
attributes and implementations conform to this specification are expected
to be updated accordingly.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public boolean | isSameNode(org.w3c.dom.Node other)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
Returns whether this node is the same node as the given one. This method
provides a way to determine whether two Node references returned by the
implementation reference the same object. When two Node references are
references to the same object, even if through a proxy, the references
may be used completely interchangeably, such that all attributes have the
same values and calling the same DOM method on either reference always
has exactly the same effect.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public boolean | isSupported(java.lang.String feature, java.lang.String version)
return false;
|
public org.w3c.dom.Node | item(int index)
if (index < 0 || index >= nChildren) {
return null;
}
Node n;
for (n = getFirstChild(); index > 0; index--) {
n = n.getNextSibling();
}
return n;
|
public java.lang.String | lookupNamespaceURI(java.lang.String prefix)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
Look up the namespace URI associated to the given prefix, starting from
this node. See for details on the algorithm used by this method.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public java.lang.String | lookupPrefix(java.lang.String namespaceURI)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
Look up the prefix associated to the given namespace URI, starting from
this node. The default namespace declarations are ignored by this method.
See for details on the algorithm used by this method.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public void | normalize()
// Do nothing
|
public void | removeAttribute(java.lang.String name)
IIOMetadataAttr attr = (IIOMetadataAttr)attrs.getNamedItem(name);
if (attr != null) {
attr.setOwnerElement(null);
attrs.list.remove(attr);
}
|
public void | removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
removeAttribute(localName);
|
public org.w3c.dom.Attr | removeAttributeNode(org.w3c.dom.Attr oldAttr)
if (!attrs.list.remove(oldAttr)) { // Not found
throw new DOMException(DOMException.NOT_FOUND_ERR, "No such attribute!");
}
((IIOMetadataAttr)oldAttr).setOwnerElement(null);
return oldAttr;
|
public org.w3c.dom.Node | removeChild(org.w3c.dom.Node oldChild)
if (oldChild == null) {
throw new IllegalArgumentException("oldChild == null!");
}
IIOMetadataNode oldIIOChild = (IIOMetadataNode)oldChild;
// Fix next and previous
IIOMetadataNode previous = oldIIOChild.previousSibling;
IIOMetadataNode next = oldIIOChild.nextSibling;
if (previous != null) {
previous.nextSibling = next;
}
if (next != null) {
next.previousSibling = previous;
}
// Fix this node
if (lastChild == oldIIOChild) {
lastChild = previous;
}
if (firstChild == oldIIOChild) {
firstChild = next;
}
nChildren--;
// Fix old child
oldIIOChild.parent = null;
oldIIOChild.previousSibling = null;
oldIIOChild.nextSibling = null;
return oldIIOChild;
|
public org.w3c.dom.Node | replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
if (newChild == null) {
throw new IllegalArgumentException("newChild == null!");
}
IIOMetadataNode newIIOChild = (IIOMetadataNode)newChild;
IIOMetadataNode oldIIOChild = (IIOMetadataNode)oldChild;
IIOMetadataNode next = oldIIOChild.nextSibling;
IIOMetadataNode previous = oldIIOChild.previousSibling;
// Fix new node
newIIOChild.parent = this;
newIIOChild.nextSibling = next;
newIIOChild.previousSibling = previous;
// Fix this node
if (lastChild == oldIIOChild) {
lastChild = newIIOChild;
}
if (firstChild == oldIIOChild) {
firstChild = newIIOChild;
}
// Fix siblings
if (next != null) {
next.previousSibling = newIIOChild;
}
if (previous != null) {
previous.nextSibling = newIIOChild;
}
// Fix old child
oldIIOChild.parent = null;
oldIIOChild.nextSibling = next;
oldIIOChild.previousSibling = previous;
return oldIIOChild;
|
public void | setAttribute(java.lang.String name, java.lang.String value)
Attr attr = (Attr)attrs.getNamedItem(name);
if (attr != null) {
attr.setValue(value);
} else {
attrs.list.add(new IIOMetadataAttr(name, value, this));
}
|
public void | setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)
setAttribute(qualifiedName, value);
|
public org.w3c.dom.Attr | setAttributeNode(org.w3c.dom.Attr newAttr)
// Check if this attribute is already in use.
Element owner = newAttr.getOwnerElement();
if (owner != null) {
if (owner == this) { // Replacing an attribute node by itself has no
// effect
return null;
} else {
throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
"Attribute is already in use");
}
}
String name = newAttr.getName();
Attr oldAttr = getAttributeNode(name);
if (oldAttr != null) {
removeAttributeNode(oldAttr);
}
IIOMetadataAttr iioAttr;
if (newAttr instanceof IIOMetadataAttr) {
iioAttr = (IIOMetadataAttr)newAttr;
iioAttr.setOwnerElement(this);
} else {
iioAttr = new IIOMetadataAttr(name, newAttr.getValue(), this);
}
attrs.list.add(iioAttr);
return oldAttr;
|
public org.w3c.dom.Attr | setAttributeNodeNS(org.w3c.dom.Attr newAttr)
return setAttributeNode(newAttr);
|
public void | setIdAttribute(java.lang.String name, boolean isId)Description copied from interface: org.w3c.dom.Element (DOM Level
3)
If the parameter isId is true, this method declares the specified
attribute to be a user-determined ID attribute . This affects the value
of Attr.isId and the behavior of Document.getElementById, but does not
change any schema that may be in use, in particular this does not affect
the Attr.schemaTypeInfo of the specified Attr node. Use the value false
for the parameter isId to undeclare an attribute for being a
user-determined ID attribute. To specify an attribute by local name and
namespace URI, use the setIdAttributeNS method.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public void | setIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId)Description copied from interface: org.w3c.dom.Element (DOM Level
3)
If the parameter isId is true, this method declares the specified
attribute to be a user-determined ID attribute . This affects the value
of Attr.isId and the behavior of Document.getElementById, but does not
change any schema that may be in use, in particular this does not affect
the Attr.schemaTypeInfo of the specified Attr node. Use the value false
for the parameter isId to undeclare an attribute for being a
user-determined ID attribute.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public void | setIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId)Description copied from interface: org.w3c.dom.Element (DOM Level
3)
If the parameter isId is true, this method declares the specified
attribute to be a user-determined ID attribute . This affects the value
of Attr.isId and the behavior of Document.getElementById, but does not
change any schema that may be in use, in particular this does not affect
the Attr.schemaTypeInfo of the specified Attr node. Use the value false
for the parameter isId to undeclare an attribute for being a
user-determined ID attribute.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
|
public void | setNodeValue(java.lang.String nodeValue)
this.nodeValue = nodeValue;
|
public void | setPrefix(java.lang.String prefix)
// Do nothing
|
public void | setTextContent(java.lang.String textContent)Description copied from interface: org.w3c.dom.Node (DOM Level 3)
This attribute returns the text content of this node and its descendants.
When it is defined to be null, setting it has no effect. On setting, any
possible children this node may have are removed and, if it the new
string is not empty or null, replaced by a single Text node containing
the string this attribute is set to. On getting, no serialization is
performed, the returned string does not contain any markup. No whitespace
normalization is performed and the returned string does not contain the
white spaces in element content (see the attribute
Text.isElementContentWhitespace). Similarly, on setting, no parsing is
performed either, the input string is taken as pure textual content. The
string returned is made of the text content of this node depending on its
type, as defined below:
Node type |
Content |
ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
DOCUMENT_FRAGMENT_NODE |
concatenation of the textContent attribute value of every child node,
excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes. This is the
empty string if the node has no children. |
TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
PROCESSING_INSTRUCTION_NODE |
nodeValue |
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE |
null |
this.textContent = textContent;
|
public void | setUserObject(java.lang.Object userObject)Sets the user object associated with this node.
this.userObject = userObject;
|