public class

IIOMetadataNode

extends Object
implements Element NodeList
java.lang.Object
   ↳ javax.imageio.metadata.IIOMetadataNode

Class Overview

A class representing a node in a meta-data tree, which implements the org.w3c.dom.Element interface and additionally allows for the storage of non-textual objects via the getUserObject and setUserObject methods.

This class is not intended to be used for general XML processing. In particular, Element nodes created within the Image I/O API are not compatible with those created by Sun's standard implementation of the org.w3.dom API. In particular, the implementation is tuned for simple uses and may not perform well for intensive processing.

Namespaces are ignored in this implementation. The terms "tag name" and "node name" are always considered to be synonymous.

Summary

[Expand]
Inherited Constants
From interface org.w3c.dom.Node
Public Constructors
IIOMetadataNode()
Constructs an empty IIOMetadataNode.
IIOMetadataNode(String nodeName)
Constructs an IIOMetadataNode with a given node name.
Public Methods
Node appendChild(Node newChild)
Adds the node newChild to the end of the list of children of this node.
Node cloneNode(boolean deep)
Returns a duplicate of this node.
short compareDocumentPosition(Node other)
String getAttribute(String name)
String getAttributeNS(String namespaceURI, String localName)
Equivalent to getAttribute(localName).
Attr getAttributeNode(String name)
Attr getAttributeNodeNS(String namespaceURI, String localName)
Equivalent to getAttributeNode(localName).
NamedNodeMap getAttributes()
String getBaseURI()
NodeList getChildNodes()
NodeList getElementsByTagName(String name)
NodeList getElementsByTagNameNS(String namespaceURI, String localName)
Equivalent to getElementsByTagName(localName).
Object getFeature(String feature, String version)
Node getFirstChild()
Returns the first child of this node, or null if the node has no children.
Node getLastChild()
Returns the last child of this node, or null if the node has no children.
int getLength()
String getLocalName()
Equivalent to getNodeName.
String getNamespaceURI()
Returns null, since namespaces are not supported.
Node getNextSibling()
Returns the next sibling of this node, or null if the node has no next sibling.
String getNodeName()
Returns the node name associated with this node.
short getNodeType()
Returns the node type, which is always ELEMENT_NODE.
String getNodeValue()
Document getOwnerDocument()
Returns null, since IIOMetadataNodes do not belong to any Document.
Node getParentNode()
Returns the parent of this node.
String getPrefix()
Returns null, since namespaces are not supported.
Node getPreviousSibling()
Returns the previous sibling of this node, or null if this node has no previous sibling.
TypeInfo getSchemaTypeInfo()
String getTagName()
String getTextContent()
Object getUserData(String key)
Object getUserObject()
Returns the Object value associated with this node.
boolean hasAttribute(String name)
boolean hasAttributeNS(String namespaceURI, String localName)
Equivalent to hasAttribute(localName).
boolean hasAttributes()
boolean hasChildNodes()
Returns true if this node has child nodes.
Node insertBefore(Node newChild, Node refChild)
Inserts the node newChild before the existing child node refChild.
boolean isDefaultNamespace(String namespaceURI)
boolean isEqualNode(Node node)
boolean isSameNode(Node node)
boolean isSupported(String feature, String version)
Returns false since DOM features are not supported.
Node item(int index)
String lookupNamespaceURI(String prefix)
String lookupPrefix(String namespaceURI)
void normalize()
Does nothing, since IIOMetadataNodes do not contain Text children.
void removeAttribute(String name)
void removeAttributeNS(String namespaceURI, String localName)
Equivalent to removeAttribute(localName).
Attr removeAttributeNode(Attr oldAttr)
Node removeChild(Node oldChild)
Removes the child node indicated by oldChild from the list of children, and returns it.
Node replaceChild(Node newChild, Node oldChild)
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
void setAttribute(String name, String value)
void setAttributeNS(String namespaceURI, String qualifiedName, String value)
Equivalent to setAttribute(qualifiedName, value).
Attr setAttributeNode(Attr newAttr)
Attr setAttributeNodeNS(Attr newAttr)
Equivalent to setAttributeNode(newAttr).
void setIdAttribute(String name, boolean isId)
void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
void setIdAttributeNode(Attr idAttr, boolean isId)
void setNodeValue(String nodeValue)
void setPrefix(String prefix)
Does nothing, since namespaces are not supported.
void setTextContent(String textContent)
Object setUserData(String key, Object data, UserDataHandler handler)
void setUserObject(Object userObject)
Sets the value associated with this node.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.w3c.dom.Element
From interface org.w3c.dom.Node
From interface org.w3c.dom.NodeList

Public Constructors

public IIOMetadataNode ()

Constructs an empty IIOMetadataNode.

public IIOMetadataNode (String nodeName)

Constructs an IIOMetadataNode with a given node name.

Parameters
nodeName the name of the node, as a String.

Public Methods

public Node appendChild (Node newChild)

Adds the node newChild to the end of the list of children of this node.

Parameters
newChild the Node to insert.
Returns
  • the node added.
Throws
IllegalArgumentException if newChild is null.

public Node cloneNode (boolean deep)

Returns a duplicate of this node. The duplicate node has no parent (getParentNode returns null). If a shallow clone is being performed (deep is false), the new node will not have any children or siblings. If a deep clone is being performed, the new node will form the root of a complete cloned subtree.

Parameters
deep if true, recursively clone the subtree under the specified node; if false, clone only the node itself.
Returns
  • the duplicate node.

public short compareDocumentPosition (Node other)

Throws
DOMException

public String getAttribute (String name)

public String getAttributeNS (String namespaceURI, String localName)

Equivalent to getAttribute(localName).

public Attr getAttributeNode (String name)

public Attr getAttributeNodeNS (String namespaceURI, String localName)

Equivalent to getAttributeNode(localName).

public NamedNodeMap getAttributes ()

public String getBaseURI ()

public NodeList getChildNodes ()

public NodeList getElementsByTagName (String name)

public NodeList getElementsByTagNameNS (String namespaceURI, String localName)

Equivalent to getElementsByTagName(localName).

public Object getFeature (String feature, String version)

public Node getFirstChild ()

Returns the first child of this node, or null if the node has no children.

Returns
  • the first child, as a Node, or null

public Node getLastChild ()

Returns the last child of this node, or null if the node has no children.

Returns
  • the last child, as a Node, or null.

public int getLength ()

public String getLocalName ()

Equivalent to getNodeName.

Returns
  • the node name, as a String.

public String getNamespaceURI ()

Returns null, since namespaces are not supported.

Throws
DOMException

public Node getNextSibling ()

Returns the next sibling of this node, or null if the node has no next sibling.

Returns
  • the next sibling, as a Node, or null.

public String getNodeName ()

Returns the node name associated with this node.

Returns
  • the node name, as a String.

public short getNodeType ()

Returns the node type, which is always ELEMENT_NODE.

Returns
  • the short value ELEMENT_NODE.

public String getNodeValue ()

Throws
DOMException

public Document getOwnerDocument ()

Returns null, since IIOMetadataNodes do not belong to any Document.

Returns
  • null.

public Node getParentNode ()

Returns the parent of this node. A null value indicates that the node is the root of its own tree. To add a node to an existing tree, use one of the insertBefore, replaceChild, or appendChild methods.

Returns
  • the parent, as a Node.

public String getPrefix ()

Returns null, since namespaces are not supported.

Returns
  • null.

public Node getPreviousSibling ()

Returns the previous sibling of this node, or null if this node has no previous sibling.

Returns
  • the previous sibling, as a Node, or null.

public TypeInfo getSchemaTypeInfo ()

public String getTagName ()

public String getTextContent ()

Throws
DOMException

public Object getUserData (String key)

public Object getUserObject ()

Returns the Object value associated with this node.

Returns
  • the user Object.

public boolean hasAttribute (String name)

public boolean hasAttributeNS (String namespaceURI, String localName)

Equivalent to hasAttribute(localName).

public boolean hasAttributes ()

public boolean hasChildNodes ()

Returns true if this node has child nodes.

Returns
  • true if this node has children.

public Node insertBefore (Node newChild, Node refChild)

Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children.

Parameters
newChild the Node to insert.
refChild the reference Node.
Returns
  • the node being inserted.
Throws
IllegalArgumentException if newChild is null.

public boolean isDefaultNamespace (String namespaceURI)

public boolean isEqualNode (Node node)

public boolean isSameNode (Node node)

public boolean isSupported (String feature, String version)

Returns false since DOM features are not supported.

Parameters
feature a String, which is ignored.
version a String, which is ignored.
Returns
  • false.

public Node item (int index)

public String lookupNamespaceURI (String prefix)

public String lookupPrefix (String namespaceURI)

public void normalize ()

Does nothing, since IIOMetadataNodes do not contain Text children.

public void removeAttribute (String name)

public void removeAttributeNS (String namespaceURI, String localName)

Equivalent to removeAttribute(localName).

public Attr removeAttributeNode (Attr oldAttr)

public Node removeChild (Node oldChild)

Removes the child node indicated by oldChild from the list of children, and returns it.

Parameters
oldChild the Node to be removed.
Returns
  • the node removed.
Throws
IllegalArgumentException if oldChild is null.

public Node replaceChild (Node newChild, Node oldChild)

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.

Parameters
newChild the Node to insert.
oldChild the Node to be replaced.
Returns
  • the node replaced.
Throws
IllegalArgumentException if newChild is null.

public void setAttribute (String name, String value)

public void setAttributeNS (String namespaceURI, String qualifiedName, String value)

Equivalent to setAttribute(qualifiedName, value).

public Attr setAttributeNode (Attr newAttr)

Throws
DOMException

public Attr setAttributeNodeNS (Attr newAttr)

Equivalent to setAttributeNode(newAttr).

public void setIdAttribute (String name, boolean isId)

Throws
DOMException

public void setIdAttributeNS (String namespaceURI, String localName, boolean isId)

Throws
DOMException

public void setIdAttributeNode (Attr idAttr, boolean isId)

Throws
DOMException

public void setNodeValue (String nodeValue)

Throws
DOMException

public void setPrefix (String prefix)

Does nothing, since namespaces are not supported.

Parameters
prefix a String, which is ignored.
See Also

public void setTextContent (String textContent)

Throws
DOMException

public Object setUserData (String key, Object data, UserDataHandler handler)

public void setUserObject (Object userObject)

Sets the value associated with this node.

Parameters
userObject the user Object.
See Also