Package org.apache.axis2.json.gson
Class JsonFormatter
- java.lang.Object
-
- org.apache.axis2.json.gson.JsonFormatter
-
- All Implemented Interfaces:
MessageFormatter
public class JsonFormatter extends Object implements MessageFormatter
-
-
Constructor Summary
Constructors Constructor Description JsonFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringformatSOAPAction(MessageContext messageContext, OMOutputFormat omOutputFormat, String s)StringgetContentType(MessageContext outMsgCtxt, OMOutputFormat omOutputFormat, String s)Different message formats can set their own content types Eg: JSONFormatter can set the content type as application/jsonURLgetTargetAddress(MessageContext messageContext, OMOutputFormat omOutputFormat, URL url)Some message formats may want to alter the target url.voidwriteTo(MessageContext outMsgCtxt, OMOutputFormat omOutputFormat, OutputStream outputStream, boolean preserve)To support deffered writing transports as in http chunking..
-
-
-
Method Detail
-
writeTo
public void writeTo(MessageContext outMsgCtxt, OMOutputFormat omOutputFormat, OutputStream outputStream, boolean preserve) throws AxisFault
Description copied from interface:MessageFormatterTo support deffered writing transports as in http chunking.. Axis2 was doing this for some time.. Preserve flag can be used to preserve the envelope for later use. This is usefull when implementing authentication machnisms like NTLM.- Specified by:
writeToin interfaceMessageFormatterpreserve- : do not consume the OM when this is set..- Throws:
AxisFault
-
getContentType
public String getContentType(MessageContext outMsgCtxt, OMOutputFormat omOutputFormat, String s)
Description copied from interface:MessageFormatterDifferent message formats can set their own content types Eg: JSONFormatter can set the content type as application/json- Specified by:
getContentTypein interfaceMessageFormatter
-
getTargetAddress
public URL getTargetAddress(MessageContext messageContext, OMOutputFormat omOutputFormat, URL url) throws AxisFault
Description copied from interface:MessageFormatterSome message formats may want to alter the target url.- Specified by:
getTargetAddressin interfaceMessageFormatter- Returns:
- the target URL
- Throws:
AxisFault
-
formatSOAPAction
public String formatSOAPAction(MessageContext messageContext, OMOutputFormat omOutputFormat, String s)
- Specified by:
formatSOAPActionin interfaceMessageFormatter- Returns:
- this only if you want set a transport header for SOAP Action
-
-