public class JSONResult extends SAXResult implements Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
Constructor and Description |
---|
JSONResult()
Zero-argument default constructor.
|
JSONResult(OutputStream out)
Construct a JSONResult from a byte stream.
|
JSONResult(Writer writer)
Construct a JSONResult from a character stream.
|
Modifier and Type | Method and Description |
---|---|
static JSONResult |
newInstance(StreamResult result)
Returns a new instance from the specified stream result.
|
static Result |
newInstanceIfSupported(Transformer t,
StreamResult result)
Returns a new instance of the XSLT result if applicable.
|
static boolean |
supports(Transformer t)
Indicates whether the specified transformer based on its output properties.
|
getHandler, getLexicalHandler, getSystemId, setHandler, setLexicalHandler, setSystemId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSystemId, setSystemId
public JSONResult()
transformation results will go to System.out
.
public JSONResult(OutputStream out)
out
- A valid OutputStream.public JSONResult(Writer writer)
It is generally preferable to use a byte stream so that the encoding can controlled by the xsl:output declaration; but can be convenient when using StringWriter
writer
- A valid character stream.public static Result newInstanceIfSupported(Transformer t, StreamResult result)
t
- The XSLT transformerresult
- The result of transformation as a streampublic static JSONResult newInstance(StreamResult result)
result
- a non-null stream result instance.JSONResult
instance using the same properties as the stream result.NullPointerException
- If the result is stream is null
public static boolean supports(Transformer t)
the transformer is considered to support this Result type if it uses the "xml" method and specifies the media type as "application/json".
t
- the XSLT transformer implementationtrue
if it matches the conditions above;
false
otherwise.Copyright © 2016 Allette Systems. All rights reserved.