Package org.apache.camel.language.bean
Class BeanExpression
java.lang.Object
org.apache.camel.language.bean.BeanExpression
- All Implemented Interfaces:
org.apache.camel.Expression
,org.apache.camel.Predicate
public class BeanExpression
extends Object
implements org.apache.camel.Expression, org.apache.camel.Predicate
Evaluates an expression using a bean method invocation
-
Constructor Summary
ConstructorDescriptionBeanExpression
(Class<?> type, String method) BeanExpression
(Object bean, String method) BeanExpression
(String beanName, String method) -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(org.apache.camel.Exchange exchange) <T> T
getBean()
Class
<?> org.apache.camel.BeanScope
getScope()
org.apache.camel.spi.Language
Class
<?> getType()
void
init
(org.apache.camel.CamelContext context) boolean
boolean
matches
(org.apache.camel.Exchange exchange) void
setBeanComponent
(BeanComponent beanComponent) void
setParameterMappingStrategy
(ParameterMappingStrategy parameterMappingStrategy) void
setResultType
(Class<?> resultType) void
setScope
(org.apache.camel.BeanScope scope) void
setSimple
(org.apache.camel.spi.Language simple) void
setValidate
(boolean validate) toString()
protected void
validateHasMethod
(org.apache.camel.CamelContext context, Object bean, Class<?> type, String method) Validates the given bean has the method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.Predicate
initPredicate
-
Constructor Details
-
BeanExpression
-
BeanExpression
-
BeanExpression
-
-
Method Details
-
getBean
-
getBeanName
-
getType
-
getMethod
-
getScope
public org.apache.camel.BeanScope getScope() -
setScope
public void setScope(org.apache.camel.BeanScope scope) -
isValidate
public boolean isValidate() -
setValidate
public void setValidate(boolean validate) -
getParameterMappingStrategy
-
setParameterMappingStrategy
-
getBeanComponent
-
setBeanComponent
-
getSimple
public org.apache.camel.spi.Language getSimple() -
setSimple
public void setSimple(org.apache.camel.spi.Language simple) -
getResultType
-
setResultType
-
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
-
toString
-
evaluate
-
evaluate
- 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
-
validateHasMethod
protected void validateHasMethod(org.apache.camel.CamelContext context, Object bean, Class<?> type, String method) Validates the given bean has the method. This implementation will skip trying to validate OGNL method name expressions.- Parameters:
context
- camel contextbean
- the bean instancetype
- the bean typemethod
- the method, can be null if no method name provided- Throws:
org.apache.camel.RuntimeCamelException
- is thrown if bean does not have the method
-