org.mule.transformers.xml
Class JXPathExtractor
java.lang.Object
org.mule.transformers.AbstractTransformer
org.mule.transformers.xml.JXPathExtractor
- All Implemented Interfaces:
- Cloneable, Initialisable, UMOBaseTransformer, UMOTransformer
public class JXPathExtractor
- extends AbstractTransformer
The JXPathExtractor is a simple transformer that evaluates an xpath expression
against the given bean and that returns the result.
By default, a single
result will be returned. If multiple values are expected, set the
singleResult
property to false
. In this case a
List
of values will be returned. Note the property is currently ignored
for non-String/XML payloads.
Methods inherited from class org.mule.transformers.AbstractTransformer |
checkReturnClass, clone, generateTransformerName, getEndpoint, getFinalReturnClass, getName, getNextTransformer, getReturnClass, initialise, isAcceptNull, isIgnoreBadInput, isSourceTypeSupported, isSourceTypeSupported, nextTransform, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setNextTransformer, setReturnClass, toString, transform, unregisterSourceType |
JXPathExtractor
public JXPathExtractor()
doTransform
public Object doTransform(Object src,
String encoding)
throws TransformerException
- Evaluate the expression in the context of the given object and returns the
result. If the given object is a string, it assumes it is an valid xml and
parses it before evaluating the xpath expression.
- Specified by:
doTransform
in class AbstractTransformer
- Throws:
TransformerException
getExpression
public String getExpression()
- Returns:
- Returns the expression.
setExpression
public void setExpression(String expression)
- Parameters:
expression
- The expression to set.
isSingleResult
public boolean isSingleResult()
- Should a single value be returned.
- Returns:
- value
setSingleResult
public void setSingleResult(boolean singleResult)
- If multiple results are expected from the
expression
evaluation, set
this to false.
- Parameters:
singleResult
- flag
Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.