Package net.sf.saxon.serialize
Class ExpandedStreamResult
java.lang.Object
javax.xml.transform.stream.StreamResult
net.sf.saxon.serialize.ExpandedStreamResult
- All Implemented Interfaces:
Result
An ExpandedStreamResult is similar to a StreamResult, and is created from a StreamResult. It contains
methods to construct a Writer from an OutputStream, and an OutputStream from a File or URI, and
(unlike StreamResult) its getWriter() and getOutputStream() methods can therefore be used whether
or not the writer and outputStream were explicitly set.
-
Field Summary
Fields inherited from class javax.xml.transform.stream.StreamResult
FEATUREFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
ConstructorsConstructorDescriptionExpandedStreamResult(Configuration config, StreamResult result, Properties outputProperties) -
Method Summary
Modifier and TypeMethodDescriptionGet the character setbooleanAsk whether the unicode writer myst be closed after use.static FilemakeWritableOutputFile(String uriString) protected OutputStreamMake a UnicodeWriter for an Emitter to use.voidSet the output destination as a character streambooleanDetermine whether the Emitter wants a Writer for character output or an OutputStream for binary output.Methods inherited from class javax.xml.transform.stream.StreamResult
getOutputStream, getSystemId, getWriter, setOutputStream, setSystemId, setSystemId
-
Constructor Details
-
ExpandedStreamResult
public ExpandedStreamResult(Configuration config, StreamResult result, Properties outputProperties) throws XPathException - Throws:
XPathException
-
-
Method Details
-
obtainUnicodeWriter
Make a UnicodeWriter for an Emitter to use.- Returns:
- the new UnicodeWriter
- Throws:
XPathException- if an error occurs
-
obtainOutputStream
- Throws:
XPathException
-
isMustCloseAfterUse
public boolean isMustCloseAfterUse()Ask whether the unicode writer myst be closed after use. This will typically be true if the writer was created by Saxon, rather than being supplied by the user.- Returns:
- tru if the unicode writer myst be closed after use
-
makeWritableOutputFile
public static File makeWritableOutputFile(String uriString) throws URISyntaxException, XPathException - Throws:
URISyntaxExceptionXPathException
-
usesWriter
public boolean usesWriter()Determine whether the Emitter wants a Writer for character output or an OutputStream for binary output. The standard Emitters all use a Writer, so this returns true; but a subclass can override this if it wants to use an OutputStream- Returns:
- true if a Writer is needed, as distinct from an OutputStream
-
setWriter
Set the output destination as a character stream- Overrides:
setWriterin classStreamResult- Parameters:
writer- the Writer to use as an output destination- Throws:
XPathException- if an error occurs
-
getCharacterSet
Get the character set- Returns:
- the CharacterSet
-