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
ConstructorsConstructorDescriptionBeanExpression(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> TgetBean()Class<?>org.apache.camel.BeanScopegetScope()org.apache.camel.spi.LanguageClass<?>getType()voidinit(org.apache.camel.CamelContext context) booleanmatches(org.apache.camel.Exchange exchange) voidsetBeanComponent(BeanComponent beanComponent) voidsetParameterMappingStrategy(ParameterMappingStrategy parameterMappingStrategy) voidsetResultType(Class<?> resultType) voidsetScope(org.apache.camel.BeanScope scope) voidsetSimple(org.apache.camel.spi.Language simple) toString()protected voidvalidateHasMethod(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, waitMethods 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) -
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:
initin interfaceorg.apache.camel.Expression- Specified by:
initin interfaceorg.apache.camel.Predicate
-
toString
-
evaluate
-
evaluate
- Specified by:
evaluatein interfaceorg.apache.camel.Expression
-
matches
public boolean matches(org.apache.camel.Exchange exchange) - Specified by:
matchesin 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
-