Class BeanLanguage

  • All Implemented Interfaces:
    org.apache.camel.CamelContextAware, org.apache.camel.IsSingleton, org.apache.camel.spi.GeneratedPropertyConfigurer, org.apache.camel.spi.Language, org.apache.camel.spi.PropertyConfigurer

    @Language("bean")
    public class BeanLanguage
    extends org.apache.camel.support.LanguageSupport
    implements org.apache.camel.spi.GeneratedPropertyConfigurer
    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 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.

    • Constructor Detail

      • BeanLanguage

        public BeanLanguage()
    • Method Detail

      • 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
      • 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)
      • 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
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.apache.camel.IsSingleton
        Overrides:
        isSingleton in class org.apache.camel.support.LanguageSupport