com.ctc.wstx.evt
Class WstxEventWriter
java.lang.Object
com.ctc.wstx.evt.WstxEventWriter
- All Implemented Interfaces:
- OutputConfigFlags, javax.xml.stream.util.XMLEventConsumer, javax.xml.stream.XMLEventWriter, javax.xml.stream.XMLStreamConstants
public class WstxEventWriter
- extends java.lang.Object
- implements javax.xml.stream.XMLEventWriter, javax.xml.stream.XMLStreamConstants, OutputConfigFlags
Simple implementation of XMLEventWriter
. The only 'special' thing
is that since this writer can make full use of the matching
BaseStreamWriter
, it tries to call methods that
allow full validation of output (if enabled by output settings).
Fields inherited from interface javax.xml.stream.XMLStreamConstants |
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
Fields inherited from interface com.ctc.wstx.cfg.OutputConfigFlags |
CFG_AUTOMATIC_EMPTY_ELEMS, CFG_AUTOMATIC_NS, CFG_COPY_DEFAULT_ATTRS, CFG_ENABLE_NS, CFG_ESCAPE_CR, CFG_FIX_CONTENT, CFG_OUTPUT_CDATA_AS_TEXT, CFG_VALIDATE_ATTR, CFG_VALIDATE_CONTENT, CFG_VALIDATE_NAMES, CFG_VALIDATE_STRUCTURE |
Method Summary |
void |
add(javax.xml.stream.events.XMLEvent event)
Note: ALL events (except for custom ones Wstx itself doesn't produce,
and thus can not deal with) are routed through stream writer. |
void |
add(javax.xml.stream.XMLEventReader reader)
|
void |
close()
|
void |
flush()
|
javax.xml.namespace.NamespaceContext |
getNamespaceContext()
|
java.lang.String |
getPrefix(java.lang.String uri)
|
void |
setDefaultNamespace(java.lang.String uri)
|
void |
setNamespaceContext(javax.xml.namespace.NamespaceContext ctxt)
|
void |
setPrefix(java.lang.String prefix,
java.lang.String uri)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WstxEventWriter
public WstxEventWriter(javax.xml.stream.XMLStreamWriter sw)
add
public void add(javax.xml.stream.events.XMLEvent event)
throws javax.xml.stream.XMLStreamException
Note: ALL events (except for custom ones Wstx itself doesn't produce,
and thus can not deal with) are routed through stream writer. This
because it may want to do different kinds of validation
- Specified by:
add
in interface javax.xml.stream.util.XMLEventConsumer
- Specified by:
add
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
add
public void add(javax.xml.stream.XMLEventReader reader)
throws javax.xml.stream.XMLStreamException
- Specified by:
add
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
close
public void close()
throws javax.xml.stream.XMLStreamException
- Specified by:
close
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
flush
public void flush()
throws javax.xml.stream.XMLStreamException
- Specified by:
flush
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
getNamespaceContext
public javax.xml.namespace.NamespaceContext getNamespaceContext()
- Specified by:
getNamespaceContext
in interface javax.xml.stream.XMLEventWriter
getPrefix
public java.lang.String getPrefix(java.lang.String uri)
throws javax.xml.stream.XMLStreamException
- Specified by:
getPrefix
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
setDefaultNamespace
public void setDefaultNamespace(java.lang.String uri)
throws javax.xml.stream.XMLStreamException
- Specified by:
setDefaultNamespace
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
setNamespaceContext
public void setNamespaceContext(javax.xml.namespace.NamespaceContext ctxt)
throws javax.xml.stream.XMLStreamException
- Specified by:
setNamespaceContext
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException
setPrefix
public void setPrefix(java.lang.String prefix,
java.lang.String uri)
throws javax.xml.stream.XMLStreamException
- Specified by:
setPrefix
in interface javax.xml.stream.XMLEventWriter
- Throws:
javax.xml.stream.XMLStreamException