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 XMLEventConsumer
add
in interface XMLEventWriter
XMLStreamException
public void add(XMLEventReader arg0) throws XMLStreamException
add
in interface XMLEventWriter
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLEventWriter
XMLStreamException
public void flush() throws XMLStreamException
flush
in interface XMLEventWriter
XMLStreamException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLEventWriter
public String getPrefix(String arg0) throws XMLStreamException
getPrefix
in interface XMLEventWriter
XMLStreamException
public void setDefaultNamespace(String arg0) throws XMLStreamException
setDefaultNamespace
in interface XMLEventWriter
XMLStreamException
public void setNamespaceContext(NamespaceContext arg0) throws XMLStreamException
setNamespaceContext
in interface XMLEventWriter
XMLStreamException
public void setPrefix(String arg0, String arg1) throws XMLStreamException
setPrefix
in interface XMLEventWriter
XMLStreamException