public class JdbcXPathParameter extends NullableParameter
When this implementation is used for an IN parameter, then an xpath expression will be evaluated from the
AdaptrisMessage
payload and used as the parameter value. You will simply set xpath to a valid xpath
expression to retrieve data from the AdaptrisMessage
payload.
Additionally you will set one or both of "name" and/or "order". "name" will map this parameter to a Stored Procedure parameter
using the Stored Procedures method signature. "order" will map this parameter according to the parameter number using the Stored
Procedures method signature. Note that the "order" starts from 1 and not 0, so the first parameter would be order 1. You will
also need to set the data type of the parameter; you may use any of the string types defined in
ParameterValueType
If the DocumentBuilderFactoryBuilder
has been explicitly set to be not namespace aware and the document does in fact
contain namespaces, then Saxon can cause merry havoc in the sense that //NonNamespaceXpath
doesn't work if the document
has namespaces in it. We have included a shim so that behaviour can be toggled based on what you have configured.
XPath.newXPathInstance(DocumentBuilderFactoryBuilder, NamespaceContext)
In the adapter configuration file this class is aliased as jdbc-xpath-parameter which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
JdbcXPathParameter() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
applyInputParam(AdaptrisMessage msg) |
void |
applyOutputParam(java.lang.Object dbValue,
AdaptrisMessage msg) |
KeyValuePairSet |
getNamespaceContext() |
DocumentBuilderFactoryBuilder |
getXmlDocumentFactoryConfig() |
java.lang.String |
getXpath() |
void |
setNamespaceContext(KeyValuePairSet kvps)
Set the namespace context for resolving namespaces.
|
void |
setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml) |
void |
setXpath(java.lang.String xpath) |
getNullConverter, normalize, setNullConverter
public java.lang.Object applyInputParam(AdaptrisMessage msg) throws JdbcParameterException
JdbcParameterException
public void applyOutputParam(java.lang.Object dbValue, AdaptrisMessage msg) throws JdbcParameterException
JdbcParameterException
public java.lang.String getXpath()
public void setXpath(java.lang.String xpath)
public KeyValuePairSet getNamespaceContext()
public void setNamespaceContext(KeyValuePairSet kvps)
kvps
- the namespace contextSimpleNamespaceContext.create(KeyValuePairSet)
public DocumentBuilderFactoryBuilder getXmlDocumentFactoryConfig()
public void setXmlDocumentFactoryConfig(DocumentBuilderFactoryBuilder xml)