Class XMLContentFilterInterceptor
- All Implemented Interfaces:
Interceptor
- Description
The xmlContentFilter removes certain XML elements from message bodies. The elements are described using an XPath expression.
- Explanation
If the XPath expression is simple enough, a StAX-Parser is used to determine whether the XPath might match a message at all. This can improve performance significantly, as a DOM tree does probably not have to to be constructed for every message. This is, for example, the case in
where the existence of the <Fault>-element is checked using the StAX-parser before the DOM is constructed.<xmlContentFilter xPath="//*[local-name()='Fault' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']//*[local-name()='stacktrace']" /> xmlContentFilter using a StAX-Parser for improved performance If the message body is not well-formed XML, it is left unchanged. If the message is XOP-encoded, the XPath-expression is run on the reconstituted message; if it matches, the message is replaced by the modified reconstituted message.
- Topic
- 3. Enterprise Integration Patterns
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetXPath()handleRequest(Exchange exc) handleResponse(Exchange exc) voidMethods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, init, init, setDisplayName, setFlow
-
Constructor Details
-
XMLContentFilterInterceptor
public XMLContentFilterInterceptor()
-
-
Method Details
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-
getXPath
-
setXPath
- Description
- An XPath 1.0 expression describing the elements to be removed from message bodies.
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
handleResponse
- Specified by:
handleResponsein interfaceInterceptor- Overrides:
handleResponsein classAbstractInterceptor- Throws:
Exception
-