public abstract class AbstractJSONMessageFormatter extends Object implements org.apache.axis2.transport.MessageFormatter
| Constructor and Description |
|---|
AbstractJSONMessageFormatter(Class<? extends AbstractJSONDataSource> dataSourceClass)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
formatSOAPAction(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format,
String soapActionString) |
byte[] |
getBytes(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format)
Gives the JSON message as an array of bytes.
|
String |
getContentType(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format,
String soapActionString) |
protected abstract javax.xml.stream.XMLStreamWriter |
getJSONWriter(Writer writer,
org.apache.axis2.context.MessageContext messageContext) |
URL |
getTargetAddress(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format,
URL targetURL) |
void |
writeTo(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format,
OutputStream out,
boolean preserve)
Writes the JSON message to the output stream with the correct convention.
|
public AbstractJSONMessageFormatter(Class<? extends AbstractJSONDataSource> dataSourceClass)
dataSourceClass - the OMDataSource class corresponding to the JSON format used by this
message formatter; this information is used for optimization (pass through)public String getContentType(org.apache.axis2.context.MessageContext msgCtxt, org.apache.axiom.om.OMOutputFormat format, String soapActionString)
getContentType in interface org.apache.axis2.transport.MessageFormatterpublic byte[] getBytes(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format)
throws org.apache.axis2.AxisFault
getBytes in interface org.apache.axis2.transport.MessageFormattermsgCtxt - Message context which contains the soap envelope to be writtenformat - format of the message, this is ignoredorg.apache.axis2.AxisFault - if there is an error in writing the message using StAX writer or IF THE
USER TRIES TO SEND A JSON MESSAGE WITH NAMESPACES USING THE "MAPPED"
CONVENTION.public String formatSOAPAction(org.apache.axis2.context.MessageContext msgCtxt, org.apache.axiom.om.OMOutputFormat format, String soapActionString)
formatSOAPAction in interface org.apache.axis2.transport.MessageFormatterprotected abstract javax.xml.stream.XMLStreamWriter getJSONWriter(Writer writer, org.apache.axis2.context.MessageContext messageContext) throws javax.xml.stream.XMLStreamException
public void writeTo(org.apache.axis2.context.MessageContext msgCtxt,
org.apache.axiom.om.OMOutputFormat format,
OutputStream out,
boolean preserve)
throws org.apache.axis2.AxisFault
writeTo in interface org.apache.axis2.transport.MessageFormattermsgCtxt - Message context which contains the soap envelope to be writtenformat - format of the message, this is ignoredout - output stream to be written in topreserve - ignoredorg.apache.axis2.AxisFault - if there is an error in writing the message using StAX writer or IF THE
USER TRIES TO SEND A JSON MESSAGE WITH NAMESPACES USING THE "MAPPED"
CONVENTION.public URL getTargetAddress(org.apache.axis2.context.MessageContext msgCtxt, org.apache.axiom.om.OMOutputFormat format, URL targetURL) throws org.apache.axis2.AxisFault
getTargetAddress in interface org.apache.axis2.transport.MessageFormatterorg.apache.axis2.AxisFaultCopyright © 2004–2016 The Apache Software Foundation. All rights reserved.