This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.imageio.metadata
class IIOMetadataNode

java.lang.Object extended by javax.imageio.metadata.IIOMetadataNode
All Implemented Interfaces:
Element, NodeList

Most common way to construct:

String nativeMetadataFormatName = …;

IIOMetadataNode node = new IIOMetadataNode(nativeMetadataFormatName);

Based on 41 examples


public class IIOMetadataNode
extends Object
implements Element, NodeList

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.


Constructor Summary

          Constructs an empty IIOMetadataNode.

          Constructs an IIOMetadataNode with a given node name.
 
Method Summary
 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

          
 String

          
 Attr

          
 Attr
getAttributeNodeNS(String namespaceURI, String localName)

          Equivalent to getAttributeNode(localName).
 String
getAttributeNS(String namespaceURI, String localName)

          Equivalent to getAttribute(localName).
 NamedNodeMap

          
 String

          
 NodeList

          
 NodeList

          
 NodeList
getElementsByTagNameNS(String namespaceURI, String localName)

          Equivalent to getElementsByTagName(localName).
 Object
getFeature(String feature, String version)

          
 Node

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

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

          
 String

          Equivalent to getNodeName.
 String

          Returns null, since namespaces are not supported.
 Node

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

          Returns the node name associated with this node.
 short

          Returns the node type, which is always ELEMENT_NODE.
 String

          
 Document

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

          Returns the parent of this node.
 String

          Returns null, since namespaces are not supported.
 Node

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

          
 String

          
 String

          
 Object

          
 Object

          Returns the Object value associated with this node.
 boolean

          
 boolean
hasAttributeNS(String namespaceURI, String localName)

          Equivalent to hasAttribute(localName).
 boolean

          
 boolean

          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

          
 boolean

          
 boolean
isSupported(String feature, String version)

          Returns false since DOM features are not supported.
 Node
item(int index)

          
 String

          
 String
lookupPrefix(String namespaceURI)

          
 void

          Does nothing, since IIOMetadataNodes do not contain Text children.
 void

          
 Attr

          
 void
removeAttributeNS(String namespaceURI, String localName)

          Equivalent to removeAttribute(localName).
 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)

          
 Attr

          
 Attr

          Equivalent to setAttributeNode(newAttr).
 void
setAttributeNS(String namespaceURI, String qualifiedName, String value)

          Equivalent to setAttribute(qualifiedName, value).
 void
setIdAttribute(String name, boolean isId)

          
 void
setIdAttributeNode(Attr idAttr, boolean isId)

          
 void
setIdAttributeNS(String namespaceURI, String localName, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IIOMetadataNode

public IIOMetadataNode()
Constructs an empty IIOMetadataNode.


IIOMetadataNode

public IIOMetadataNode(String nodeName)
Constructs an IIOMetadataNode with a given node name.

Parameters:
nodeName - the name of the node, as a String.
Method Detail

appendChild

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.

cloneNode

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.

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException
Parameters:
other
Throws:
DOMException

getAttribute

public String getAttribute(String name)
Parameters:
name

getAttributeNode

public Attr getAttributeNode(String name)
Parameters:
name

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI,
                               String localName)
Equivalent to getAttributeNode(localName).

Parameters:
namespaceURI
localName

getAttributeNS

public String getAttributeNS(String namespaceURI,
                             String localName)
Equivalent to getAttribute(localName).

Parameters:
namespaceURI
localName

getAttributes

public NamedNodeMap getAttributes()

getBaseURI

public String getBaseURI()

getChildNodes

public NodeList getChildNodes()

getElementsByTagName

public NodeList getElementsByTagName(String name)
Parameters:
name

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)
Equivalent to getElementsByTagName(localName).

Parameters:
namespaceURI
localName

getFeature

public Object getFeature(String feature,
                         String version)
Parameters:
feature
version

getFirstChild

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

getLastChild

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.

getLength

public int getLength()

getLocalName

public String getLocalName()
Equivalent to getNodeName.

Returns:
the node name, as a String.

getNamespaceURI

public String getNamespaceURI()
                       throws DOMException
Returns null, since namespaces are not supported.

Throws:
DOMException

getNextSibling

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.

getNodeName

public String getNodeName()
Returns the node name associated with this node.

Returns:
the node name, as a String.

getNodeType

public short getNodeType()
Returns the node type, which is always ELEMENT_NODE.

Returns:
the short value ELEMENT_NODE.

getNodeValue

public String getNodeValue()
                    throws DOMException
Throws:
DOMException

getOwnerDocument

public Document getOwnerDocument()
Returns null, since IIOMetadataNodes do not belong to any Document.

Returns:
null.

getParentNode

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.

getPrefix

public String getPrefix()
Returns null, since namespaces are not supported.

Returns:
null.

getPreviousSibling

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.

getSchemaTypeInfo

public TypeInfo getSchemaTypeInfo()

getTagName

public String getTagName()

getTextContent

public String getTextContent()
                      throws DOMException
Throws:
DOMException

getUserData

public Object getUserData(String key)
Parameters:
key

getUserObject

public Object getUserObject()
Returns the Object value associated with this node.

Returns:
the user Object.

hasAttribute

public boolean hasAttribute(String name)
Parameters:
name

hasAttributeNS

public boolean hasAttributeNS(String namespaceURI,
                              String localName)
Equivalent to hasAttribute(localName).

Parameters:
namespaceURI
localName

hasAttributes

public boolean hasAttributes()

hasChildNodes

public boolean hasChildNodes()
Returns true if this node has child nodes.

Returns:
true if this node has children.

insertBefore

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.

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
Parameters:
namespaceURI

isEqualNode

public boolean isEqualNode(Node node)
Parameters:
node

isSameNode

public boolean isSameNode(Node node)
Parameters:
node

isSupported

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.

item

public Node item(int index)
Parameters:
index

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
Parameters:
prefix

lookupPrefix

public String lookupPrefix(String namespaceURI)
Parameters:
namespaceURI

normalize

public void normalize()
Does nothing, since IIOMetadataNodes do not contain Text children.


removeAttribute

public void removeAttribute(String name)
Parameters:
name

removeAttributeNode

public Attr removeAttributeNode(Attr oldAttr)
Parameters:
oldAttr

removeAttributeNS

public void removeAttributeNS(String namespaceURI,
                              String localName)
Equivalent to removeAttribute(localName).

Parameters:
namespaceURI
localName

removeChild

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.

replaceChild

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.

setAttribute

public void setAttribute(String name,
                         String value)
Parameters:
name
value

setAttributeNode

public Attr setAttributeNode(Attr newAttr)
                      throws DOMException
Parameters:
newAttr
Throws:
DOMException

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr newAttr)
Equivalent to setAttributeNode(newAttr).

Parameters:
newAttr

setAttributeNS

public void setAttributeNS(String namespaceURI,
                           String qualifiedName,
                           String value)
Equivalent to setAttribute(qualifiedName, value).

Parameters:
namespaceURI
qualifiedName
value

setIdAttribute

public void setIdAttribute(String name,
                           boolean isId)
                    throws DOMException
Parameters:
name
isId
Throws:
DOMException

setIdAttributeNode

public void setIdAttributeNode(Attr idAttr,
                               boolean isId)
                        throws DOMException
Parameters:
idAttr
isId
Throws:
DOMException

setIdAttributeNS

public void setIdAttributeNS(String namespaceURI,
                             String localName,
                             boolean isId)
                      throws DOMException
Parameters:
namespaceURI
localName
isId
Throws:
DOMException

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Parameters:
nodeValue
Throws:
DOMException

setPrefix

public void setPrefix(String prefix)
Does nothing, since namespaces are not supported.

Parameters:
prefix - a String, which is ignored.

setTextContent

public void setTextContent(String textContent)
                    throws DOMException
Parameters:
textContent
Throws:
DOMException

setUserData

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

setUserObject

public void setUserObject(Object userObject)
Sets the value associated with this node.

Parameters:
userObject - the user Object.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.