|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.xml.transform.sax.SAXResult org.weborganic.aeson.JSONResult
public class JSONResult
A Result implementation automatically writing out JSON.
Field Summary |
---|
Fields inherited from class javax.xml.transform.sax.SAXResult |
---|
FEATURE |
Fields inherited from interface javax.xml.transform.Result |
---|
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
static boolean |
supports(Transformer t)
Indicates whether the specified transformer based on its output properties. |
Methods inherited from class javax.xml.transform.sax.SAXResult |
---|
getHandler, getLexicalHandler, getSystemId, setHandler, setLexicalHandler, setSystemId |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.transform.Result |
---|
getSystemId, setSystemId |
Constructor Detail |
---|
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.Method Detail |
---|
public static Result newInstanceIfSupported(Transformer t, StreamResult result)
t
-
public static JSONResult newInstance(StreamResult result)
result
- a non-null stream result instance.
JSONResult
instance using the same properties as the stream result.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 implementation
true
if it matches the conditions above;
false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |