public interface XMLEventReader extends Iterator
XMLInputFactory
,
XMLEventWriter
Modifier and Type | Method and Description |
---|---|
void |
close()
释放与此读者相关联的任何资源。
|
String |
getElementText()
读取一个文本唯一元素的内容。
|
Object |
getProperty(String name)
从底层实现获取一个功能/属性的值
|
boolean |
hasNext()
检查是否有更多的事件。
|
XMLEvent |
nextEvent()
下次XMLEvent
|
XMLEvent |
nextTag()
跳过任何微不足道的空间事件直到start_element或end_element达到。
|
XMLEvent |
peek()
检查下XMLEvent没有读它从流。
|
forEachRemaining, next, remove
XMLEvent nextEvent() throws XMLStreamException
XMLStreamException
-如果有一个与底层XML错误。
NoSuchElementException
迭代没有更多的元素。
XMLEvent
boolean hasNext()
XMLEvent peek() throws XMLStreamException
XMLStreamException
XMLEvent
String getElementText() throws XMLStreamException
XMLStreamException
-如果当前事件不是一个start_element或者遇到一个非文本元素
XMLEvent nextTag() throws XMLStreamException
XMLStreamException
如果比其他任何空格字符时
Object getProperty(String name) throws IllegalArgumentException
name
-属性的名称
IllegalArgumentException
如果物业不支持
void close() throws XMLStreamException
XMLStreamException
-如果有错误释放相关资源
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.