org.apache.camel.support
Class XMLTokenExpressionIterator

java.lang.Object
  extended by org.apache.camel.support.ExpressionSupport
      extended by org.apache.camel.support.ExpressionAdapter
          extended by org.apache.camel.support.XMLTokenExpressionIterator
All Implemented Interfaces:
Expression, Predicate, NamespaceAware

public class XMLTokenExpressionIterator
extends ExpressionAdapter
implements NamespaceAware


Field Summary
protected  char mode
           
protected  Map<String,String> nsmap
           
protected  String path
           
 
Constructor Summary
XMLTokenExpressionIterator(String path, char mode)
           
 
Method Summary
protected  Iterator<?> createIterator(InputStream in, String charset)
           
protected  Iterator<?> createIterator(Reader in)
           
protected  Object doEvaluate(Exchange exchange, boolean closeStream)
          Strategy to evaluate the exchange
 Object evaluate(Exchange exchange)
           
 boolean matches(Exchange exchange)
          Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
 void setMode(char mode)
           
 void setMode(String mode)
           
 void setNamespaces(Map<String,String> nsmap)
          Injects the XML Namespaces of prefix -> uri mappings
 
Methods inherited from class org.apache.camel.support.ExpressionAdapter
assertionFailureMessage, evaluate
 
Methods inherited from class org.apache.camel.support.ExpressionSupport
assertMatches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

protected final String path

mode

protected char mode

nsmap

protected Map<String,String> nsmap
Constructor Detail

XMLTokenExpressionIterator

public XMLTokenExpressionIterator(String path,
                                  char mode)
Method Detail

setNamespaces

public void setNamespaces(Map<String,String> nsmap)
Description copied from interface: NamespaceAware
Injects the XML Namespaces of prefix -> uri mappings

Specified by:
setNamespaces in interface NamespaceAware
Parameters:
nsmap - the XML namespaces with the key of prefixes and the value the URIs

setMode

public void setMode(char mode)

setMode

public void setMode(String mode)

createIterator

protected Iterator<?> createIterator(InputStream in,
                                     String charset)
                              throws XMLStreamException,
                                     UnsupportedEncodingException
Throws:
XMLStreamException
UnsupportedEncodingException

createIterator

protected Iterator<?> createIterator(Reader in)
                              throws XMLStreamException
Throws:
XMLStreamException

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 exchange
closeStream - whether to close the stream before returning from this method.
Returns:
the evaluated value


Apache Camel