org.apache.camel.support
Class TokenXMLExpressionIterator
java.lang.Object
org.apache.camel.support.ExpressionSupport
org.apache.camel.support.ExpressionAdapter
org.apache.camel.support.TokenXMLExpressionIterator
- All Implemented Interfaces:
- Expression, Predicate
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tagToken
protected final String tagToken
inheritNamespaceToken
protected final String inheritNamespaceToken
TokenXMLExpressionIterator
public TokenXMLExpressionIterator(String tagToken,
String inheritNamespaceToken)
createIterator
protected Iterator<?> createIterator(InputStream in,
String charset)
matches
public boolean matches(Exchange exchange)
- Description copied from interface:
Predicate
- Evaluates the predicate on the message exchange and returns true if this
exchange matches the predicate
- Specified by:
matches
in interface Predicate
- Overrides:
matches
in class ExpressionSupport
- Parameters:
exchange
- the message exchange
- Returns:
- true if the predicate matches
evaluate
public Object evaluate(Exchange exchange)
- Overrides:
evaluate
in class ExpressionSupport
doEvaluate
protected Object doEvaluate(Exchange exchange,
boolean closeStream)
- Strategy to evaluate the exchange
- Parameters:
exchange
- the exchangecloseStream
- whether to close the stream before returning from this method.
- Returns:
- the evaluated value
Apache Camel