Package org.apache.camel.component.bean
Class MethodInfo
- java.lang.Object
-
- org.apache.camel.component.bean.MethodInfo
-
public class MethodInfo extends Object
Information about a method to be used for invocation.
-
-
Constructor Summary
Constructors Constructor Description MethodInfo(org.apache.camel.CamelContext camelContext, Class<?> type, Method method, List<org.apache.camel.component.bean.ParameterInfo> parameters, List<org.apache.camel.component.bean.ParameterInfo> bodyParameters, boolean hasCustomAnnotation, boolean hasHandlerAnnotation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbodyParameterMatches(Class<?> bodyType)MethodInvocationcreateMethodInvocation(Object pojo, boolean hasParameters, org.apache.camel.Exchange exchange)protected org.apache.camel.Expression[]createParameterExpressions()protected org.apache.camel.ExpressioncreateParametersExpression()protected org.apache.camel.ExchangePatternfindExchangePatternAnnotation(Map<Class<?>,Annotation> collectedMethodAnnotation)List<org.apache.camel.component.bean.ParameterInfo>getBodyParameters()Class<?>getBodyParameterType()MethodgetMethod()List<org.apache.camel.component.bean.ParameterInfo>getParameters()org.apache.camel.ExpressiongetParametersExpression()org.apache.camel.ExchangePatterngetPattern()Returns theExchangePatternthat should be used when invoking this method.Class<?>getType()booleanhasBodyParameter()booleanhasCustomAnnotation()protected booleanhasExceptionParameter()booleanhasHandlerAnnotation()booleanhasParameters()protected Objectinvoke(Method mth, Object pojo, Object[] arguments, org.apache.camel.Exchange exchange)booleanisCovariantWith(MethodInfo method)Returns true if this method is covariant with the specified method (this method may above or below the specified method in the class hierarchy)booleanisReturnTypeVoid()booleanisStaticMethod()voidsetErrorHandler(org.apache.camel.Processor errorHandler)For fine grained error handling for outputs of this EIP.StringtoString()
-
-
-
Method Detail
-
setErrorHandler
public void setErrorHandler(org.apache.camel.Processor errorHandler)
For fine grained error handling for outputs of this EIP. The base error handler is used as base and then cloned for each output processor. This is used internally only by Camel - not for end users.
-
createMethodInvocation
public MethodInvocation createMethodInvocation(Object pojo, boolean hasParameters, org.apache.camel.Exchange exchange)
-
getType
public Class<?> getType()
-
getMethod
public Method getMethod()
-
getPattern
public org.apache.camel.ExchangePattern getPattern()
Returns theExchangePatternthat should be used when invoking this method. This value defaults toExchangePattern.InOutunless somePatternannotation is used to override the message exchange pattern.- Returns:
- the exchange pattern to use for invoking this method.
-
getParametersExpression
public org.apache.camel.Expression getParametersExpression()
-
getBodyParameters
public List<org.apache.camel.component.bean.ParameterInfo> getBodyParameters()
-
getBodyParameterType
public Class<?> getBodyParameterType()
-
bodyParameterMatches
public boolean bodyParameterMatches(Class<?> bodyType)
-
getParameters
public List<org.apache.camel.component.bean.ParameterInfo> getParameters()
-
hasBodyParameter
public boolean hasBodyParameter()
-
hasCustomAnnotation
public boolean hasCustomAnnotation()
-
hasHandlerAnnotation
public boolean hasHandlerAnnotation()
-
hasParameters
public boolean hasParameters()
-
isReturnTypeVoid
public boolean isReturnTypeVoid()
-
isStaticMethod
public boolean isStaticMethod()
-
isCovariantWith
public boolean isCovariantWith(MethodInfo method)
Returns true if this method is covariant with the specified method (this method may above or below the specified method in the class hierarchy)
-
invoke
protected Object invoke(Method mth, Object pojo, Object[] arguments, org.apache.camel.Exchange exchange) throws InvocationTargetException
- Throws:
InvocationTargetException
-
createParameterExpressions
protected org.apache.camel.Expression[] createParameterExpressions()
-
createParametersExpression
protected org.apache.camel.Expression createParametersExpression()
-
findExchangePatternAnnotation
protected org.apache.camel.ExchangePattern findExchangePatternAnnotation(Map<Class<?>,Annotation> collectedMethodAnnotation)
-
hasExceptionParameter
protected boolean hasExceptionParameter()
-
-