public class StAXEventWriter extends Object implements javax.xml.stream.XMLEventWriter
| Constructor and Description |
|---|
StAXEventWriter(javax.xml.stream.XMLStreamWriter streamWriter) |
| Modifier and Type | Method and 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
|
NamespaceContext |
getNamespaceContext()
Returns the current namespace context.
|
String |
getPrefix(String uri)
Gets the prefix the uri is bound to
|
void |
setDefaultNamespace(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(NamespaceContext namespaceContext)
Sets the current namespace context for prefix and uri bindings.
|
void |
setPrefix(String prefix,
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 String getPrefix(String uri) throws javax.xml.stream.XMLStreamException
getPrefix in interface javax.xml.stream.XMLEventWriteruri - the uri to look upjavax.xml.stream.XMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface javax.xml.stream.XMLEventWriterpublic void setDefaultNamespace(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(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(String prefix, 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 © 2012 Oracle Corpration. All Rights Reserved.