org.apache.camel.model.language
Class MethodCallExpression

java.lang.Object
  extended by org.apache.camel.model.language.ExpressionDefinition
      extended by org.apache.camel.model.language.MethodCallExpression
All Implemented Interfaces:
Expression, Predicate

public class MethodCallExpression
extends ExpressionDefinition

For expressions and predicates using the bean language

Version:

Constructor Summary
MethodCallExpression()
           
MethodCallExpression(Class<?> type)
           
MethodCallExpression(Class<?> type, String method)
           
MethodCallExpression(Object instance)
           
MethodCallExpression(Object instance, String method)
           
MethodCallExpression(String beanName)
           
MethodCallExpression(String beanName, String method)
           
 
Method Summary
protected  String beanName()
           
 Expression createExpression(CamelContext camelContext)
           
 Predicate createPredicate(CamelContext camelContext)
           
 String getBean()
           
 Class<?> getBeanType()
           
 String getBeanTypeName()
           
 Object getInstance()
           
 String getLanguage()
           
 String getMethod()
           
 String getRef()
           
 void setBean(String bean)
           
 void setBeanType(Class<?> beanType)
           
 void setBeanTypeName(String beanTypeName)
           
 void setInstance(Object instance)
           
 void setMethod(String method)
           
 void setRef(String ref)
           
 String toString()
           
protected  void validateHasMethod(CamelContext context, Object bean, Class<?> type, String method)
          Validates the given bean has the method.
 
Methods inherited from class org.apache.camel.model.language.ExpressionDefinition
assertMatches, configureExpression, configurePredicate, createExpression, createPredicate, evaluate, evaluate, getExpression, getExpressionType, getExpressionValue, getId, getLabel, getLabel, getPredicate, getTrim, isTrim, matches, setExpression, setExpressionType, setExpressionValue, setId, setProperty, setTrim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodCallExpression

public MethodCallExpression()

MethodCallExpression

public MethodCallExpression(String beanName)

MethodCallExpression

public MethodCallExpression(String beanName,
                            String method)

MethodCallExpression

public MethodCallExpression(Object instance)

MethodCallExpression

public MethodCallExpression(Object instance,
                            String method)

MethodCallExpression

public MethodCallExpression(Class<?> type)

MethodCallExpression

public MethodCallExpression(Class<?> type,
                            String method)
Method Detail

getLanguage

public String getLanguage()
Overrides:
getLanguage in class ExpressionDefinition

getBean

public String getBean()

setBean

public void setBean(String bean)

getRef

public String getRef()

setRef

public void setRef(String ref)

getMethod

public String getMethod()

setMethod

public void setMethod(String method)

getBeanType

public Class<?> getBeanType()

setBeanType

public void setBeanType(Class<?> beanType)

getBeanTypeName

public String getBeanTypeName()

setBeanTypeName

public void setBeanTypeName(String beanTypeName)

getInstance

public Object getInstance()

setInstance

public void setInstance(Object instance)

createExpression

public Expression createExpression(CamelContext camelContext)
Overrides:
createExpression in class ExpressionDefinition

createPredicate

public Predicate createPredicate(CamelContext camelContext)
Overrides:
createPredicate in class ExpressionDefinition

validateHasMethod

protected void validateHasMethod(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 context
bean - the bean instance
type - the bean type
method - the method, can be null if no method name provided
Throws:
RuntimeCamelException - is thrown if bean does not have the method

beanName

protected String beanName()

toString

public String toString()
Overrides:
toString in class ExpressionDefinition


Apache CAMEL