public class Stax2EventWriterImpl extends Object implements XMLEventWriter, XMLStreamConstants
XMLEventWriter
.ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor and Description |
---|
Stax2EventWriterImpl(XMLStreamWriter2 sw) |
Modifier and Type | Method and Description |
---|---|
void |
add(XMLEvent event)
Basic implementation of the method which will use event implementations
available as part of the reference implementation.
|
void |
add(XMLEventReader reader) |
void |
close() |
void |
flush() |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String uri) |
void |
setDefaultNamespace(String uri) |
void |
setNamespaceContext(NamespaceContext ctxt) |
void |
setPrefix(String prefix,
String uri) |
public Stax2EventWriterImpl(XMLStreamWriter2 sw)
public void add(XMLEvent event) throws XMLStreamException
Note: ALL events (except for custom ones ref. impl. itself doesn't produce, and thus may not always be able to deal with) are routed through stream writer. This because it may want to do different kinds of validation
add
in interface XMLEventConsumer
add
in interface XMLEventWriter
XMLStreamException
public void add(XMLEventReader reader) 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 uri) throws XMLStreamException
getPrefix
in interface XMLEventWriter
XMLStreamException
public void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace
in interface XMLEventWriter
XMLStreamException
public void setNamespaceContext(NamespaceContext ctxt) throws XMLStreamException
setNamespaceContext
in interface XMLEventWriter
XMLStreamException
public void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix
in interface XMLEventWriter
XMLStreamException
Copyright © 2015 fasterxml.com. All Rights Reserved.