org.apache.synapse.mediators.bsf

## Class JavaScriptXmlHelper

- java.lang.Object
- - org.apache.bsf.xml.XMLHelper
  - - org.apache.bsf.xml.DefaultXMLHelper
    - - org.apache.synapse.mediators.bsf.JavaScriptXmlHelper

-     public class JavaScriptXmlHelper
      extends org.apache.bsf.xml.DefaultXMLHelper

  This class will provide the operation to getPayloadXML and setPayload of CommonScriptMessageContext to convert between XML and ScriptXML object since there is an api change in rhino17,This class is provided instead of getting Helper class by XMLHelper.getArgHelper(engine) in bsf

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.axiom.om.OMElement` | `toOMElement(Object scriptXML)` This method will convert the message payload in to xml
    `Object` | `toScriptXML(org.apache.axiom.om.OMElement omElement)` This method will convert the message payload in to ScriptXML Object

    - ### Methods inherited from class org.apache.bsf.xml.DefaultXMLHelper

      `toDOMNode, toScriptXML, toScriptXML, toXMLStreamReader`

    - ### Methods inherited from class org.apache.bsf.xml.XMLHelper

      `getArgHelper, init`

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

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

- - ### Method Detail

    - #### toOMElement

          public org.apache.axiom.om.OMElement toOMElement(Object scriptXML)
                                                    throws ScriptException

      This method will convert the message payload in to xml
      Overrides:
        `toOMElement` in class `org.apache.bsf.xml.DefaultXMLHelper`
      Parameters:
        `scriptXML` - from java script Scriptable
      Returns:
        XML content as OMElement wrapped in Scriptable object
      Throws:
        `ScriptException` - when error

    - #### toScriptXML

          public Object toScriptXML(org.apache.axiom.om.OMElement omElement)
                             throws ScriptException

      This method will convert the message payload in to ScriptXML Object
      Overrides:
        `toScriptXML` in class `org.apache.bsf.xml.DefaultXMLHelper`
      Parameters:
        `omElement` -
      Returns:
        Scriptable object by adding the xml content
      Throws:
        `ScriptException` - when error

Copyright © 2005–2018 Apache Software Foundation. All rights reserved.