Package org.apache.camel.support.builder
Class TokenPairExpressionIterator
java.lang.Object
org.apache.camel.support.ExpressionSupport
org.apache.camel.support.ExpressionAdapter
org.apache.camel.support.builder.TokenPairExpressionIterator
- All Implemented Interfaces:
org.apache.camel.Expression,org.apache.camel.Predicate
Expression to walk a Message body using an Iterator, which
grabs the content between a start and end token.
The message body must be able to convert to InputStream type which is used as stream to access the message
body.
For splitting XML files use TokenXMLExpressionIterator instead.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTokenPairExpressionIterator(String startToken, String endToken, boolean includeTokens) -
Method Summary
Modifier and TypeMethodDescriptionprotected Iterator<?>createIterator(org.apache.camel.Exchange exchange, InputStream in, String charset) Strategy to create the iteratorprotected ObjectdoEvaluate(org.apache.camel.Exchange exchange, boolean closeStream) Strategy to evaluate the exchangeevaluate(org.apache.camel.Exchange exchange) voidinit(org.apache.camel.CamelContext context) booleanmatches(org.apache.camel.Exchange exchange) toString()Methods inherited from class org.apache.camel.support.ExpressionAdapter
assertionFailureMessage, evaluateMethods inherited from class org.apache.camel.support.ExpressionSupport
assertMatchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.Predicate
initPredicate
-
Field Details
-
startToken
-
endToken
-
includeTokens
protected final boolean includeTokens
-
-
Constructor Details
-
TokenPairExpressionIterator
-
-
Method Details
-
init
public void init(org.apache.camel.CamelContext context) - Specified by:
initin interfaceorg.apache.camel.Expression- Specified by:
initin interfaceorg.apache.camel.Predicate- Overrides:
initin classExpressionAdapter
-
matches
public boolean matches(org.apache.camel.Exchange exchange) - Specified by:
matchesin interfaceorg.apache.camel.Predicate- Overrides:
matchesin classExpressionSupport
-
evaluate
- Overrides:
evaluatein classExpressionSupport
-
doEvaluate
Strategy to evaluate the exchange- Parameters:
exchange- the exchangecloseStream- whether to close the stream before returning from this method.- Returns:
- the evaluated value
-
createIterator
protected Iterator<?> createIterator(org.apache.camel.Exchange exchange, InputStream in, String charset) Strategy to create the iterator- Parameters:
exchange- the exchangein- input stream to iteratecharset- charset- Returns:
- the iterator
-
toString
-