Class XpathMetadataService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,MessageEventGenerator
,Service
,StateManagedComponent
XpathQuery
as metadata.
This service will support XPath 2.0+ features, but in order to use XPath 2.0 features you must
use Saxon as your XPath provider. This means either explicitly removing all
DocumentBuilderFactoryBuilder
configuration, or ensuring that namespace-aware
is
set to 'true' in the DocumentBuilderFactoryBuilder
configuration.
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.
- See Also:
In the adapter configuration file this class is aliased as xpath-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
MetadataServiceImpl.LogWrapper
-
Field Summary
Fields inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
DEBUG, ERROR, INFO, TRACE, WARN
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addXpathQuery
(XpathQuery query) void
doService
(AdaptrisMessage msg) Apply the service to the message.protected void
void
setNamespaceContext
(KeyValuePairSet namespaceContext) Set the namespace context for resolving namespaces.void
void
setXpathQueries
(List<XpathQuery> xql) Set the list of XpathQuery instances that will be executed.Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, logMetadata, logMetadata, logMetadata, logMetadata, prepare, setMetadataLogger, withMetadataLogger
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Constructor Details
-
XpathMetadataService
public XpathMetadataService()Creates a new instance.
-
-
Method Details
-
initService
- Overrides:
initService
in classMetadataServiceImpl
- Throws:
CoreException
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
getNamespaceContext
-
setNamespaceContext
Set the namespace context for resolving namespaces.- The key is the namespace prefix
- The value is the namespace uri
- Parameters:
namespaceContext
-
-
getXpathQueries
-
setXpathQueries
Set the list of XpathQuery instances that will be executed.- Parameters:
xql
-
-
addXpathQuery
-
getXmlDocumentFactoryConfig
-
setXmlDocumentFactoryConfig
-