public class BeanExpression extends Object implements org.apache.camel.Expression, org.apache.camel.Predicate, org.apache.camel.AfterPropertiesConfigured
Constructor and Description |
---|
BeanExpression(Class<?> type,
String method) |
BeanExpression(Object bean,
String method) |
BeanExpression(String beanName,
String method) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesConfigured(org.apache.camel.CamelContext camelContext) |
Object |
evaluate(org.apache.camel.Exchange exchange) |
<T> T |
evaluate(org.apache.camel.Exchange exchange,
Class<T> type) |
Object |
getBean() |
String |
getBeanName() |
String |
getMethod() |
Class<?> |
getType() |
boolean |
matches(org.apache.camel.Exchange exchange) |
void |
setBean(Object bean) |
void |
setBeanName(String beanName) |
void |
setMethod(String method) |
void |
setType(Class<?> type) |
String |
toString() |
protected void |
validateHasMethod(org.apache.camel.CamelContext context,
Object bean,
Class<?> type,
String method)
Validates the given bean has the method.
|
public Object getBean()
public void setBean(Object bean)
public String getBeanName()
public void setBeanName(String beanName)
public Class<?> getType()
public void setType(Class<?> type)
public String getMethod()
public void setMethod(String method)
public Object evaluate(org.apache.camel.Exchange exchange)
public <T> T evaluate(org.apache.camel.Exchange exchange, Class<T> type)
evaluate
in interface org.apache.camel.Expression
public boolean matches(org.apache.camel.Exchange exchange)
matches
in interface org.apache.camel.Predicate
public void afterPropertiesConfigured(org.apache.camel.CamelContext camelContext)
afterPropertiesConfigured
in interface org.apache.camel.AfterPropertiesConfigured
protected void validateHasMethod(org.apache.camel.CamelContext context, Object bean, Class<?> type, String method)
context
- camel contextbean
- the bean instancetype
- the bean typemethod
- the method, can be null if no method name providedorg.apache.camel.RuntimeCamelException
- is thrown if bean does not have the methodApache Camel