public abstract class XQueryBuilder extends Object implements org.apache.camel.Expression, org.apache.camel.Predicate, org.apache.camel.spi.NamespaceAware, org.apache.camel.Processor
| Constructor and Description |
|---|
XQueryBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addParameters(net.sf.saxon.query.DynamicQueryContext dynamicQueryContext,
Map<String,Object> map) |
protected void |
addParameters(net.sf.saxon.query.DynamicQueryContext dynamicQueryContext,
Map<String,Object> map,
String parameterPrefix) |
XQueryBuilder |
allowStAX()
Enables to allow using StAX.
|
XQueryBuilder |
asBytes() |
XQueryBuilder |
asBytesSource() |
XQueryBuilder |
asDOM() |
XQueryBuilder |
asDOMSource() |
XQueryBuilder |
asList() |
void |
assertMatches(String text,
org.apache.camel.Exchange exchange)
Deprecated.
|
XQueryBuilder |
asString() |
XQueryBuilder |
asStringSource() |
protected void |
configureQuery(net.sf.saxon.query.DynamicQueryContext dynamicQueryContext,
org.apache.camel.Exchange exchange)
Configures the dynamic context with exchange specific parameters
|
protected net.sf.saxon.query.DynamicQueryContext |
createDynamicContext(org.apache.camel.Exchange exchange)
Creates a dynamic context for the given exchange
|
protected abstract net.sf.saxon.query.XQueryExpression |
createQueryExpression(net.sf.saxon.query.StaticQueryContext staticQueryContext)
A factory method to create the XQuery expression
|
Object |
evaluate(org.apache.camel.Exchange exchange) |
<T> T |
evaluate(org.apache.camel.Exchange exchange,
Class<T> type) |
byte[] |
evaluateAsBytes(org.apache.camel.Exchange exchange) |
Object |
evaluateAsBytesSource(org.apache.camel.Exchange exchange) |
Node |
evaluateAsDOM(org.apache.camel.Exchange exchange) |
List<?> |
evaluateAsList(org.apache.camel.Exchange exchange) |
String |
evaluateAsString(org.apache.camel.Exchange exchange) |
Object |
evaluateAsStringSource(org.apache.camel.Exchange exchange) |
protected net.sf.saxon.om.Item |
getAsParameter(Object value) |
net.sf.saxon.Configuration |
getConfiguration() |
Map<String,Object> |
getConfigurationProperties() |
net.sf.saxon.query.XQueryExpression |
getExpression() |
String |
getHeaderName() |
net.sf.saxon.lib.ModuleURIResolver |
getModuleURIResolver() |
Map<String,String> |
getNamespaces() |
Map<String,Object> |
getParameters() |
Properties |
getProperties() |
ResultFormat |
getResultsFormat() |
Class<?> |
getResultType() |
protected Source |
getSource(org.apache.camel.Exchange exchange,
Object body)
|
net.sf.saxon.query.StaticQueryContext |
getStaticQueryContext() |
void |
init(org.apache.camel.CamelContext context) |
boolean |
isAllowStAX() |
protected boolean |
isInputStreamNeeded(org.apache.camel.Exchange exchange)
Checks whether we need an
InputStream to access the message body. |
boolean |
isStripsAllWhiteSpace() |
boolean |
matches(org.apache.camel.Exchange exchange) |
protected boolean |
matches(org.apache.camel.Exchange exchange,
List<?> results) |
XQueryBuilder |
namespace(String prefix,
String uri) |
XQueryBuilder |
parameter(String name,
Object value) |
void |
process(org.apache.camel.Exchange exchange) |
XQueryBuilder |
resultType(Class<?> resultType) |
void |
setAllowStAX(boolean allowStAX) |
void |
setConfiguration(net.sf.saxon.Configuration configuration) |
void |
setConfigurationProperties(Map<String,Object> configurationProperties) |
void |
setHeaderName(String headerName) |
void |
setModuleURIResolver(net.sf.saxon.lib.ModuleURIResolver moduleURIResolver) |
void |
setNamespaces(Map<String,String> namespaces)
Configures the namespace context from the given DOM element
|
void |
setParameters(Map<String,Object> parameters) |
void |
setProperties(Properties properties) |
void |
setResultsFormat(ResultFormat resultsFormat) |
void |
setResultType(Class<?> resultType) |
void |
setStaticQueryContext(net.sf.saxon.query.StaticQueryContext staticQueryContext) |
void |
setStripsAllWhiteSpace(boolean stripsAllWhiteSpace) |
XQueryBuilder |
stripsAllWhiteSpace() |
XQueryBuilder |
stripsIgnorableWhiteSpace() |
String |
toString() |
static XQueryBuilder |
xquery(InputStream in)
Creates a new
XQueryBuilder to evaluate against the expression loaded from the input stream. |
static XQueryBuilder |
xquery(InputStream in,
String characterSet)
Creates a new
XQueryBuilder to evaluate against the expression loaded from the input stream. |
static XQueryBuilder |
xquery(Reader reader)
Creates a new
XQueryBuilder to evaluate against the expression loaded from the reader. |
static XQueryBuilder |
xquery(String queryText)
Creates a new
XQueryBuilder to evaluate against the expression from the string. |
public void process(org.apache.camel.Exchange exchange)
throws Exception
process in interface org.apache.camel.ProcessorExceptionpublic void init(org.apache.camel.CamelContext context)
init in interface org.apache.camel.Expressioninit in interface org.apache.camel.Predicatepublic <T> T evaluate(org.apache.camel.Exchange exchange,
Class<T> type)
evaluate in interface org.apache.camel.Expressionpublic Object evaluate(org.apache.camel.Exchange exchange)
public List<?> evaluateAsList(org.apache.camel.Exchange exchange) throws Exception
Exceptionpublic Object evaluateAsStringSource(org.apache.camel.Exchange exchange) throws Exception
Exceptionpublic Object evaluateAsBytesSource(org.apache.camel.Exchange exchange) throws Exception
Exceptionpublic Node evaluateAsDOM(org.apache.camel.Exchange exchange) throws Exception
Exceptionpublic byte[] evaluateAsBytes(org.apache.camel.Exchange exchange)
throws Exception
Exceptionpublic String evaluateAsString(org.apache.camel.Exchange exchange) throws Exception
Exceptionpublic boolean matches(org.apache.camel.Exchange exchange)
matches in interface org.apache.camel.Predicate@Deprecated public void assertMatches(String text, org.apache.camel.Exchange exchange) throws AssertionError
AssertionErrorpublic static XQueryBuilder xquery(String queryText)
XQueryBuilder to evaluate against the expression from the string.
Important: The builder must be initialized before use.public static XQueryBuilder xquery(Reader reader)
XQueryBuilder to evaluate against the expression loaded from the reader.
Important: The builder must be initialized before use.public static XQueryBuilder xquery(InputStream in, String characterSet)
XQueryBuilder to evaluate against the expression loaded from the input stream.
Important: The builder must be initialized before use.public static XQueryBuilder xquery(InputStream in)
XQueryBuilder to evaluate against the expression loaded from the input stream.
Important: The builder must be initialized before use.public XQueryBuilder parameter(String name, Object value)
public XQueryBuilder namespace(String prefix, String uri)
public XQueryBuilder resultType(Class<?> resultType)
public XQueryBuilder asBytes()
public XQueryBuilder asBytesSource()
public XQueryBuilder asDOM()
public XQueryBuilder asDOMSource()
public XQueryBuilder asList()
public XQueryBuilder asString()
public XQueryBuilder asStringSource()
public XQueryBuilder stripsAllWhiteSpace()
public XQueryBuilder stripsIgnorableWhiteSpace()
public XQueryBuilder allowStAX()
Source.public void setNamespaces(Map<String,String> namespaces)
setNamespaces in interface org.apache.camel.spi.NamespaceAwarepublic Map<String,String> getNamespaces()
getNamespaces in interface org.apache.camel.spi.NamespaceAwarepublic net.sf.saxon.query.XQueryExpression getExpression()
throws IOException,
net.sf.saxon.trans.XPathException
IOExceptionnet.sf.saxon.trans.XPathExceptionpublic net.sf.saxon.Configuration getConfiguration()
public void setConfiguration(net.sf.saxon.Configuration configuration)
public void setConfigurationProperties(Map<String,Object> configurationProperties)
public net.sf.saxon.query.StaticQueryContext getStaticQueryContext()
public void setStaticQueryContext(net.sf.saxon.query.StaticQueryContext staticQueryContext)
public Properties getProperties()
public void setProperties(Properties properties)
public ResultFormat getResultsFormat()
public void setResultsFormat(ResultFormat resultsFormat)
public Class<?> getResultType()
public void setResultType(Class<?> resultType)
public net.sf.saxon.lib.ModuleURIResolver getModuleURIResolver()
public void setModuleURIResolver(net.sf.saxon.lib.ModuleURIResolver moduleURIResolver)
public boolean isStripsAllWhiteSpace()
public void setStripsAllWhiteSpace(boolean stripsAllWhiteSpace)
public String getHeaderName()
public void setHeaderName(String headerName)
public boolean isAllowStAX()
public void setAllowStAX(boolean allowStAX)
protected abstract net.sf.saxon.query.XQueryExpression createQueryExpression(net.sf.saxon.query.StaticQueryContext staticQueryContext)
throws net.sf.saxon.trans.XPathException,
IOException
net.sf.saxon.trans.XPathExceptionIOExceptionprotected net.sf.saxon.query.DynamicQueryContext createDynamicContext(org.apache.camel.Exchange exchange)
throws Exception
Exceptionprotected boolean isInputStreamNeeded(org.apache.camel.Exchange exchange)
InputStream to access the message body.
Depending on the content in the message body, we may not need to convert to InputStream.exchange - the current exchangeInputStream beforehand converting to Source
afterwards.protected void configureQuery(net.sf.saxon.query.DynamicQueryContext dynamicQueryContext,
org.apache.camel.Exchange exchange)
throws Exception
Exceptionprotected void addParameters(net.sf.saxon.query.DynamicQueryContext dynamicQueryContext,
Map<String,Object> map)
protected void addParameters(net.sf.saxon.query.DynamicQueryContext dynamicQueryContext,
Map<String,Object> map,
String parameterPrefix)
protected net.sf.saxon.om.Item getAsParameter(Object value)
protected boolean matches(org.apache.camel.Exchange exchange,
List<?> results)
Apache Camel