org.apache.synapse.mediators.bsf

## Class NashornJavaScriptXmlHelper

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

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

  This class will provide the operations to convert between xml elements of scripts and OMElements.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NashornJavaScriptXmlHelper()`

  - ### Method Summary

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

    - ### 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`

- - ### Constructor Detail

    - #### NashornJavaScriptXmlHelper

          public NashornJavaScriptXmlHelper()

  - ### Method Detail

    - #### toOMElement

          public org.apache.axiom.om.OMElement toOMElement(java.lang.Object scriptXML)
                                                    throws javax.script.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
      Returns:
        XML content as OMElement
      Throws:
        `javax.script.ScriptException` - when error

    - #### toScriptXML

          public java.lang.Object toScriptXML(org.apache.axiom.om.OMElement omElement)
                                       throws javax.script.ScriptException

      This method will convert the message payload in to xml string.
      Overrides:
        `toScriptXML` in class `org.apache.bsf.xml.DefaultXMLHelper`
      Parameters:
        `omElement` - axiom element representation of xml document
      Returns:
        xml string by adding the xml content
      Throws:
        `javax.script.ScriptException` - when error

Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.