public class XMLInputReader extends Object implements InputReader
Constructor and Description |
---|
XMLInputReader()
Constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getAttributeQName(org.apache.axiom.om.OMNamespace omNamespace,
String localName) |
String |
getAttributeQName(org.apache.axiom.om.OMNamespace omNamespace,
String localName,
Map jsonSchemaMap)
This function will resolve prefix for given URI depending on the provided traversal level given by jsonSchemaMap
|
Schema |
getInputSchema() |
void |
read(InputStream input,
Schema inputSchema,
InputBuilder messageBuilder)
Read, parse the XML and notify with the output JSON message
|
String |
xmlTraverse(org.apache.axiom.om.OMElement omElement,
String prevElementName,
Map jsonSchemaMap)
This method will perform a Depth First Search on the XML message and build the json message
|
public XMLInputReader() throws IOException
IOException
public void read(InputStream input, Schema inputSchema, InputBuilder messageBuilder) throws ReaderException
read
in interface InputReader
input
- XML message InputStreaminputSchema
- Schema of the input messagemessageBuilder
- Reference of the InputXMLMessageBuilderReaderException
- Exceptions in the parsing stagepublic String xmlTraverse(org.apache.axiom.om.OMElement omElement, String prevElementName, Map jsonSchemaMap) throws IOException, ReaderException, SchemaException, JSException, InvalidPayloadException
omElement
- initially the root element will be passed-inprevElementName
- name of the previous element only if the previous element was an array, a null otherwisejsonSchemaMap
- reduced json input schema map that is applicable to this levelIOException
ReaderException
SchemaException
JSException
InvalidPayloadException
public String getAttributeQName(org.apache.axiom.om.OMNamespace omNamespace, String localName)
public String getAttributeQName(org.apache.axiom.om.OMNamespace omNamespace, String localName, Map jsonSchemaMap) throws SchemaException
omNamespace
- localName
- jsonSchemaMap
- SchemaException
public Schema getInputSchema()
Copyright © 2021 WSO2. All rights reserved.