Top Description Fields Constructors Methods
com.fasterxml.aalto.stax

public final Class OutputFactoryImpl

extends XMLOutputFactory2
Class Inheritance
Imports
java.io.*, javax.xml.stream.*, javax.xml.transform.Result, javax.xml.transform.dom.DOMResult, javax.xml.transform.sax.SAXResult, javax.xml.transform.stream.StreamResult, org.codehaus.stax2.XMLOutputFactory2, .XMLStreamWriter2, org.codehaus.stax2.io.Stax2Result, org.codehaus.stax2.ri.Stax2EventWriterImpl, .Stax2WriterAdapter, com.fasterxml.aalto.dom.DOMWriterImpl, com.fasterxml.aalto.impl.IoStreamException, .StreamExceptionBase, com.fasterxml.aalto.out.*, com.fasterxml.aalto.util.CharsetNames, .URLUtil, .XmlConsts

Basic implementation of XMLOutputFactory.
Author
Tatu Saloranta

Field Summary

Modifier and TypeField and Description
protected final WriterConfig
Inherited from org.codehaus.stax2.XMLOutputFactory2:
P_ATTR_VALUE_ESCAPERP_AUTO_CLOSE_OUTPUTP_AUTOMATIC_EMPTY_ELEMENTSP_AUTOMATIC_NS_PREFIXP_TEXT_ESCAPER

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
configureForRobustness()

Implements abstract org.codehaus.stax2.XMLOutputFactory2.configureForRobustness.

Method call to make writer be as robust as possible, that is, to make it both check AND fix problems if it can.
public void
configureForSpeed()

Implements abstract org.codehaus.stax2.XMLOutputFactory2.configureForSpeed.

Method call to make writer optimize its operation for speed.
public void
configureForXmlConformance()

Implements abstract org.codehaus.stax2.XMLOutputFactory2.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.
private XMLStreamWriter2
createSW(OutputStream out, Writer w, String enc, boolean forceAutoClose)

private XMLStreamWriter2
public XMLEventWriter
createXMLEventWriter(OutputStream
the stream to write to
out
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a stream
public XMLEventWriter
createXMLEventWriter(OutputStream
the stream to write to
out
,
String
the encoding to use
enc
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a stream
public XMLEventWriter
createXMLEventWriter(Result
the result to write to
result
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a JAXP result.
public XMLEventWriter
createXMLEventWriter(Writer
the stream to write to
w
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a writer
public XMLEventWriter
public XMLEventWriter
public XMLStreamWriter
createXMLStreamWriter(OutputStream
the stream to write to
out
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a stream
public XMLStreamWriter
createXMLStreamWriter(OutputStream
the stream to write to
out
,
String
the encoding to use
enc
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a stream
public XMLStreamWriter
createXMLStreamWriter(Result
the result to write to
result
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a JAXP result.
public XMLStreamWriter
createXMLStreamWriter(Writer
the writer to write to
w
)

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a writer
public XMLStreamWriter2
public Object
getProperty(String
The name of the property
name
)

Implements abstract javax.xml.stream.XMLOutputFactory.getProperty.

Get a feature/property on the underlying implementation
public boolean
isPropertySupported(String
The name of the property (may not be null)
name
)

Implements abstract javax.xml.stream.XMLOutputFactory.isPropertySupported.

Query the set of properties that this factory supports.
public void
setProperty(String
The name of the property
name
,
Object
The value of the property
value
)

Implements abstract javax.xml.stream.XMLOutputFactory.setProperty.

Allows the user to set specific features/properties on the underlying implementation.

Field Detail

_configback to summary
protected final WriterConfig _config

Constructor Detail

OutputFactoryImplback to summary
public OutputFactoryImpl()

Method Detail

configureForRobustnessback to summary
public void configureForRobustness()

Implements abstract org.codehaus.stax2.XMLOutputFactory2.configureForRobustness.

Doc from org.codehaus.stax2.XMLOutputFactory2.configureForRobustness.

Method call to make writer be as robust as possible, that is, to make it both check AND fix problems if it can.

Like 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.

Annotations
@Override
configureForSpeedback to summary
public void configureForSpeed()

Implements abstract org.codehaus.stax2.XMLOutputFactory2.configureForSpeed.

Doc from org.codehaus.stax2.XMLOutputFactory2.configureForSpeed.

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 configureForXmlConformance (and configureForRobustness) enables.

None of currently defined standard properties should be affected.

Annotations
@Override
configureForXmlConformanceback to summary
public void configureForXmlConformance()

Implements abstract org.codehaus.stax2.XMLOutputFactory2.configureForXmlConformance.

Doc from org.codehaus.stax2.XMLOutputFactory2.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.

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.

Annotations
@Override
createSWback to summary
private XMLStreamWriter2 createSW(OutputStream out, Writer w, String enc, boolean forceAutoClose) throws XMLStreamException
createSWback to summary
private XMLStreamWriter2 createSW(Result res) throws XMLStreamException
createXMLEventWriterback to summary
public XMLEventWriter createXMLEventWriter(OutputStream out) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a stream

Parameters
out:OutputStream

the stream to write to

Returns:XMLEventWriter

instance of the XMLEventWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLEventWriterback to summary
public XMLEventWriter createXMLEventWriter(OutputStream out, String enc) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a stream

Parameters
out:OutputStream

the stream to write to

enc:String

the encoding to use

Returns:XMLEventWriter

instance of the XMLEventWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLEventWriterback to summary
public XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a JAXP result. This method is optional.

Parameters
result:Result

the result to write to

Returns:XMLEventWriter

instance of the XMLEventWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLEventWriterback to summary
public XMLEventWriter createXMLEventWriter(Writer w) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLEventWriter.

Create a new XMLEventWriter that writes to a writer

Parameters
w:Writer

the stream to write to

Returns:XMLEventWriter

instance of the XMLEventWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLEventWriterback to summary
public XMLEventWriter createXMLEventWriter(Writer w, String enc) throws XMLStreamException

Implements abstract org.codehaus.stax2.XMLOutputFactory2.createXMLEventWriter.

Annotations
@Override
createXMLEventWriterback to summary
public XMLEventWriter createXMLEventWriter(XMLStreamWriter sw) throws XMLStreamException

Implements abstract org.codehaus.stax2.XMLOutputFactory2.createXMLEventWriter.

Annotations
@Override
createXMLStreamWriterback to summary
public XMLStreamWriter createXMLStreamWriter(OutputStream out) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a stream

Parameters
out:OutputStream

the stream to write to

Returns:XMLStreamWriter

instance of the XMLStreamWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLStreamWriterback to summary
public XMLStreamWriter createXMLStreamWriter(OutputStream out, String enc) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a stream

Parameters
out:OutputStream

the stream to write to

enc:String

the encoding to use

Returns:XMLStreamWriter

instance of the XMLStreamWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLStreamWriterback to summary
public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a JAXP result. This method is optional.

Parameters
result:Result

the result to write to

Returns:XMLStreamWriter

instance of the XMLStreamWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLStreamWriterback to summary
public XMLStreamWriter createXMLStreamWriter(Writer w) throws XMLStreamException

Implements abstract javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Doc from javax.xml.stream.XMLOutputFactory.createXMLStreamWriter.

Create a new XMLStreamWriter that writes to a writer

Parameters
w:Writer

the writer to write to

Returns:XMLStreamWriter

instance of the XMLStreamWriter

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
createXMLStreamWriterback to summary
public XMLStreamWriter2 createXMLStreamWriter(Writer w, String enc) throws XMLStreamException

Implements abstract org.codehaus.stax2.XMLOutputFactory2.createXMLStreamWriter.

Annotations
@Override
getPropertyback to summary
public Object getProperty(String name)

Implements abstract javax.xml.stream.XMLOutputFactory.getProperty.

Doc from javax.xml.stream.XMLOutputFactory.getProperty.

Get a feature/property on the underlying implementation

Parameters
name:String

The name of the property

Returns:Object

The value of the property

Annotations
@Override
isPropertySupportedback to summary
public boolean isPropertySupported(String name)

Implements abstract javax.xml.stream.XMLOutputFactory.isPropertySupported.

Doc from javax.xml.stream.XMLOutputFactory.isPropertySupported.

Query the set of properties that this factory supports.

Parameters
name:String

The name of the property (may not be null)

Returns:boolean

true if the property is supported and false otherwise

Annotations
@Override
setPropertyback to summary
public void setProperty(String name, Object value)

Implements abstract javax.xml.stream.XMLOutputFactory.setProperty.

Doc from javax.xml.stream.XMLOutputFactory.setProperty.

Allows the user to set specific features/properties on the underlying implementation.

Parameters
name:String

The name of the property

value:Object

The value of the property

Annotations
@Override