com.ctc.wstx.stax
Class WstxOutputFactory
java.lang.Object
javax.xml.stream.XMLOutputFactory
org.codehaus.stax2.XMLOutputFactory2
com.ctc.wstx.stax.WstxOutputFactory
- All Implemented Interfaces:
- OutputConfigFlags, XMLStreamProperties
public class WstxOutputFactory
- extends XMLOutputFactory2
- implements OutputConfigFlags
Implementation of XMLOutputFactory
for Wstx.
TODO:
- Implement outputter that creates SAX events (DOM-backed
writer exists as of Woodstox 3.2)
Fields inherited from interface com.ctc.wstx.cfg.OutputConfigFlags |
CFG_ADD_SPACE_AFTER_EMPTY_ELEM, CFG_AUTO_CLOSE_OUTPUT, CFG_AUTOMATIC_EMPTY_ELEMENTS, CFG_AUTOMATIC_END_ELEMENTS, 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 |
configureForRobustness()
Method call to make writer be as robust as possible, that is, to
make it both check AND fix problems if it can. |
void |
configureForSpeed()
Method call to make writer optimize its operation for speed. |
void |
configureForXmlConformance()
Method call to make writer be as strict with output as possible,
ie maximize validation it does to try to catch any well-formedness
or validity problems. |
protected XMLStreamWriter2 |
createSW(String enc,
WriterConfig cfg,
XmlWriter xw)
Called by createSW(OutputStream, Writer, String, boolean) after all of the nessesary configuration
logic is complete. |
XMLEventWriter |
createXMLEventWriter(OutputStream out)
|
XMLEventWriter |
createXMLEventWriter(OutputStream out,
String enc)
|
XMLEventWriter |
createXMLEventWriter(Result result)
|
XMLEventWriter |
createXMLEventWriter(Writer w)
|
XMLEventWriter |
createXMLEventWriter(Writer w,
String enc)
|
XMLEventWriter |
createXMLEventWriter(XMLStreamWriter sw)
|
XMLStreamWriter |
createXMLStreamWriter(OutputStream out)
|
XMLStreamWriter |
createXMLStreamWriter(OutputStream out,
String enc)
|
XMLStreamWriter |
createXMLStreamWriter(Result result)
|
XMLStreamWriter |
createXMLStreamWriter(Writer w)
|
XMLStreamWriter2 |
createXMLStreamWriter(Writer w,
String enc)
|
WriterConfig |
getConfig()
|
Object |
getProperty(String name)
|
boolean |
isPropertySupported(String name)
|
void |
setProperty(String name,
Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mConfig
protected final WriterConfig mConfig
WstxOutputFactory
public WstxOutputFactory()
createXMLEventWriter
public XMLEventWriter createXMLEventWriter(OutputStream out)
throws XMLStreamException
- Specified by:
createXMLEventWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLEventWriter
public XMLEventWriter createXMLEventWriter(OutputStream out,
String enc)
throws XMLStreamException
- Specified by:
createXMLEventWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLEventWriter
public XMLEventWriter createXMLEventWriter(Result result)
throws XMLStreamException
- Specified by:
createXMLEventWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLEventWriter
public XMLEventWriter createXMLEventWriter(Writer w)
throws XMLStreamException
- Specified by:
createXMLEventWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLStreamWriter
public XMLStreamWriter createXMLStreamWriter(OutputStream out)
throws XMLStreamException
- Specified by:
createXMLStreamWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLStreamWriter
public XMLStreamWriter createXMLStreamWriter(OutputStream out,
String enc)
throws XMLStreamException
- Specified by:
createXMLStreamWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLStreamWriter
public XMLStreamWriter createXMLStreamWriter(Result result)
throws XMLStreamException
- Specified by:
createXMLStreamWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
createXMLStreamWriter
public XMLStreamWriter createXMLStreamWriter(Writer w)
throws XMLStreamException
- Specified by:
createXMLStreamWriter
in class XMLOutputFactory
- Throws:
XMLStreamException
getProperty
public Object getProperty(String name)
- Specified by:
getProperty
in class XMLOutputFactory
isPropertySupported
public boolean isPropertySupported(String name)
- Specified by:
isPropertySupported
in class XMLOutputFactory
setProperty
public void setProperty(String name,
Object value)
- Specified by:
setProperty
in class XMLOutputFactory
createXMLEventWriter
public XMLEventWriter createXMLEventWriter(Writer w,
String enc)
throws XMLStreamException
- Specified by:
createXMLEventWriter
in class XMLOutputFactory2
- Throws:
XMLStreamException
createXMLEventWriter
public XMLEventWriter createXMLEventWriter(XMLStreamWriter sw)
throws XMLStreamException
- Specified by:
createXMLEventWriter
in class XMLOutputFactory2
- Throws:
XMLStreamException
createXMLStreamWriter
public XMLStreamWriter2 createXMLStreamWriter(Writer w,
String enc)
throws XMLStreamException
- Specified by:
createXMLStreamWriter
in class XMLOutputFactory2
- Throws:
XMLStreamException
configureForXmlConformance
public void configureForXmlConformance()
- Description copied from class:
XMLOutputFactory2
- Method call to make writer be as strict with output as possible,
ie maximize validation it does to try to catch any well-formedness
or validity problems.
This configuration does add some overhead to output process, since
it enables content checks that are overhead.
None of currently defined standard properties should be affected,
but implementations are likely to enable/disable custom
properties related to validation.
- Specified by:
configureForXmlConformance
in class XMLOutputFactory2
configureForRobustness
public void configureForRobustness()
- Description copied from class:
XMLOutputFactory2
- Method call to make writer be as robust as possible, that is, to
make it both check AND fix problems if it can.
Like XMLOutputFactory2.configureForXmlConformance()
, this configuration adds
some overhead to output process.
None of currently defined standard properties should be affected,
but implementations are likely to enable/disable custom
properties related to validation.
- Specified by:
configureForRobustness
in class XMLOutputFactory2
configureForSpeed
public void configureForSpeed()
- Description copied from class:
XMLOutputFactory2
- Method call to make writer optimize its operation for speed. This
generally disably additional checks (if any) writer does, and is
likely to disable many things that
XMLOutputFactory2.configureForXmlConformance()
(and XMLOutputFactory2.configureForRobustness()
) enables.
None of currently defined standard properties should be affected.
- Specified by:
configureForSpeed
in class XMLOutputFactory2
getConfig
public WriterConfig getConfig()
createSW
protected XMLStreamWriter2 createSW(String enc,
WriterConfig cfg,
XmlWriter xw)
- Called by
createSW(OutputStream, Writer, String, boolean)
after all of the nessesary configuration
logic is complete.