Package org.apache.sis.xml
Class OutputFactory
java.lang.Object
org.apache.sis.util.Static
org.apache.sis.xml.OutputFactory
Provides access to
XMLOutputFactory
methods as static methods working on a SIS-wide instance.
This convenience is provided in a separated class in order to allow the JVM to instantiate the factory
only when first needed, when initializing this class.- Since:
- 0.4
- Version:
- 1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XMLEventWriter
createXMLEventWriter
(OutputStream out, String encoding) Creates a new writer for the given stream.static XMLEventWriter
Creates a new writer for the given stream.static XMLEventWriter
Creates a new writer for the JAXP result.static XMLEventWriter
Creates a new writer for the JAXP result.static XMLEventWriter
createXMLEventWriter
(Node out) Creates a new writer for the JAXP result.static XMLEventWriter
Creates a new writer for the JAXP result.
-
Field Details
-
FACTORY
The SIS-wide factory. This factory can be specified by the user, for example using thejavax.xml.stream.XMLOutputFactory
system property.Note:XMLOutputFactory
has annewDefaultFactory()
method which bypass user settings.
-
-
Constructor Details
-
OutputFactory
private OutputFactory()Do not allow instantiation of this class.
-
-
Method Details
-
createXMLEventWriter
public static XMLEventWriter createXMLEventWriter(OutputStream out, String encoding) throws XMLStreamException Creates a new writer for the given stream. It is caller's responsibility to close the given output stream after usage (it will not be done byXMLEventWriter.close()
).- Parameters:
out
- where to write to.encoding
- the document encoding (usually"UTF-8"
).- Returns:
- the writer.
- Throws:
XMLStreamException
- if the writer cannot be created.
-
createXMLEventWriter
Creates a new writer for the given stream. It is caller's responsibility to close the given writer after usage (it will not be done byXMLEventWriter.close()
).- Parameters:
out
- where to write to.- Returns:
- the writer.
- Throws:
XMLStreamException
- if the writer cannot be created.
-
createXMLEventWriter
Creates a new writer for the JAXP result. Note that this method is identified as optional in JSE javadoc.- Parameters:
out
- where to write to.- Returns:
- the writer.
- Throws:
XMLStreamException
- if the writer cannot be created.
-
createXMLEventWriter
Creates a new writer for the JAXP result. Note that this method is identified as optional in JSE javadoc.- Parameters:
out
- where to write to.- Returns:
- the writer.
- Throws:
XMLStreamException
- if the writer cannot be created.
-
createXMLEventWriter
Creates a new writer for the JAXP result. Note that this method is identified as optional in JSE javadoc.- Parameters:
out
- where to write to.- Returns:
- the writer.
- Throws:
XMLStreamException
- if the writer cannot be created.
-
createXMLEventWriter
Creates a new writer for the JAXP result. Note that this method is identified as optional in JSE javadoc. It is caller's responsibility to close the given stream writer after usage (it will not be done byXMLEventWriter.close()
).- Parameters:
out
- where to write to.- Returns:
- the writer.
- Throws:
XMLStreamException
- if the writer cannot be created.
-