org.mule.module.xml.expression
Class JaxpXPathExpressionEvaluator

java.lang.Object
  extended by org.mule.module.xml.expression.JaxpXPathExpressionEvaluator
All Implemented Interfaces:
MuleContextAware, ExpressionEvaluator, Disposable, Initialisable, NamedObject

public class JaxpXPathExpressionEvaluator
extends Object
implements ExpressionEvaluator, Initialisable, Disposable, MuleContextAware

Uses JAXP XPath processing to evaluate xpath expressions against Xml fragments and documents

Note that the JAXP Expression evaluator differs from the Mule XPATH evaluator slightly since you can set the JAXP return type as a prefix to the expression i.e. xpath2:[type]/foo/bar

Where the type can either be boolean, string, number, node or nodeset.


Field Summary
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
JaxpXPathExpressionEvaluator()
           
 
Method Summary
protected  XPathExpression createXPath(String expression)
           
 void dispose()
          A lifecycle method where implementor should free up any resources.
 Object evaluate(String expression, MuleMessage message)
          
 MuleContext getMuleContext()
           
 String getName()
           
 NamespaceManager getNamespaceManager()
           
 QName getReturnType()
           
protected  XPathExpression getXPath(String expression)
           
 void initialise()
           
 void setMuleContext(MuleContext context)
           
 void setNamespaceManager(NamespaceManager namespaceManager)
           
 void setReturnType(QName returnType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxpXPathExpressionEvaluator

public JaxpXPathExpressionEvaluator()
Method Detail

getName

public String getName()
Specified by:
getName in interface NamedObject

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware

initialise

public void initialise()
                throws InitialisationException
Specified by:
initialise in interface Initialisable
Throws:
InitialisationException

evaluate

public Object evaluate(String expression,
                       MuleMessage message)

Specified by:
evaluate in interface ExpressionEvaluator

getXPath

protected XPathExpression getXPath(String expression)
                            throws XPathExpressionException
Throws:
XPathExpressionException

createXPath

protected XPathExpression createXPath(String expression)
                               throws XPathExpressionException
Throws:
XPathExpressionException

dispose

public void dispose()
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

getNamespaceManager

public NamespaceManager getNamespaceManager()

setNamespaceManager

public void setNamespaceManager(NamespaceManager namespaceManager)

getMuleContext

public MuleContext getMuleContext()

getReturnType

public QName getReturnType()

setReturnType

public void setReturnType(QName returnType)


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.