public class TokenXMLExpressionIterator extends ExpressionAdapter
Expression
to walk a Message
XML body using an
Iterator
, which grabs the content between a XML start and end token, where the end token
corresponds implicitly to either the end tag or the self-closing start tag.
The message body must be able to convert to InputStream
type which is used as stream to access the
message body.
Can be used to split big XML files.
This implementation supports inheriting namespaces from a parent/root tag.Modifier and Type | Field and Description |
---|---|
protected String |
inheritNamespaceToken |
protected String |
tagToken |
Constructor and Description |
---|
TokenXMLExpressionIterator(String tagToken,
String inheritNamespaceToken) |
Modifier and Type | Method and Description |
---|---|
protected Iterator<?> |
createIterator(org.apache.camel.Exchange exchange,
InputStream in,
String charset) |
protected Object |
doEvaluate(org.apache.camel.Exchange exchange,
boolean closeStream)
Strategy to evaluate the exchange
|
Object |
evaluate(org.apache.camel.Exchange exchange) |
boolean |
matches(org.apache.camel.Exchange exchange) |
assertionFailureMessage, evaluate
assertMatches, init
protected final String tagToken
protected final String inheritNamespaceToken
protected Iterator<?> createIterator(org.apache.camel.Exchange exchange, InputStream in, String charset)
public boolean matches(org.apache.camel.Exchange exchange)
matches
in interface org.apache.camel.Predicate
matches
in class ExpressionSupport
public Object evaluate(org.apache.camel.Exchange exchange)
evaluate
in class ExpressionSupport
protected Object doEvaluate(org.apache.camel.Exchange exchange, boolean closeStream)
exchange
- the exchangecloseStream
- whether to close the stream before returning from this method.Apache Camel