Class BeanLanguage

java.lang.Object
org.apache.camel.support.LanguageSupport
org.apache.camel.support.TypedLanguageSupport
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.HasCamelContext, 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.TypedLanguageSupport 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 essentially beanName.methodName which is then invoked using the beanName to lookup in the invalid input: '<'a href="http://camel.apache.org/registry.html>registry then the method is invoked to evaluate the expression using the bean integration to bind the Exchange 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.

  • Field Details

  • Constructor Details

    • BeanLanguage

      public BeanLanguage()
  • Method Details

    • isValidate

      public boolean isValidate()
    • setValidate

      public void setValidate(boolean validate)
    • configure

      public boolean configure(org.apache.camel.CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase)
      Specified by:
      configure in interface org.apache.camel.spi.PropertyConfigurer
    • createPredicate

      public org.apache.camel.Predicate createPredicate(String expression)
      Specified by:
      createPredicate in interface org.apache.camel.spi.Language
    • createExpression

      public org.apache.camel.Expression createExpression(String expression)
      Specified by:
      createExpression in interface org.apache.camel.spi.Language
    • createPredicate

      public org.apache.camel.Predicate createPredicate(String expression, Object[] properties)
      Specified by:
      createPredicate in interface org.apache.camel.spi.Language
    • createExpression

      public org.apache.camel.Expression createExpression(String expression, Object[] properties)
      Specified by:
      createExpression in interface org.apache.camel.spi.Language
      Overrides:
      createExpression in class org.apache.camel.support.TypedLanguageSupport
    • createBeanExpression

      protected BeanExpression createBeanExpression(String expression)
    • evaluate

      public <T> T evaluate(String script, Map<String,Object> bindings, Class<T> resultType)
      Specified by:
      evaluate in interface org.apache.camel.spi.ScriptingLanguage
    • start

      public void start()
      Specified by:
      start in interface org.apache.camel.Service
    • stop

      public void stop()
      Specified by:
      stop in interface org.apache.camel.Service