org.apache.camel.builder
Class SimpleBuilder

java.lang.Object
  extended by org.apache.camel.builder.SimpleBuilder
All Implemented Interfaces:
Expression, Predicate

public class SimpleBuilder
extends Object
implements Predicate, Expression

Creates an Simple language builder.

This builder is available in the Java DSL from the RouteBuilder which means that using simple language for Expressions or Predicates is very easy with the help of this builder.

Version:

Constructor Summary
SimpleBuilder(String text)
           
 
Method Summary
<T> T
evaluate(Exchange exchange, Class<T> type)
          Returns the value of the expression on the given exchange
 Class<?> getResultType()
           
 String getText()
           
 boolean matches(Exchange exchange)
          Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
 SimpleBuilder resultType(Class<?> resultType)
           
 void setResultType(Class<?> resultType)
           
static SimpleBuilder simple(String text)
           
static SimpleBuilder simple(String text, Class<?> resultType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleBuilder

public SimpleBuilder(String text)
Method Detail

simple

public static SimpleBuilder simple(String text)

simple

public static SimpleBuilder simple(String text,
                                   Class<?> resultType)

getText

public String getText()

getResultType

public Class<?> getResultType()

setResultType

public void setResultType(Class<?> resultType)

resultType

public SimpleBuilder resultType(Class<?> resultType)

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
Parameters:
exchange - the message exchange
Returns:
true if the predicate matches

evaluate

public <T> T evaluate(Exchange exchange,
                      Class<T> type)
Description copied from interface: Expression
Returns the value of the expression on the given exchange

Specified by:
evaluate in interface Expression
Parameters:
exchange - the message exchange on which to evaluate the expression
type - the expected type of the evaluation result
Returns:
the value of the expression

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL