Class SourceXPathSupport


  • public class SourceXPathSupport
    extends Object
    Support class for mediators operating on message parts selected by an XPath expression. It handles the default XPath expression s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1] without actually parsing or evaluating it.
    • Constructor Detail

      • SourceXPathSupport

        public SourceXPathSupport()
    • Method Detail

      • getXPath

        public SynapseXPath getXPath()
        Get the XPath expression.
        Returns:
        the XPath expression
      • setXPath

        public void setXPath​(SynapseXPath xpath)
        Set the XPath expression.
        Parameters:
        xpath - the XPath expression
      • setXPathString

        public void setXPathString​(String xpathString)
        Set the string representation of the XPath expression. Note that this information is not mandatory and only used for debugging purposes. Setting the string representation explicitly may be useful to make sure that debugging messages contain the XPath expression in the exact form as specified by the user.
        Parameters:
        xpathString - a string representation of the XPath expression
      • selectOMNode

        public org.apache.axiom.om.OMNode selectOMNode​(MessageContext synCtx,
                                                       SynapseLog synLog)
        Get the first node selected by the configured XPath expression. If no XPath expression is set, the first child element of the SOAP body is returned, i.e. in this case the method behaves as if the XPath expression is s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1].
        Parameters:
        synCtx - the message context
        synLog -
        Returns:
        the first node selected by the XPath expression
        Throws:
        SynapseException - if the evaluation of the XPath expression failed or didn't result in an OMNode
      • toString

        public String toString()
        Get a string representation of the XPath expression for debugging purposes.
        Overrides:
        toString in class Object