public abstract class JsonTransformationDriverImpl extends java.lang.Object implements TransformationDriver
net.sf.json
package.Constructor and Description |
---|
JsonTransformationDriverImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getArrayName()
Get the array name.
|
java.lang.String |
getElementName()
Get the element name.
|
java.lang.Boolean |
getForceTopLevelObject()
Whether force top level is set.
|
java.lang.String |
getObjectName()
Get the object name.
|
java.lang.String |
getRootName()
Get the root name.
|
java.lang.Boolean |
getSkipWhitespace()
Whether skip whitespace is set.
|
java.lang.Boolean |
getTrimSpaces()
Whether trim whitespace is set.
|
java.lang.Boolean |
getTypeHintsCompatibility()
Whether type hints compatibility is set.
|
java.lang.Boolean |
getTypeHintsEnabled()
Whether type hints is enabled.
|
java.lang.String |
objectName()
Get the object name, or default value if null.
|
protected abstract net.sf.json.JSON |
parse(java.lang.String input)
Parse the string to JSON.
|
void |
setArrayName(java.lang.String arrayName)
Set the array name.
|
void |
setElementName(java.lang.String elementName)
Set the element name.
|
void |
setForceTopLevelObject(java.lang.Boolean forceTopLevelObject)
Set whether to force top level object.
|
void |
setObjectName(java.lang.String objectName)
Set the object name.
|
void |
setRootName(java.lang.String rootName)
Set the root name.
|
void |
setSkipWhitespace(java.lang.Boolean skipWhitespace)
Set whether to skip whitespace.
|
void |
setTrimSpaces(java.lang.Boolean trimSpaces)
Set whether to trim whitespace.
|
void |
setTypeHintsCompatibility(java.lang.Boolean typeHintsCompatibility)
Set whether type hints compatibility is enabled.
|
void |
setTypeHintsEnabled(java.lang.Boolean typeHintsEnabled)
Set whether type hints is enabled.
|
java.lang.String |
transform(java.lang.String input,
TransformationDirection direction)
Perform transformation.
|
protected java.lang.String |
xmlToJSON(java.lang.String input)
Convert XML to JSON.
|
public java.lang.String transform(java.lang.String input, TransformationDirection direction) throws ServiceException
transform
in interface TransformationDriver
input
- The data to transform.direction
- The direction of the transformation.ServiceException
- Thrown if there is a problem with the transformation.protected java.lang.String xmlToJSON(java.lang.String input) throws ServiceException
input
- The XML to convert.ServiceException
- Thrown if there was a problem converting from XML to JSON.protected abstract net.sf.json.JSON parse(java.lang.String input) throws net.sf.json.JSONException
input
- The string to parse.net.sf.json.JSONException
- Thrown if the string could not be parsed to JSON.public java.lang.String getArrayName()
public void setArrayName(java.lang.String arrayName)
arrayName
- The array name.public java.lang.String getElementName()
public void setElementName(java.lang.String elementName)
elementName
- The element name.public java.lang.String getObjectName()
public java.lang.String objectName()
public void setObjectName(java.lang.String objectName)
objectName
- The object name.public java.lang.String getRootName()
public void setRootName(java.lang.String rootName)
rootName
- The root name.public java.lang.Boolean getForceTopLevelObject()
public void setForceTopLevelObject(java.lang.Boolean forceTopLevelObject)
forceTopLevelObject
- Whether to force top level object.public java.lang.Boolean getSkipWhitespace()
public void setSkipWhitespace(java.lang.Boolean skipWhitespace)
skipWhitespace
- Whether to skip whitespace.public java.lang.Boolean getTrimSpaces()
public void setTrimSpaces(java.lang.Boolean trimSpaces)
trimSpaces
- Whether to trim whitespace.public java.lang.Boolean getTypeHintsCompatibility()
public void setTypeHintsCompatibility(java.lang.Boolean typeHintsCompatibility)
typeHintsCompatibility
- Whether type hints compatibility is enabled.public java.lang.Boolean getTypeHintsEnabled()
public void setTypeHintsEnabled(java.lang.Boolean typeHintsEnabled)
typeHintsEnabled
- Whether type hints is enabled.