public interface XMLEventWriter extends XMLEventConsumer
XMLEventReader , XMLEvent , Characters , ProcessingInstruction , StartElement , EndElement
| Modifier and Type | Method and Description |
|---|---|
void |
add(XMLEvent event)
将事件添加到输出流添加START_ELEMENT将打开一个新的命名空间范围,当对应的END_ELEMENT被写入时将被关闭。
|
void |
add(XMLEventReader reader)
将一个整个流添加到输出流,在inputStream参数上调用next(),直到hasNext()返回false这应被视为一种方便的方法,将对事件读取器中的所有事件执行以下循环,并在每个事件中调用add事件。
|
void |
close()
释放与此流相关联的任何资源
|
void |
flush()
将任何缓存的事件写入基础输出机制
|
NamespaceContext |
getNamespaceContext()
返回当前的命名空间上下文。
|
String |
getPrefix(String uri)
获取uri绑定的前缀
|
void |
setDefaultNamespace(String uri)
将URI绑定到默认命名空间此URI绑定在当前START_ELEMENT / END_ELEMENT对的范围内。
|
void |
setNamespaceContext(NamespaceContext context)
设置前缀和uri绑定的当前命名空间上下文。
|
void |
setPrefix(String prefix, String uri)
设置uri所绑定的前缀。
|
void flush()
throws XMLStreamException
void close()
throws XMLStreamException
void add(XMLEvent event) throws XMLStreamException
add在接口
XMLEventConsumer
event - 要添加的事件
XMLStreamException
void add(XMLEventReader reader) throws XMLStreamException
reader - 事件流添加到输出
XMLStreamException
String getPrefix(String uri) throws XMLStreamException
uri - 要查找的uri
XMLStreamException
void setPrefix(String prefix, String uri) throws XMLStreamException
prefix - 绑定到uri的前缀
uri - 绑定到前缀的uri
XMLStreamException
void setDefaultNamespace(String uri) throws XMLStreamException
uri - 绑定到默认命名空间的uri
XMLStreamException
void setNamespaceContext(NamespaceContext context) throws XMLStreamException
context - 用于此作者的命名空间上下文
XMLStreamException
NamespaceContext getNamespaceContext()
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.