Package org.apache.camel.component.mock
Class MockExpressionClause<T>
- java.lang.Object
-
- org.apache.camel.component.mock.MockExpressionClause<T>
-
- All Implemented Interfaces:
org.apache.camel.Expression
,org.apache.camel.Predicate
public class MockExpressionClause<T> extends Object implements org.apache.camel.Expression, org.apache.camel.Predicate
Represents an expression clause within the DSL which when the expression is complete the clause continues to another part of the DSL This implementation is a derived copy of the org.apache.camel.builder.ExpressionClause from camel-core, that are specialized for being used with the mock component and separated from camel-core.
-
-
Constructor Summary
Constructors Constructor Description MockExpressionClause(T result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
body()
An expression of an inbound message bodyT
body(Class<?> expectedType)
An expression of an inbound message body converted to the expected type<B> T
body(Class<B> expectedType, BiFunction<B,Map<String,Object>,Object> function)
A functional expression of an inbound message body converted to the expected type and headers<B> T
body(Class<B> expectedType, Function<B,Object> function)
A functional expression of an inbound message body converted to the expected typeT
body(BiFunction<Object,Map<String,Object>,Object> function)
A functional expression of an inbound message body and headersT
body(Function<Object,Object> function)
A functional expression of an inbound message bodyT
body(Supplier<Object> supplier)
A functional expression of an inbound message bodyT
constant(Object value)
Specify the constant expression value.<T> T
evaluate(org.apache.camel.Exchange exchange, Class<T> type)
T
exchange()
An expression of the exchangeT
exchange(Function<org.apache.camel.Exchange,Object> function)
A functional expression of the exchangeT
exchangeProperties()
An expression of the exchange propertiesT
exchangeProperty(String name)
An expression of an exchange property of the given nameT
expression(org.apache.camel.Expression expression)
Specify anExpression
instanceorg.apache.camel.ExpressionFactory
getExpressionType()
org.apache.camel.Expression
getExpressionValue()
T
groovy(String text)
Evaluates a Groovy expressionT
header(String name)
An expression of an inbound message header of the given nameT
headers()
An expression of the inbound headersvoid
init(org.apache.camel.CamelContext context)
T
inMessage()
An expression of an inbound messageT
inMessage(Function<org.apache.camel.Message,Object> function)
A functional expression of an inbound messageT
jsonpath(String text)
Evaluates a Json Path expressionT
language(String language, String expression)
Evaluates a given language name with the expression textboolean
matches(org.apache.camel.Exchange exchange)
T
message()
An expression of an inbound messageT
message(Function<org.apache.camel.Message,Object> function)
A functional expression of an inbound messageT
method(String bean)
Evaluates an expression using the bean language which basically means the bean is invoked to determine the expression value.T
method(String bean, String method)
Evaluates an expression using the bean language which basically means the bean is invoked to determine the expression value.T
mvel(String text)
Evaluates a MVEL expressionT
ognl(String text)
Evaluates an OGNL expression<B> T
outBody(Class<B> expectedType, BiFunction<B,Map<String,Object>,Object> function)
A functional expression of an outbound message body converted to the expected type and headers<B> T
outBody(Class<B> expectedType, Function<B,Object> function)
A functional expression of an outbound message body converted to the expected typeT
outBody(BiFunction<Object,Map<String,Object>,Object> function)
A functional expression of an outbound message body and headersT
outBody(Function<Object,Object> function)
A functional expression of an outbound message bodyT
outMessage(Function<org.apache.camel.Message,Object> function)
A functional expression of an outbound messageT
ref(String ref)
Evaluates a Ref expressionT
simple(String text)
Evaluates a Simple expressionT
spel(String text)
Evaluates a SpEL expressionT
xpath(String text)
Evaluates an XPath expressionT
xquery(String text)
Evaluates an XQuery expression
-
-
-
Constructor Detail
-
MockExpressionClause
public MockExpressionClause(T result)
-
-
Method Detail
-
expression
public T expression(org.apache.camel.Expression expression)
Specify anExpression
instance
-
constant
public T constant(Object value)
Specify the constant expression value. Important: this is a fixed constant value that is only set once during starting up the route, do not use this if you want dynamic values during routing.
-
exchange
public T exchange()
An expression of the exchange
-
exchange
public T exchange(Function<org.apache.camel.Exchange,Object> function)
A functional expression of the exchange
-
message
public T message()
An expression of an inbound message
-
message
public T message(Function<org.apache.camel.Message,Object> function)
A functional expression of an inbound message
-
inMessage
public T inMessage()
An expression of an inbound message
-
inMessage
public T inMessage(Function<org.apache.camel.Message,Object> function)
A functional expression of an inbound message
-
outMessage
public T outMessage(Function<org.apache.camel.Message,Object> function)
A functional expression of an outbound message
-
body
public T body()
An expression of an inbound message body
-
body
public T body(Function<Object,Object> function)
A functional expression of an inbound message body
-
body
public T body(BiFunction<Object,Map<String,Object>,Object> function)
A functional expression of an inbound message body and headers
-
body
public T body(Class<?> expectedType)
An expression of an inbound message body converted to the expected type
-
body
public <B> T body(Class<B> expectedType, Function<B,Object> function)
A functional expression of an inbound message body converted to the expected type
-
body
public <B> T body(Class<B> expectedType, BiFunction<B,Map<String,Object>,Object> function)
A functional expression of an inbound message body converted to the expected type and headers
-
outBody
public T outBody(Function<Object,Object> function)
A functional expression of an outbound message body
-
outBody
public T outBody(BiFunction<Object,Map<String,Object>,Object> function)
A functional expression of an outbound message body and headers
-
outBody
public <B> T outBody(Class<B> expectedType, Function<B,Object> function)
A functional expression of an outbound message body converted to the expected type
-
outBody
public <B> T outBody(Class<B> expectedType, BiFunction<B,Map<String,Object>,Object> function)
A functional expression of an outbound message body converted to the expected type and headers
-
headers
public T headers()
An expression of the inbound headers
-
exchangeProperty
public T exchangeProperty(String name)
An expression of an exchange property of the given name
-
exchangeProperties
public T exchangeProperties()
An expression of the exchange properties
-
method
public T method(String bean)
Evaluates an expression using the bean language which basically means the bean is invoked to determine the expression value.- Parameters:
bean
- the name of the bean looked up the registry- Returns:
- the builder to continue processing the DSL
-
method
public T method(String bean, String method)
Evaluates an expression using the bean language which basically means the bean is invoked to determine the expression value.- Parameters:
bean
- the name of the bean looked up the registrymethod
- the name of the method to invoke on the bean- Returns:
- the builder to continue processing the DSL
-
groovy
public T groovy(String text)
Evaluates a Groovy expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
jsonpath
public T jsonpath(String text)
Evaluates a Json Path expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
ognl
public T ognl(String text)
Evaluates an OGNL expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
mvel
public T mvel(String text)
Evaluates a MVEL expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
ref
public T ref(String ref)
Evaluates a Ref expression- Parameters:
ref
- refers to the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
spel
public T spel(String text)
Evaluates a SpEL expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
simple
public T simple(String text)
Evaluates a Simple expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
xpath
public T xpath(String text)
Evaluates an XPath expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
xquery
public T xquery(String text)
Evaluates an XQuery expression- Parameters:
text
- the expression to be evaluated- Returns:
- the builder to continue processing the DSL
-
language
public T language(String language, String expression)
Evaluates a given language name with the expression text- Parameters:
language
- the name of the languageexpression
- the expression in the given language- Returns:
- the builder to continue processing the DSL
-
getExpressionValue
public org.apache.camel.Expression getExpressionValue()
-
getExpressionType
public org.apache.camel.ExpressionFactory getExpressionType()
-
init
public void init(org.apache.camel.CamelContext context)
- Specified by:
init
in interfaceorg.apache.camel.Expression
- Specified by:
init
in interfaceorg.apache.camel.Predicate
-
evaluate
public <T> T evaluate(org.apache.camel.Exchange exchange, Class<T> type)
- Specified by:
evaluate
in interfaceorg.apache.camel.Expression
-
matches
public boolean matches(org.apache.camel.Exchange exchange)
- Specified by:
matches
in interfaceorg.apache.camel.Predicate
-
-