Package com.adaptris.core.transform.json
Class JsonTransformationDriverImpl
java.lang.Object
com.adaptris.core.transform.json.JsonTransformationDriverImpl
- All Implemented Interfaces:
TransformationDriver
- Direct Known Subclasses:
JsonlibTransformationDriver
Transformation Driver using the
net.sf.json
package.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the array name.Get the element name.Whether force top level is set.Get the object name.Get the root name.Whether skip whitespace is set.Whether trim whitespace is set.Whether type hints compatibility is set.Whether type hints is enabled.Get the object name, or default value if null.protected abstract net.sf.json.JSON
Parse the string to JSON.void
setArrayName
(String arrayName) Set the array name.void
setElementName
(String elementName) Set the element name.void
setForceTopLevelObject
(Boolean forceTopLevelObject) Set whether to force top level object.void
setObjectName
(String objectName) Set the object name.void
setRootName
(String rootName) Set the root name.void
setSkipWhitespace
(Boolean skipWhitespace) Set whether to skip whitespace.void
setTrimSpaces
(Boolean trimSpaces) Set whether to trim whitespace.void
setTypeHintsCompatibility
(Boolean typeHintsCompatibility) Set whether type hints compatibility is enabled.void
setTypeHintsEnabled
(Boolean typeHintsEnabled) Set whether type hints is enabled.transform
(String input, TransformationDirection direction) Perform transformation.protected String
Convert XML to JSON.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.transform.json.TransformationDriver
transform
-
Constructor Details
-
JsonTransformationDriverImpl
public JsonTransformationDriverImpl()
-
-
Method Details
-
transform
Perform transformation..- Specified by:
transform
in interfaceTransformationDriver
- Parameters:
input
- The data to transform.direction
- The direction of the transformation.- Returns:
- The transformed data.
- Throws:
ServiceException
- Thrown if there is a problem with the transformation.
-
xmlToJSON
Convert XML to JSON.- Parameters:
input
- The XML to convert.- Returns:
- The converted JSON.
- Throws:
ServiceException
- Thrown if there was a problem converting from XML to JSON.
-
parse
Parse the string to JSON.- Parameters:
input
- The string to parse.- Returns:
- The JSON.
- Throws:
net.sf.json.JSONException
- Thrown if the string could not be parsed to JSON.
-
getArrayName
Get the array name.- Returns:
- The array name.
-
setArrayName
Set the array name.- Parameters:
arrayName
- The array name.
-
getElementName
Get the element name.- Returns:
- The element name.
-
setElementName
Set the element name.- Parameters:
elementName
- The element name.
-
getObjectName
Get the object name.- Returns:
- The object name.
-
objectName
Get the object name, or default value if null.- Returns:
- The object name, or default value.
-
setObjectName
Set the object name.- Parameters:
objectName
- The object name.
-
getRootName
Get the root name.- Returns:
- The root name.
-
setRootName
Set the root name.- Parameters:
rootName
- The root name.
-
getForceTopLevelObject
Whether force top level is set. (Use object as value may not have been defined in configuration, hence null.)- Returns:
- True if force top level is set.
-
setForceTopLevelObject
Set whether to force top level object.- Parameters:
forceTopLevelObject
- Whether to force top level object.
-
getSkipWhitespace
Whether skip whitespace is set. (Use object as value may not have been defined in configuration, hence null.)- Returns:
- True if skip whitespace is set.
-
setSkipWhitespace
Set whether to skip whitespace.- Parameters:
skipWhitespace
- Whether to skip whitespace.
-
getTrimSpaces
Whether trim whitespace is set. (Use object as value may not have been defined in configuration, hence null.)- Returns:
- True if trim whitespace is set.
-
setTrimSpaces
Set whether to trim whitespace.- Parameters:
trimSpaces
- Whether to trim whitespace.
-
getTypeHintsCompatibility
Whether type hints compatibility is set. (Use object as value may not have been defined in configuration, hence null.)- Returns:
- True if type hints compatibility is set.
-
setTypeHintsCompatibility
Set whether type hints compatibility is enabled.- Parameters:
typeHintsCompatibility
- Whether type hints compatibility is enabled.
-
getTypeHintsEnabled
Whether type hints is enabled. (Use object as value may not have been defined in configuration, hence null.)- Returns:
- True if type hints is enabled.
-
setTypeHintsEnabled
Set whether type hints is enabled.- Parameters:
typeHintsEnabled
- Whether type hints is enabled.
-