Package org.apache.camel.language.bean
Class BeanLanguage
- java.lang.Object
-
- org.apache.camel.support.LanguageSupport
-
- org.apache.camel.language.bean.BeanLanguage
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.spi.Language
,org.apache.camel.spi.PropertyConfigurer
,org.apache.camel.spi.ScriptingLanguage
,org.apache.camel.StaticService
@Language("bean") public class BeanLanguage extends org.apache.camel.support.LanguageSupport implements org.apache.camel.spi.ScriptingLanguage, org.apache.camel.spi.PropertyConfigurer, org.apache.camel.StaticService
A bean language which uses a simple text notation to invoke methods on beans to evaluate predicates or expressions The notation is essentiallybeanName.methodName
which is then invoked using the beanName to lookup in the bean integration to bind theExchange
to the method arguments. As of Camel 1.5 the bean language also supports invoking a provided bean by its classname or the bean itself.
-
-
Constructor Summary
Constructors Constructor Description BeanLanguage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(org.apache.camel.CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase)
org.apache.camel.Expression
createExpression(String expression)
org.apache.camel.Expression
createExpression(String expression, Object[] properties)
org.apache.camel.Predicate
createPredicate(String expression)
org.apache.camel.Predicate
createPredicate(String expression, Object[] properties)
<T> T
evaluate(String script, Map<String,Object> bindings, Class<T> resultType)
Object
getBean()
Class<?>
getBeanType()
String
getMethod()
String
getRef()
org.apache.camel.BeanScope
getScope()
void
setBean(Object bean)
void
setBeanType(Class<?> beanType)
void
setMethod(String method)
void
setRef(String ref)
void
setScope(org.apache.camel.BeanScope scope)
void
start()
void
stop()
-
Methods inherited from class org.apache.camel.support.LanguageSupport
getCamelContext, hasSimpleFunction, isDynamicResource, isSingleton, isStaticResource, loadResource, property, setCamelContext
-
-
-
-
Field Detail
-
LANGUAGE
public static final String LANGUAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBean
public Object getBean()
-
setBean
public void setBean(Object bean)
-
getBeanType
public Class<?> getBeanType()
-
setBeanType
public void setBeanType(Class<?> beanType)
-
getRef
public String getRef()
-
setRef
public void setRef(String ref)
-
getMethod
public String getMethod()
-
setMethod
public void setMethod(String method)
-
getScope
public org.apache.camel.BeanScope getScope()
-
setScope
public void setScope(org.apache.camel.BeanScope scope)
-
configure
public boolean configure(org.apache.camel.CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase)
- Specified by:
configure
in interfaceorg.apache.camel.spi.PropertyConfigurer
-
createPredicate
public org.apache.camel.Predicate createPredicate(String expression)
- Specified by:
createPredicate
in interfaceorg.apache.camel.spi.Language
-
createPredicate
public org.apache.camel.Predicate createPredicate(String expression, Object[] properties)
- Specified by:
createPredicate
in interfaceorg.apache.camel.spi.Language
-
createExpression
public org.apache.camel.Expression createExpression(String expression, Object[] properties)
- Specified by:
createExpression
in interfaceorg.apache.camel.spi.Language
-
createExpression
public org.apache.camel.Expression createExpression(String expression)
- Specified by:
createExpression
in interfaceorg.apache.camel.spi.Language
-
evaluate
public <T> T evaluate(String script, Map<String,Object> bindings, Class<T> resultType)
- Specified by:
evaluate
in interfaceorg.apache.camel.spi.ScriptingLanguage
-
start
public void start()
- Specified by:
start
in interfaceorg.apache.camel.Service
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.apache.camel.Service
-
-