Class JsonTransformationDriverImpl

    • Constructor Detail

      • JsonTransformationDriverImpl

        public JsonTransformationDriverImpl()
    • Method Detail

      • transform

        public java.lang.String transform​(java.lang.String input,
                                          TransformationDirection direction)
                                   throws ServiceException
        Perform transformation..
        Specified by:
        transform in interface TransformationDriver
        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

        protected java.lang.String xmlToJSON​(java.lang.String input)
                                      throws ServiceException
        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

        protected abstract net.sf.json.JSON parse​(java.lang.String input)
                                           throws net.sf.json.JSONException
        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

        public java.lang.String getArrayName()
        Get the array name.
        Returns:
        The array name.
      • setArrayName

        public void setArrayName​(java.lang.String arrayName)
        Set the array name.
        Parameters:
        arrayName - The array name.
      • getElementName

        public java.lang.String getElementName()
        Get the element name.
        Returns:
        The element name.
      • setElementName

        public void setElementName​(java.lang.String elementName)
        Set the element name.
        Parameters:
        elementName - The element name.
      • getObjectName

        public java.lang.String getObjectName()
        Get the object name.
        Returns:
        The object name.
      • objectName

        public java.lang.String objectName()
        Get the object name, or default value if null.
        Returns:
        The object name, or default value.
      • setObjectName

        public void setObjectName​(java.lang.String objectName)
        Set the object name.
        Parameters:
        objectName - The object name.
      • getRootName

        public java.lang.String getRootName()
        Get the root name.
        Returns:
        The root name.
      • setRootName

        public void setRootName​(java.lang.String rootName)
        Set the root name.
        Parameters:
        rootName - The root name.
      • getForceTopLevelObject

        public java.lang.Boolean 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

        public void setForceTopLevelObject​(java.lang.Boolean forceTopLevelObject)
        Set whether to force top level object.
        Parameters:
        forceTopLevelObject - Whether to force top level object.
      • getSkipWhitespace

        public java.lang.Boolean 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

        public void setSkipWhitespace​(java.lang.Boolean skipWhitespace)
        Set whether to skip whitespace.
        Parameters:
        skipWhitespace - Whether to skip whitespace.
      • getTrimSpaces

        public java.lang.Boolean 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

        public void setTrimSpaces​(java.lang.Boolean trimSpaces)
        Set whether to trim whitespace.
        Parameters:
        trimSpaces - Whether to trim whitespace.
      • getTypeHintsCompatibility

        public java.lang.Boolean 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

        public void setTypeHintsCompatibility​(java.lang.Boolean typeHintsCompatibility)
        Set whether type hints compatibility is enabled.
        Parameters:
        typeHintsCompatibility - Whether type hints compatibility is enabled.
      • getTypeHintsEnabled

        public java.lang.Boolean 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

        public void setTypeHintsEnabled​(java.lang.Boolean typeHintsEnabled)
        Set whether type hints is enabled.
        Parameters:
        typeHintsEnabled - Whether type hints is enabled.