public class IIOMetadataNode extends Object implements Element, NodeList
org.w3c.dom.Element
接口并允许对非文本对象的存储通过
getUserObject
和
setUserObject
方法。
这个类不用于一般的XML处理。特别是,Element
节点创建的图像内的I/O API不兼容的org.w3.dom
太阳的标准实施创建API。特别是,实施调整,简单的使用,并可能不执行以及密集的处理。
命名空间是在这个实现忽略。术语“标签名称”和“节点名称”通常被认为是同义词。注:DOM级别3规范的Node
添加了一些新的方法,Element
和Attr
接口,是没有价值的IIOMetadataNode
实施规范。调用这样的方法在IIOMetadataNode
,或Attr
实例返回一个IIOMetadataNode
将导致DOMException
抛出。
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
IIOMetadataNode()
构造一个空
IIOMetadataNode 。
|
IIOMetadataNode(String nodeName)
构建一个给定的节点名称的
IIOMetadataNode 。
|
Modifier and Type | Method and Description |
---|---|
Node |
appendChild(Node newChild)
将节点添加
newChild 对这个子节点列表的末尾。
|
Node |
cloneNode(boolean deep)
返回此节点的副本。
|
short |
compareDocumentPosition(Node other)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
String |
getAttribute(String name)
通过名称检索属性值。
|
Attr |
getAttributeNode(String name)
通过名称检索属性节点。
|
Attr |
getAttributeNodeNS(String namespaceURI, String localName)
相当于
getAttributeNode(localName) 。
|
String |
getAttributeNS(String namespaceURI, String localName)
相当于
getAttribute(localName) 。
|
NamedNodeMap |
getAttributes()
返回一个包含该节点的属性
NamedNodeMap 。
|
String |
getBaseURI()
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
NodeList |
getChildNodes()
返回一个
NodeList 包含的所有子节点。
|
NodeList |
getElementsByTagName(String name)
返回一个
NodeList 所有后裔
Elements 与给定的标签名称,在文档顺序。
|
NodeList |
getElementsByTagNameNS(String namespaceURI, String localName)
相当于
getElementsByTagName(localName) 。
|
Object |
getFeature(String feature, String version)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
Node |
getFirstChild()
返回该节点的第一个孩子,或
null 如果节点没有孩子。
|
Node |
getLastChild()
返回此节点的最后一个子节点,或
null 如果节点没有孩子。
|
int |
getLength()
列表中的节点的数目。
|
String |
getLocalName()
相当于
getNodeName 。
|
String |
getNamespaceURI()
返回
null ,因为不支持命名空间。
|
Node |
getNextSibling()
返回该节点的下一个兄弟,或
null 如果没有下一个同级节点。
|
String |
getNodeName()
返回与此节点关联的节点名称。
|
short |
getNodeType()
返回的节点类型,它总是
ELEMENT_NODE 。
|
String |
getNodeValue()
返回与此节点关联的值。
|
Document |
getOwnerDocument()
返回
null ,因为
IIOMetadataNode s不属于任何
Document 。
|
Node |
getParentNode()
返回此节点的父节点。
|
String |
getPrefix()
返回
null ,因为不支持命名空间。
|
Node |
getPreviousSibling()
返回此节点上的兄弟姐妹,或
null 如果这个节点没有兄弟。
|
TypeInfo |
getSchemaTypeInfo()
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
String |
getTagName()
相当于
getNodeName 。
|
String |
getTextContent()
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
Object |
getUserData(String key)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
Object |
getUserObject()
返回与此节点关联的
Object 价值。
|
boolean |
hasAttribute(String name)
true 时返回具有给定名称的属性指定这个元素或具有默认值,否则
false 。
|
boolean |
hasAttributeNS(String namespaceURI, String localName)
相当于
hasAttribute(localName) 。
|
boolean |
hasAttributes()
返回这个节点(如果它是一个元素)是否有任何属性。
|
boolean |
hasChildNodes()
返回
true 如果该节点的子节点。
|
Node |
insertBefore(Node newChild, Node refChild)
插入节点
newChild 之前已有的子节点
refChild 。
|
boolean |
isDefaultNamespace(String namespaceURI)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
boolean |
isEqualNode(Node node)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
boolean |
isSameNode(Node node)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
boolean |
isSupported(String feature, String version)
返回
false 由于不支持DOM的功能。
|
Node |
item(int index)
返回
index th项集合中的。
|
String |
lookupNamespaceURI(String prefix)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
String |
lookupPrefix(String namespaceURI)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
void |
normalize()
什么都不做,因为
IIOMetadataNode s不包含
Text 儿童。
|
void |
removeAttribute(String name)
按名称删除属性。
|
Attr |
removeAttributeNode(Attr oldAttr)
移除指定的属性节点。
|
void |
removeAttributeNS(String namespaceURI, String localName)
相当于
removeAttribute(localName) 。
|
Node |
removeChild(Node oldChild)
删除子节点表示的
oldChild 从孩子的名单,并返回它。
|
Node |
replaceChild(Node newChild, Node oldChild)
在名单上的孩子
newChild 代替子节点
oldChild ,并返回
oldChild 节点。
|
void |
setAttribute(String name, String value)
添加一个新属性。
|
Attr |
setAttributeNode(Attr newAttr)
添加一个新的属性节点。
|
Attr |
setAttributeNodeNS(Attr newAttr)
相当于
setAttributeNode(newAttr) 。
|
void |
setAttributeNS(String namespaceURI, String qualifiedName, String value)
相当于
setAttribute(qualifiedName, value) 。
|
void |
setIdAttribute(String name, boolean isId)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
void |
setIdAttributeNode(Attr idAttr, boolean isId)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
void |
setIdAttributeNS(String namespaceURI, String localName, boolean isId)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
void |
setNodeValue(String nodeValue)
设置与此节点关联的
String 价值。
|
void |
setPrefix(String prefix)
什么都不做,因为不支持命名空间。
|
void |
setTextContent(String textContent)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
Object |
setUserData(String key, Object data, UserDataHandler handler)
这3级DOM方法不支持
IIOMetadataNode 和将
DOMException 。
|
void |
setUserObject(Object userObject)
设置与此节点关联的值。
|
public IIOMetadataNode()
IIOMetadataNode
。
public IIOMetadataNode(String nodeName)
IIOMetadataNode
。
nodeName
-节点的名称,作为一个
String
。
public String getNodeName()
getNodeName
接口
Node
String
。
public String getNodeValue()
getNodeValue
接口
Node
String
。
public void setNodeValue(String nodeValue)
String
价值。
setNodeValue
接口
Node
public short getNodeType()
ELEMENT_NODE
。
getNodeType
接口
Node
short
价值
ELEMENT_NODE
。
public Node getParentNode()
null
值表示节点的树的根。对现有的树添加一个节点,使用其中的
insertBefore
,
replaceChild
,或
appendChild
方法。
getParentNode
接口
Node
Node
。
insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
,
replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
,
appendChild(org.w3c.dom.Node)
public NodeList getChildNodes()
NodeList
包含的所有子节点。如果没有孩子,这是一个
NodeList
包含任何节点。
getChildNodes
接口
Node
NodeList
public Node getFirstChild()
null
如果节点没有孩子。
getFirstChild
接口
Node
Node
,或
null
public Node getLastChild()
null
如果节点没有孩子。
getLastChild
接口
Node
Node
,或
null
。
public Node getPreviousSibling()
null
如果这个节点没有兄弟。
getPreviousSibling
接口
Node
Node
,或
null
。
public Node getNextSibling()
null
如果没有下一个同级节点。
getNextSibling
接口
Node
Node
,或
null
。
public NamedNodeMap getAttributes()
NamedNodeMap
。
getAttributes
接口
Node
NamedNodeMap
包含该节点的属性。
public Document getOwnerDocument()
null
,因为
IIOMetadataNode
s不属于任何
Document
。
getOwnerDocument
接口
Node
null
。
public Node insertBefore(Node newChild, Node refChild)
newChild
之前已有的子节点
refChild
。如果
refChild
是
null
,插入
newChild
在儿童的列表的末尾。
insertBefore
接口
Node
newChild
-
Node
插入。
refChild
-参考
Node
。
null
newChild
IllegalArgumentException
。
public Node replaceChild(Node newChild, Node oldChild)
newChild
代替子节点
oldChild
,并返回
oldChild
节点。
replaceChild
接口
Node
newChild
-
Node
插入。
oldChild
-
Node
被取代。
null
newChild
IllegalArgumentException
。
public Node removeChild(Node oldChild)
oldChild
从孩子的名单,并返回它。
removeChild
接口
Node
oldChild
-
Node
被删除。
null
oldChild
IllegalArgumentException
。
public Node appendChild(Node newChild)
newChild
对这个子节点列表的末尾。
appendChild
接口
Node
newChild
-
Node
插入。
null
newChild
IllegalArgumentException
。
public boolean hasChildNodes()
true
如果该节点的子节点。
hasChildNodes
接口
Node
true
此节点是否有孩子。
public Node cloneNode(boolean deep)
getParentNode
返回
null
)。如果一个浅克隆正在进行(
deep
是
false
),新的节点不会有孩子或兄弟姐妹。如果一个深克隆正在进行,新的节点将形成一个完整的克隆的子树的根。
public void normalize()
IIOMetadataNode
s不包含
Text
儿童。
public boolean isSupported(String feature, String version)
false
由于不支持DOM的功能。
isSupported
接口
Node
feature
-
String
,不容忽视。
version
-
String
,不容忽视。
false
。
public String getNamespaceURI() throws DOMException
null
,因为不支持命名空间。
getNamespaceURI
接口
Node
DOMException
public String getPrefix()
null
,因为不支持命名空间。
getPrefix
接口
Node
null
。
setPrefix(java.lang.String)
public void setPrefix(String prefix)
setPrefix
接口
Node
prefix
-
String
,不容忽视。
getPrefix()
public String getLocalName()
getNodeName
。
getLocalName
接口
Node
String
。
public String getTagName()
getNodeName
。
getTagName
接口
Element
String
public String getAttribute(String name)
getAttribute
接口
Element
name
-属性名称检索。
Attr
值作为一个字符串,或空字符串,如果属性没有指定或默认值。
public String getAttributeNS(String namespaceURI, String localName)
getAttribute(localName)
。
getAttributeNS
接口
Element
namespaceURI
-属性来检索命名空间URI。
localName
-属性的本地名称检索。
Attr
值作为一个字符串,或空字符串,如果属性没有指定或默认值。
setAttributeNS(java.lang.String, java.lang.String, java.lang.String)
public void setAttribute(String name, String value)
Element
Attr
节点加上任何
Text
和
EntityReference
节点,构建相应的子树,并使用
setAttributeNode
指定它作为一个属性的值。
setAttributeNS
方法。
setAttribute
接口
Element
name
-属性来创建或更改名称。
value
值设置为字符串形式。
public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
setAttribute(qualifiedName, value)
。
setAttributeNS
接口
Element
namespaceURI
-属性来创建或修改命名空间URI。
qualifiedName
-属性来创建或更改名称。
value
-设置为字符串形式的价值。
getAttributeNS(java.lang.String, java.lang.String)
public void removeAttribute(String name)
Element
Document.normalizeDocument()
保证这些信息是最新的默认值。
removeAttributeNS
方法。
removeAttribute
接口
Element
name
-属性的名称删除。
public void removeAttributeNS(String namespaceURI, String localName)
removeAttribute(localName)
。
removeAttributeNS
接口
Element
namespaceURI
-属性删除命名空间URI。
localName
-属性的本地名称删除。
public Attr getAttributeNode(String name)
Element
getAttributeNodeNS
方法。
getAttributeNode
接口
Element
name
-名称(
nodeName
)的属性来检索。
Attr
节点(
nodeName
)或
null
如果没有这样的属性。
public Attr getAttributeNodeNS(String namespaceURI, String localName)
getAttributeNode(localName)
。
getAttributeNodeNS
接口
Element
namespaceURI
-属性来检索命名空间URI。
localName
-属性的本地名称检索。
Attr
节点指定属性的本地名称和命名空间URI或
null
如果没有这样的属性。
setAttributeNodeNS(org.w3c.dom.Attr)
public Attr setAttributeNode(Attr newAttr) throws DOMException
Element
nodeName
)已经存在的元素,它是由新的代替。用自己替换一个属性节点没有效果。
setAttributeNodeNS
方法。
setAttributeNode
接口
Element
newAttr
-
Attr
节点添加到属性表。
newAttr
属性将取代现有的属性,更换
Attr
节点返回,否则返回
null
。
DOMException
- wrong_document_err:如果
newAttr
是从一个比创建元素的不同文件创建了。
newAttr
已经是另一个对象的一个属性,提出
Element
。DOM节点的用户必须显式地克隆
Attr
重复使用在其他元素。
public Attr setAttributeNodeNS(Attr newAttr)
setAttributeNode(newAttr)
。
setAttributeNodeNS
接口
Element
newAttr
-
Attr
节点添加到属性表。
newAttr
属性具有相同的本地名称和命名空间URI将取代现有的属性,更换
Attr
节点返回,否则返回
null
。
getAttributeNodeNS(java.lang.String, java.lang.String)
public Attr removeAttributeNode(Attr oldAttr)
Element
Attr
节点的默认值是在DTD中定义,一个新的节点立即出现与默认值以及对应的命名空间URI、本地名称和前缀适用时。实施可以处理从其它模式类似但应用程序应使用
Document.normalizeDocument()
保证这些信息是最新的默认值。
removeAttributeNode
接口
Element
oldAttr
-
Attr
节点从属性列表中删除。
Attr
节点被删除。
public NodeList getElementsByTagName(String name)
Element
NodeList
所有后裔
Elements
与给定的标签名称,在文档顺序。
getElementsByTagName
接口
Element
name
-标记的名称匹配。特殊值“*”匹配所有标签。
Element
节点列表匹配。
public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagName(localName)
。
getElementsByTagNameNS
接口
Element
namespaceURI
-元素的命名空间URI匹配。特殊值“*”匹配所有的命名空间。
localName
-元素的本地名称匹配。特别值“*”匹配所有的本地名称。
NodeList
对象包含所有匹配的
Elements
。
public boolean hasAttributes()
Node
hasAttributes
接口
Node
true
此节点是否有任何属性,
false
否则。
public boolean hasAttribute(String name)
Element
true
时返回具有给定名称的属性指定这个元素或具有默认值,否则
false
。
hasAttribute
接口
Element
name
-属性的名字找。
true
如果具有给定名称的属性是该元素指定或默认值,否则
false
。
public boolean hasAttributeNS(String namespaceURI, String localName)
hasAttribute(localName)
。
hasAttributeNS
接口
Element
namespaceURI
-属性查找命名空间URI。
localName
-本地的属性名字找。
true
如果与给定的本地名称和命名空间URI属性指定或对该元素的默认值,否则
false
。
public int getLength()
NodeList
length-1
包容。
public Object getUserObject()
Object
价值。
Object
。
setUserObject(java.lang.Object)
public void setUserObject(Object userObject)
userObject
-用户
Object
。
getUserObject()
public void setIdAttribute(String name, boolean isId) throws DOMException
IIOMetadataNode
和将
DOMException
。
setIdAttribute
接口
Element
name
-属性的名称。
isId
-属性是否是一个类型的ID。
DOMException
-永远。
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
IIOMetadataNode
和将
DOMException
。
setIdAttributeNS
接口
Element
namespaceURI
-属性的命名空间URI。
localName
-属性的本地名称。
isId
-属性是否是一个类型的ID。
DOMException
-永远。
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
IIOMetadataNode
和将
DOMException
。
setIdAttributeNode
接口
Element
idAttr
-属性节点。
isId
-属性是否是一个类型的ID。
DOMException
-永远。
public TypeInfo getSchemaTypeInfo() throws DOMException
IIOMetadataNode
和将
DOMException
。
getSchemaTypeInfo
接口
Element
DOMException
-永远。
public Object setUserData(String key, Object data, UserDataHandler handler) throws DOMException
IIOMetadataNode
和将
DOMException
。
setUserData
接口
Node
key
-交往对象的关键。
data
对象--联想到给定的键,或
null
删除任何现有的协会,关键。
handler
-处理器联想到钥匙,或者
null
。
DOMUserData
,或
null
如果没有。
DOMException
-永远。
public Object getUserData(String key) throws DOMException
IIOMetadataNode
和将
DOMException
。
getUserData
接口
Node
key
的重点对象是相关的。
DOMUserData
,或
null
如果没有。
DOMException
-永远。
public Object getFeature(String feature, String version) throws DOMException
IIOMetadataNode
和将
DOMException
。
getFeature
接口
Node
feature
特征的名称要求。注意任何加号“+”添加到特征的名称将被忽略,因为它在这一方法的上下文不显著。
version
-这是测试功能的版本号。
null
如果没有对象实现与功能相关的接口。如果此方法返回的
DOMObject
实现
Node
接口,它必须代表最主要的核心
Node
不返回结果与原核心
Node
如属性、子不一致,等等。
DOMException
-永远。
public boolean isSameNode(Node node) throws DOMException
IIOMetadataNode
和将
DOMException
。
isSameNode
接口
Node
node
-测试节点。
true
如果节点是相同的,
false
否则。
DOMException
-永远。
public boolean isEqualNode(Node node) throws DOMException
IIOMetadataNode
和将
DOMException
。
isEqualNode
接口
Node
node
-平等比较的结。
true
如果节点都是平等的,
false
否则。
DOMException
-永远。
public String lookupNamespaceURI(String prefix) throws DOMException
IIOMetadataNode
和将
DOMException
。
lookupNamespaceURI
接口
Node
prefix
-前缀查找。如果这个参数是
null
,方法会返回默认的命名空间URI。
null
如果没有发现。
DOMException
-永远。
public boolean isDefaultNamespace(String namespaceURI) throws DOMException
IIOMetadataNode
和将
DOMException
。
isDefaultNamespace
接口
Node
namespaceURI
的命名空间URI查找。
true
如果指定
namespaceURI
是默认的命名空间,
false
否则。
DOMException
-永远。
public String lookupPrefix(String namespaceURI) throws DOMException
IIOMetadataNode
和将
DOMException
。
lookupPrefix
接口
Node
namespaceURI
的命名空间URI查找。
null
如果没有发现。如果一个以上的前缀与命名空间前缀关联,则返回的命名空间前缀是实现依赖的。
DOMException
-永远。
public String getTextContent() throws DOMException
IIOMetadataNode
和将
DOMException
。
getTextContent
接口
Node
DOMException
-永远。
public void setTextContent(String textContent) throws DOMException
IIOMetadataNode
和将
DOMException
。
setTextContent
接口
Node
DOMException
-永远。
public short compareDocumentPosition(Node other) throws DOMException
IIOMetadataNode
和将
DOMException
。
compareDocumentPosition
接口
Node
other
-对参考节点的节点比较。
DOMException
-永远。
public String getBaseURI() throws DOMException
IIOMetadataNode
和将
DOMException
。
getBaseURI
接口
Node
DOMException
-永远。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.