| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 .
|
|
IIOMetadataNode(String nodeName) 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 |
compareDocumentPosition(Node other) |
String |
getAttribute(String name) |
Attr |
getAttributeNode(String name) |
Attr |
getAttributeNodeNS(String namespaceURI, String localName) Equivalent to getAttributeNode(localName) .
|
String |
getAttributeNS(String namespaceURI, String localName) Equivalent to getAttribute(localName) .
|
NamedNodeMap |
|
String |
|
NodeList |
|
NodeList |
getElementsByTagName(String name) |
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 IIOMetadataNode s
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 |
getUserData(String key) |
Object |
Returns the Object value associated with this node.
|
boolean |
hasAttribute(String name) |
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 |
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 |
Does nothing, since IIOMetadataNode s do not
contain Text children.
|
void |
removeAttribute(String name) |
Attr |
removeAttributeNode(Attr oldAttr) |
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 |
setAttributeNode(Attr newAttr) |
Attr |
setAttributeNodeNS(Attr newAttr) 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 |
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 |
---|
public IIOMetadataNode()
IIOMetadataNode
.
public IIOMetadataNode(String nodeName)
IIOMetadataNode
with a given node
name.
nodeName
- the name of the node, as a String
.Method Detail |
---|
public Node appendChild(Node newChild)
newChild
to the end of the list of
children of this node.
newChild
- the Node
to insert.public Node cloneNode(boolean deep)
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.
deep
- if true
, recursively clone the subtree
under the specified node; if false
, clone only the
node itself.public short compareDocumentPosition(Node other) throws DOMException
other
DOMException
public String getAttribute(String name)
name
public Attr getAttributeNode(String name)
name
public Attr getAttributeNodeNS(String namespaceURI, String localName)
getAttributeNode(localName)
.
namespaceURI
localName
public String getAttributeNS(String namespaceURI, String localName)
getAttribute(localName)
.
namespaceURI
localName
public NamedNodeMap getAttributes()
public String getBaseURI()
public NodeList getChildNodes()
public NodeList getElementsByTagName(String name)
name
public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagName(localName)
.
namespaceURI
localName
public Object getFeature(String feature, String version)
feature
version
public Node getFirstChild()
null
if
the node has no children.
Node
, or
null
public Node getLastChild()
null
if
the node has no children.
Node
, or
null
.public int getLength()
public String getLocalName()
getNodeName
.
String
.public String getNamespaceURI() throws DOMException
null
, since namespaces are not supported.
DOMException
public Node getNextSibling()
null
if
the node has no next sibling.
Node
, or
null
.public String getNodeName()
String
.public short getNodeType()
ELEMENT_NODE
.
short
value ELEMENT_NODE
.public String getNodeValue() throws DOMException
DOMException
public Document getOwnerDocument()
null
, since IIOMetadataNode
s
do not belong to any Document
.
null
.public Node getParentNode()
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.
Node
.public String getPrefix()
null
, since namespaces are not supported.
null
.public Node getPreviousSibling()
null
if this node has no previous sibling.
Node
, or
null
.public TypeInfo getSchemaTypeInfo()
public String getTagName()
public String getTextContent() throws DOMException
DOMException
public Object getUserData(String key)
key
public Object getUserObject()
Object
value associated with this node.
Object
.public boolean hasAttribute(String name)
name
public boolean hasAttributeNS(String namespaceURI, String localName)
hasAttribute(localName)
.
namespaceURI
localName
public boolean hasAttributes()
public boolean hasChildNodes()
true
if this node has child nodes.
true
if this node has children.public Node insertBefore(Node newChild, Node refChild)
newChild
before the existing
child node refChild
. If refChild
is
null
, insert newChild
at the end of
the list of children.
newChild
- the Node
to insert.refChild
- the reference Node
.public boolean isDefaultNamespace(String namespaceURI)
namespaceURI
public boolean isEqualNode(Node node)
node
public boolean isSameNode(Node node)
node
public boolean isSupported(String feature, String version)
false
since DOM features are not
supported.
feature
- a String
, which is ignored.version
- a String
, which is ignored.false
.public Node item(int index)
index
public String lookupNamespaceURI(String prefix)
prefix
public String lookupPrefix(String namespaceURI)
namespaceURI
public void normalize()
IIOMetadataNode
s do not
contain Text
children.
public void removeAttribute(String name)
name
public Attr removeAttributeNode(Attr oldAttr)
oldAttr
public void removeAttributeNS(String namespaceURI, String localName)
removeAttribute(localName)
.
namespaceURI
localName
public Node removeChild(Node oldChild)
oldChild
from
the list of children, and returns it.
oldChild
- the Node
to be removed.public Node replaceChild(Node newChild, Node oldChild)
oldChild
with
newChild
in the list of children, and returns the
oldChild
node.
newChild
- the Node
to insert.oldChild
- the Node
to be replaced.public void setAttribute(String name, String value)
name
value
public Attr setAttributeNode(Attr newAttr) throws DOMException
newAttr
DOMException
public Attr setAttributeNodeNS(Attr newAttr)
setAttributeNode(newAttr)
.
newAttr
public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
setAttribute(qualifiedName, value)
.
namespaceURI
qualifiedName
value
public void setIdAttribute(String name, boolean isId) throws DOMException
name
isId
DOMException
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
idAttr
isId
DOMException
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
namespaceURI
localName
isId
DOMException
public void setNodeValue(String nodeValue) throws DOMException
nodeValue
DOMException
public void setPrefix(String prefix)
prefix
- a String
, which is ignored.public void setTextContent(String textContent) throws DOMException
textContent
DOMException
public Object setUserData(String key, Object data, UserDataHandler handler)
key
data
handler
public void setUserObject(Object userObject)
userObject
- the user Object
.
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |