public class DefaultJsonTransformationDriver extends JsonTransformationDriverImpl
JSONObject.fromObject(Object)
and JSONArray.fromObject(Object)
to
parse the input.
This uses the net.sf.json
package, which in some situations, can be very sensitive to whitespace, and output may not be
as you expect. Accordingly, when you are generating the XML to be rendered as JSON make sure that you use
xsl:strip-space elements="*"
.
In the adapter configuration file this class is aliased as default-transformation-driver which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
DefaultJsonTransformationDriver() |
Modifier and Type | Method and Description |
---|---|
protected net.sf.json.JSON |
parse(java.lang.String input)
Parse the string to JSON.
|
protected static net.sf.json.JSONArray |
parseArray(java.lang.String input) |
protected static net.sf.json.JSONObject |
parseObject(java.lang.String input) |
getArrayName, getElementName, getForceTopLevelObject, getObjectName, getRootName, getSkipWhitespace, getTrimSpaces, getTypeHintsCompatibility, getTypeHintsEnabled, objectName, setArrayName, setElementName, setForceTopLevelObject, setObjectName, setRootName, setSkipWhitespace, setTrimSpaces, setTypeHintsCompatibility, setTypeHintsEnabled, transform, xmlToJSON
protected net.sf.json.JSON parse(java.lang.String input) throws net.sf.json.JSONException
JsonTransformationDriverImpl
parse
in class JsonTransformationDriverImpl
input
- The string to parse.net.sf.json.JSONException
- Thrown if the string could not be parsed to JSON.protected static net.sf.json.JSONObject parseObject(java.lang.String input) throws net.sf.json.JSONException
net.sf.json.JSONException
protected static net.sf.json.JSONArray parseArray(java.lang.String input) throws net.sf.json.JSONException
net.sf.json.JSONException