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 GenericObjectPool transformerPool
configuration
protected net.sf.saxon.Configuration configuration
XQueryTransformer
public XQueryTransformer()
XQueryTransformer
public XQueryTransformer(String xqueryFile)
initialise
public void initialise()
throws InitialisationException
- Description copied from class:
AbstractTransformer
- Template method where deriving classes can do any initialisation after the
properties have been set on this transformer
- Specified by:
initialise
in interface Initialisable
- Overrides:
initialise
in class AbstractTransformer
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
dispose
public void dispose()
- Description copied from class:
AbstractTransformer
- Template method where deriving classes can do any clean up any resources or state
before the object is disposed.
- Specified by:
dispose
in interface Disposable
- Overrides:
dispose
in class AbstractTransformer
transformMessage
public Object transformMessage(MuleMessage message,
String outputEncoding)
throws TransformerException
- Description copied from class:
AbstractMessageTransformer
- Transform the message
- Specified by:
transformMessage
in class AbstractMessageTransformer
- Throws:
TransformerException
bindParameters
protected void bindParameters(net.sf.saxon.javax.xml.xquery.XQPreparedExpression transformer,
MuleMessage message)
throws net.sf.saxon.javax.xml.xquery.XQException,
TransformerException
- Throws:
net.sf.saxon.javax.xml.xquery.XQException
TransformerException
bindDocument
protected void bindDocument(Object src,
net.sf.saxon.javax.xml.xquery.XQPreparedExpression transformer)
throws Exception
- Returns the InputSource corresponding to xqueryFile or xquery
- Parameters:
src
- transformer
-
- Throws:
net.sf.saxon.javax.xml.xquery.XQException
org.mule.umo.transformer.TransformerException
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)
getCommonHandler
public net.sf.saxon.javax.xml.xquery.XQCommonHandler getCommonHandler()
setCommonHandler
public void setCommonHandler(net.sf.saxon.javax.xml.xquery.XQCommonHandler commonHandler)
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 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 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-2012 MuleSoft, Inc.. All Rights Reserved.