public final class XmlEventWriter extends Object implements XMLEventWriter
| Constructor and Description |
|---|
XmlEventWriter(Writer baos,
String prefix,
boolean includeXMLDeclaration,
String rootElement) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(XMLEvent event) |
void |
add(XMLEventReader arg0) |
void |
close() |
void |
flush() |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String arg0) |
void |
setDefaultNamespace(String arg0) |
void |
setNamespaceContext(NamespaceContext arg0) |
void |
setPrefix(String arg0,
String arg1) |
public XmlEventWriter(Writer baos, String prefix, boolean includeXMLDeclaration, String rootElement)
baos - output buffer to writeprefix - optional prefix for ns (empty by default)includeXMLDeclaration - true to include the xml declaration (true by default)rootElement - local name of the root element of the XML fragment to create, used to declare namespacepublic void add(XMLEvent event) throws XMLStreamException
add in interface XMLEventConsumeradd in interface XMLEventWriterXMLStreamExceptionpublic void add(XMLEventReader arg0) throws XMLStreamException
add in interface XMLEventWriterXMLStreamExceptionpublic void close()
throws XMLStreamException
close in interface XMLEventWriterXMLStreamExceptionpublic void flush()
throws XMLStreamException
flush in interface XMLEventWriterXMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLEventWriterpublic String getPrefix(String arg0) throws XMLStreamException
getPrefix in interface XMLEventWriterXMLStreamExceptionpublic void setDefaultNamespace(String arg0) throws XMLStreamException
setDefaultNamespace in interface XMLEventWriterXMLStreamExceptionpublic void setNamespaceContext(NamespaceContext arg0) throws XMLStreamException
setNamespaceContext in interface XMLEventWriterXMLStreamExceptionpublic void setPrefix(String arg0, String arg1) throws XMLStreamException
setPrefix in interface XMLEventWriterXMLStreamException