Search in sources :

Example 1 with SynapseXpathVariableResolver

use of org.apache.synapse.util.xpath.ext.SynapseXpathVariableResolver in project wso2-synapse by wso2.

the class SynapseConfiguration method initXpathExtensions.

/**
 * This method initializes Xpath Extensions available through synapse.properties file
 * Xpath Extensions can be defined in Variable Context Extensions + Function Context Extensions
 * synapse.xpath.var.extensions --> Variable Extensions
 * synapse.xpath.func.extensions --> Function Extensions
 *
 * @param synapseEnvironment SynapseEnvironment
 */
private void initXpathExtensions(SynapseEnvironment synapseEnvironment) {
    Axis2SynapseEnvironment axis2SynapseEnvironment = (Axis2SynapseEnvironment) synapseEnvironment;
    /*Initialize Function Context extensions for xpath
        */
    List<SynapseXpathFunctionContextProvider> functionExtensions = XpathExtensionUtil.getRegisteredFunctionExtensions();
    for (SynapseXpathFunctionContextProvider functionExtension : functionExtensions) {
        axis2SynapseEnvironment.setXpathFunctionExtensions(functionExtension);
    }
    /*Initialize Variable Context extensions for xpath
        */
    List<SynapseXpathVariableResolver> variableExtensions = XpathExtensionUtil.getRegisteredVariableExtensions();
    for (SynapseXpathVariableResolver variableExtension : variableExtensions) {
        axis2SynapseEnvironment.setXpathVariableExtensions(variableExtension);
    }
}
Also used : Axis2SynapseEnvironment(org.apache.synapse.core.axis2.Axis2SynapseEnvironment) SynapseXpathFunctionContextProvider(org.apache.synapse.util.xpath.ext.SynapseXpathFunctionContextProvider) SynapseXpathVariableResolver(org.apache.synapse.util.xpath.ext.SynapseXpathVariableResolver)

Aggregations

Axis2SynapseEnvironment (org.apache.synapse.core.axis2.Axis2SynapseEnvironment)1 SynapseXpathFunctionContextProvider (org.apache.synapse.util.xpath.ext.SynapseXpathFunctionContextProvider)1 SynapseXpathVariableResolver (org.apache.synapse.util.xpath.ext.SynapseXpathVariableResolver)1