javax.xml.stream.util.XMLEventConsumer, javax.xml.stream.XMLEventWriterpublic class StAXEventWriter
extends java.lang.Object
implements javax.xml.stream.XMLEventWriter
| Constructor | Description |
|---|---|
StAXEventWriter(javax.xml.stream.XMLStreamWriter streamWriter) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(javax.xml.stream.events.XMLEvent event) |
Add an event to the output stream
Adding a START_ELEMENT will open a new namespace scope that
will be closed when the corresponding END_ELEMENT is written.
|
void |
add(javax.xml.stream.XMLEventReader eventReader) |
|
void |
close() |
Frees any resources associated with this stream
|
void |
flush() |
Writes any cached events to the underlying output mechanism
|
javax.xml.namespace.NamespaceContext |
getNamespaceContext() |
Returns the current namespace context.
|
java.lang.String |
getPrefix(java.lang.String uri) |
Gets the prefix the uri is bound to
|
void |
setDefaultNamespace(java.lang.String uri) |
Binds a URI to the default namespace
This URI is bound
in the scope of the current START_ELEMENT / END_ELEMENT pair.
|
void |
setNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext) |
Sets the current namespace context for prefix and uri bindings.
|
void |
setPrefix(java.lang.String prefix,
java.lang.String uri) |
Sets the prefix the uri is bound to.
|
public StAXEventWriter(javax.xml.stream.XMLStreamWriter streamWriter)
streamWriter - public void flush()
throws javax.xml.stream.XMLStreamException
flush in interface javax.xml.stream.XMLEventWriterjavax.xml.stream.XMLStreamExceptionpublic void close()
throws javax.xml.stream.XMLStreamException
close in interface javax.xml.stream.XMLEventWriterjavax.xml.stream.XMLStreamExceptionpublic void add(javax.xml.stream.XMLEventReader eventReader)
throws javax.xml.stream.XMLStreamException
add in interface javax.xml.stream.XMLEventWritereventReader - javax.xml.stream.XMLStreamExceptionpublic void add(javax.xml.stream.events.XMLEvent event)
throws javax.xml.stream.XMLStreamException
add in interface javax.xml.stream.util.XMLEventConsumeradd in interface javax.xml.stream.XMLEventWriterevent - javax.xml.stream.XMLStreamExceptionpublic java.lang.String getPrefix(java.lang.String uri)
throws javax.xml.stream.XMLStreamException
getPrefix in interface javax.xml.stream.XMLEventWriteruri - the uri to look upjavax.xml.stream.XMLStreamExceptionpublic javax.xml.namespace.NamespaceContext getNamespaceContext()
getNamespaceContext in interface javax.xml.stream.XMLEventWriterpublic void setDefaultNamespace(java.lang.String uri)
throws javax.xml.stream.XMLStreamException
setDefaultNamespace in interface javax.xml.stream.XMLEventWriteruri - the uri to bind to the default namespacejavax.xml.stream.XMLStreamExceptionpublic void setNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext)
throws javax.xml.stream.XMLStreamException
setNamespaceContext in interface javax.xml.stream.XMLEventWriternamespaceContext - the namespace context to use for this writerjavax.xml.stream.XMLStreamExceptionpublic void setPrefix(java.lang.String prefix,
java.lang.String uri)
throws javax.xml.stream.XMLStreamException
setPrefix in interface javax.xml.stream.XMLEventWriterprefix - the prefix to bind to the uriuri - the uri to bind to the prefixjavax.xml.stream.XMLStreamExceptionCopyright © 2018 Oracle Corporation. All rights reserved.