|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.stream.events Interface StartElement
- All Superinterfaces:
- XMLEvent, XMLStreamConstants
public interface StartElement
- extends XMLEvent
StartElement 接口提供对有关开始元素的信息的访问。StartElement 报告文档中的每个开始标记。
version | 1.0 |
The StartElement interface provides access to information about start elements. A StartElement is reported for each Start Tag in the document.
- Version:
- 1.0
- Author:
- Copyright (c) 2003 by BEA Systems. All Rights Reserved.
Field Summary |
---|
Fields inherited from interface javax.xml.stream.XMLStreamConstants |
---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
Method Summary | |
---|---|
Attribute |
getAttributeByName(QName name)
Returns the attribute referred to by this name |
Iterator |
getAttributes()
Returns an Iterator of non-namespace declared attributes declared on this START_ELEMENT, returns an empty iterator if there are no attributes. |
QName |
getName()
Get the name of this event |
NamespaceContext |
getNamespaceContext()
Gets a read-only namespace context. |
Iterator |
getNamespaces()
Returns an Iterator of namespaces declared on this element. |
String |
getNamespaceURI(String prefix)
Gets the value that the prefix is bound to in the context of this element. |
Methods inherited from interface javax.xml.stream.events.XMLEvent |
---|
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode |
Method Detail |
---|
public javax.xml.namespace.QName
getName()
获取此事件的名称
return | 此事件的限定名 |
getName
QName getName()
- Get the name of this event
- Returns:
- the qualified name of this event
public java.util.Iterator<E>
getAttributes()
返回在此 START_ELEMENT 上声明的已声明非名称空间属性的 Iterator;如果没有这样的属性,则返回空迭代器。迭代器必须只包含 javax.xml.stream.Attribute 接口的实现。属性是完全无序的,且不能以任意顺序报告。
return | 可在 Attribute 接口上进行迭代的只读 Iterator,或者返回空迭代器 |
getAttributes
Iterator getAttributes()
- Returns an Iterator of non-namespace declared attributes declared on
this START_ELEMENT,
returns an empty iterator if there are no attributes. The
iterator must contain only implementations of the javax.xml.stream.Attribute
interface. Attributes are fundamentally unordered and may not be reported
in any order.
- Returns:
- a readonly Iterator over Attribute interfaces, or an empty iterator
public java.util.Iterator<E>
getNamespaces()
返回在此元素上声明的名称空间的 Iterator。此 Iterator 不包含以前声明的名称空间,除非它们出现在当前 START_ELEMENT 中。因此该列表可能包含重新声明的名称空间和重复的名称空间声明。使用 getNamespaceContext() 方法获取名称空间声明的当前上下文。
迭代器只能包含 javax.xml.stream.Namespace 接口的实现。
名称空间是一个属性。可以以属性列表的方式在名称空间列表上进行迭代。但是,此方法只返回在此 START_ELEMENT 中声明的名称空间的列表,不包含在此 START_ELEMENT 中声明的属性。 如果没有名称空间,则返回空迭代器。
return | 可在名称空间接口上进行迭代的只读 Iterator,或者返回空迭代器 |
getNamespaces
Iterator getNamespaces()
- Returns an Iterator of namespaces declared on this element.
This Iterator does not contain previously declared namespaces
unless they appear on the current START_ELEMENT.
Therefore this list may contain redeclared namespaces and duplicate namespace
declarations. Use the getNamespaceContext() method to get the
current context of namespace declarations.
The iterator must contain only implementations of the javax.xml.stream.Namespace interface.
A Namespace isA Attribute. One can iterate over a list of namespaces as a list of attributes. However this method returns only the list of namespaces declared on this START_ELEMENT and does not include the attributes declared on this START_ELEMENT. Returns an empty iterator if there are no namespaces.
- Returns:
- a readonly Iterator over Namespace interfaces, or an empty iterator
public Attribute
getAttributeByName(javax.xml.namespace.QName name)
返回此名称引用的属性
name | 所需名称的 qname |
return | 与名称值相对应的属性或 null |
getAttributeByName
Attribute getAttributeByName(QName name)
- Returns the attribute referred to by this name
- Parameters:
name
- the qname of the desired name- Returns:
- the attribute corresponding to the name value or null
public javax.xml.namespace.NamespaceContext
getNamespaceContext()
获取只读名称空间上下文。如果没有可用的上下文,此方法将返回空名称空间上下文。NamespaceContext 包含有关此 StartElement 的作用域中所有名称空间的信息。
return | 当前名称空间上下文 |
getNamespaceContext
NamespaceContext getNamespaceContext()
- Gets a read-only namespace context. If no context is
available this method will return an empty namespace context.
The NamespaceContext contains information about all namespaces
in scope for this StartElement.
- Returns:
- the current namespace context
public String
getNamespaceURI(String prefix)
获取绑定在此元素上下文中的前缀的值。如果前缀未绑定在此上下文中,则返回 null
prefix | 要查找的前缀 |
return | 绑定到前缀的 URI 或 null |
getNamespaceURI
String getNamespaceURI(String prefix)
- Gets the value that the prefix is bound to in the
context of this element. Returns null if
the prefix is not bound in this context
- Parameters:
prefix
- the prefix to lookup- Returns:
- the uri bound to the prefix or null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!