Package org.apache.axis2.json
Class AbstractJSONOMBuilder
java.lang.Object
org.apache.axis2.json.AbstractJSONOMBuilder
- All Implemented Interfaces:
Builder
- Direct Known Subclasses:
JSONBadgerfishOMBuilder,JSONOMBuilder
Makes the OMSourcedElementImpl object with the JSONDataSource inside.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractJSONDataSourcegetDataSource(Reader jsonReader, String prefix, String localName) abstract StringgetDefaultJSONString(MessageContext msgCtx, String localName) This method returns a default JSON string whenever a GET request, which doesn't contain any parameter, is served.org.apache.axiom.om.OMElementprocessDocument(InputStream inputStream, String contentType, MessageContext messageContext) gives the OMSourcedElementImpl using the incoming JSON stream
-
Constructor Details
-
AbstractJSONOMBuilder
public AbstractJSONOMBuilder()
-
-
Method Details
-
processDocument
public org.apache.axiom.om.OMElement processDocument(InputStream inputStream, String contentType, MessageContext messageContext) throws AxisFault gives the OMSourcedElementImpl using the incoming JSON stream- Specified by:
processDocumentin interfaceBuilder- Parameters:
inputStream- - incoming message as an input streamcontentType- - content type of the message (eg: application/json)messageContext- - inflow message context- Returns:
- OMSourcedElementImpl with JSONDataSource inside
- Throws:
AxisFault
-
getDataSource
protected abstract AbstractJSONDataSource getDataSource(Reader jsonReader, String prefix, String localName) -
getDefaultJSONString
public abstract String getDefaultJSONString(MessageContext msgCtx, String localName) throws AxisFault This method returns a default JSON string whenever a GET request, which doesn't contain any parameter, is served.- Parameters:
msgCtx- MessageContext associated with the current requestlocalName- Name of the first element- Returns:
- Default JSON string compliant with respective JSON To XML mapping type
- Throws:
AxisFault- Is thrown when an unrecognized content type is received
-