org.apache.synapse.commons.json

## Class JsonFormatter

- java.lang.Object
- - org.apache.synapse.commons.json.JsonFormatter

- All Implemented Interfaces:
    org.apache.axis2.transport.MessageFormatter

      public final class JsonFormatter
      extends java.lang.Object
      implements org.apache.axis2.transport.MessageFormatter

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JsonFormatter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `formatSOAPAction(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat omOutputFormat, java.lang.String s)`
    `byte[]` | `getBytes(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat omOutputFormat)`
    `java.lang.String` | `getContentType(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, java.lang.String soapActionString)`
    `java.net.URL` | `getTargetAddress(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat omOutputFormat, java.net.URL url)`
    `static void` | `toJson(org.apache.axiom.om.OMElement element, java.io.OutputStream outputStream)` Deprecated. Use `JsonUtil.writeAsJson(org.apache.axiom.om.OMElement, java.io.OutputStream)`
    `void` | `writeTo(org.apache.axis2.context.MessageContext messageContext, org.apache.axiom.om.OMOutputFormat omOutputFormat, java.io.OutputStream outputStream, boolean preserve)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JsonFormatter

          public JsonFormatter()

  - ### Method Detail

    - #### getBytes

          public byte[] getBytes(org.apache.axis2.context.MessageContext messageContext,
                                 org.apache.axiom.om.OMOutputFormat omOutputFormat)
                          throws org.apache.axis2.AxisFault

      Specified by:
        `getBytes` in interface `org.apache.axis2.transport.MessageFormatter`
      Throws:
        `org.apache.axis2.AxisFault`

    - #### writeTo

          public void writeTo(org.apache.axis2.context.MessageContext messageContext,
                              org.apache.axiom.om.OMOutputFormat omOutputFormat,
                              java.io.OutputStream outputStream,
                              boolean preserve)
                       throws org.apache.axis2.AxisFault

      Specified by:
        `writeTo` in interface `org.apache.axis2.transport.MessageFormatter`
      Throws:
        `org.apache.axis2.AxisFault`

    - #### toJson

          public static void toJson(org.apache.axiom.om.OMElement element,
                                    java.io.OutputStream outputStream)
                             throws org.apache.axis2.AxisFault

      Deprecated. Use `JsonUtil.writeAsJson(org.apache.axiom.om.OMElement, java.io.OutputStream)`
      Parameters:
        `element` - XML element
        `outputStream` - Output Stream to write the converted JSON representation.
      Throws:
        `org.apache.axis2.AxisFault`

    - #### getContentType

          public java.lang.String getContentType(org.apache.axis2.context.MessageContext messageContext,
                                                 org.apache.axiom.om.OMOutputFormat format,
                                                 java.lang.String soapActionString)

      Specified by:
        `getContentType` in interface `org.apache.axis2.transport.MessageFormatter`

    - #### getTargetAddress

          public java.net.URL getTargetAddress(org.apache.axis2.context.MessageContext messageContext,
                                               org.apache.axiom.om.OMOutputFormat omOutputFormat,
                                               java.net.URL url)
                                        throws org.apache.axis2.AxisFault

      Specified by:
        `getTargetAddress` in interface `org.apache.axis2.transport.MessageFormatter`
      Throws:
        `org.apache.axis2.AxisFault`

    - #### formatSOAPAction

          public java.lang.String formatSOAPAction(org.apache.axis2.context.MessageContext messageContext,
                                                   org.apache.axiom.om.OMOutputFormat omOutputFormat,
                                                   java.lang.String s)

      Specified by:
        `formatSOAPAction` in interface `org.apache.axis2.transport.MessageFormatter`

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.