org.mule.module.xml.transformer
Class XQueryTransformer
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.transformer.AbstractMessageTransformer
org.mule.module.xml.transformer.AbstractXmlTransformer
org.mule.module.xml.transformer.XQueryTransformer
- All Implemented Interfaces:
- AnnotatedObject, MuleContextAware, Disposable, Initialisable, NameableObject, NamedObject, MessageProcessor, MessageTransformer, Transformer, EndpointAware
public class XQueryTransformer
- extends AbstractXmlTransformer
- implements Disposable
The XQuery Module gives users the ability to perform XQuery transformations on XML messages in Mule
| Methods inherited from class org.mule.module.xml.transformer.AbstractXmlTransformer |
convertToBytes, convertToText, convertToText, getOutputEncoding, getResultHolder, getXMLInputFactory, getXMLOutputFactory, isUseStaxSource, setOutputEncoding, setUseStaxSource, setXMLInputFactory, setXMLOutputFactory, writeToStream |
| Methods inherited from class org.mule.transformer.AbstractTransformer |
generateTransformerName, getAnnotation, getAnnotations, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setAnnotations, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType |
| Methods inherited from interface org.mule.api.transformer.Transformer |
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform |
SOURCE_DOCUMENT_NAMESPACE
public static final String SOURCE_DOCUMENT_NAMESPACE
- See Also:
- Constant Field Values
transformerPool
protected final org.apache.commons.pool.impl.GenericObjectPool transformerPool
configuration
protected net.sf.saxon.Configuration configuration
XQueryTransformer
public XQueryTransformer()
XQueryTransformer
public XQueryTransformer(String xqueryFile)
initialise
public void initialise()
throws InitialisationException
- Specified by:
initialise in interface Initialisable- Overrides:
initialise in class AbstractTransformer
- Throws:
InitialisationException
dispose
public void dispose()
- Specified by:
dispose in interface Disposable- Overrides:
dispose in class AbstractTransformer
transformMessage
public Object transformMessage(MuleMessage message,
String outputEncoding)
throws TransformerException
- Specified by:
transformMessage in class AbstractMessageTransformer
- Throws:
TransformerException
bindParameters
protected void bindParameters(javax.xml.xquery.XQPreparedExpression transformer,
MuleMessage message)
throws javax.xml.xquery.XQException,
TransformerException
- Throws:
javax.xml.xquery.XQException
TransformerException
unbindParameters
protected void unbindParameters(javax.xml.xquery.XQPreparedExpression transformer)
throws javax.xml.xquery.XQException
- Removes any parameter bindings from the transformer, replacing them with empty strings
- Parameters:
transformer - the transformer to remove properties from
- Throws:
javax.xml.xquery.XQException
bindDocument
protected void bindDocument(Object src,
javax.xml.xquery.XQPreparedExpression transformer)
throws Exception
- Returns the InputSource corresponding to xqueryFile or xquery
- Parameters:
src - transformer -
- Throws:
javax.xml.xquery.XQException
Exception
getConfiguration
public net.sf.saxon.Configuration getConfiguration()
setConfiguration
public void setConfiguration(net.sf.saxon.Configuration configuration)
getXqueryFile
public String getXqueryFile()
- Returns:
- Returns the xqueryFile.
setXqueryFile
public void setXqueryFile(String xqueryFile)
- Parameters:
xqueryFile - The xqueryFile to set.
getXquery
public String getXquery()
setXquery
public void setXquery(String xquery)
getMaxActiveTransformers
public int getMaxActiveTransformers()
- Returns:
- The current maximum number of allowable active transformer objects in
the pool
setMaxActiveTransformers
public void setMaxActiveTransformers(int maxActiveTransformers)
- Sets the the current maximum number of active transformer objects allowed in the
pool
- Parameters:
maxActiveTransformers - New maximum size to set
getMaxIdleTransformers
public int getMaxIdleTransformers()
- Returns:
- The current maximum number of allowable idle transformer objects in the
pool
setMaxIdleTransformers
public void setMaxIdleTransformers(int maxIdleTransformers)
- Sets the the current maximum number of idle transformer objects allowed in the pool
- Parameters:
maxIdleTransformers - New maximum size to set
getContextProperties
public Map<String,Object> getContextProperties()
- Gets the parameters to be used when applying the transformation
- Returns:
- a map of the parameter names and associated values
- See Also:
Transformer.setParameter(java.lang.String,
java.lang.Object)
setContextProperties
public void setContextProperties(Map<String,Object> contextProperties)
- Sets the parameters to be used when applying the transformation
- Parameters:
contextProperties - a map of the parameter names and associated values- See Also:
Transformer.setParameter(java.lang.String,
java.lang.Object)
evaluateTransformParameter
protected Object evaluateTransformParameter(String name,
Object value,
MuleMessage message)
throws TransformerException
Returns the value to be set for the parameter. This method is called for each
parameter before it is set on the transformer. The purpose of this method is to
allow dynamic parameters related to the event (usually message properties) to be
used. Any expression using the Mule expression syntax can be used.
For example: If the current event's message has a property named "myproperty", to
pass this in you would set the transform parameter's value to be
"#[mule.message:header(myproperty)]".
This method may be overloaded by a sub class to provide a different dynamic
parameter implementation.
- Parameters:
name - the name of the parametervalue - the value of the paramter
- Returns:
- the object to be set as the parameter value
- Throws:
TransformerException
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone in class Object
- Throws:
CloneNotSupportedException
Copyright © 2003–2014 MuleSoft, Inc.. All rights reserved.