public class MethodInfo extends Object
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTypeAndSuperTypes(Class<?> type,
List<Class<?>> result)
Adds the current class and all of its base classes (apart from
Object to the given list |
boolean |
bodyParameterMatches(Class<?> bodyType) |
MethodInvocation |
createMethodInvocation(Object pojo,
boolean hasParameters,
org.apache.camel.Exchange exchange) |
protected org.apache.camel.Expression[] |
createParameterExpressions() |
protected org.apache.camel.Expression |
createParametersExpression() |
protected org.apache.camel.Pattern |
findOneWayAnnotation(List<Class<?>> classes)
Finds the first annotation on the given list of classes
|
protected org.apache.camel.Pattern |
findOneWayAnnotation(Method method)
Finds the oneway annotation in priority order; look for method level annotations first, then the class level annotations,
then super class annotations then interface annotations
|
protected org.apache.camel.Pattern |
findOneWayAnnotationOnMethod(List<Class<?>> classes,
Method method)
Finds the first annotation on the base methods defined in the list of classes
|
List<org.apache.camel.component.bean.ParameterInfo> |
getBodyParameters() |
Class<?> |
getBodyParameterType() |
Method |
getMethod() |
List<org.apache.camel.component.bean.ParameterInfo> |
getParameters() |
org.apache.camel.Expression |
getParametersExpression() |
org.apache.camel.ExchangePattern |
getPattern()
Returns the
ExchangePattern that should be used when invoking this method. |
protected org.apache.camel.Pattern |
getPatternAnnotation(AnnotatedElement annotatedElement)
Returns the pattern annotation on the given annotated element; either as a direct annotation or
on an annotation which is also annotated
|
protected org.apache.camel.Pattern |
getPatternAnnotation(AnnotatedElement annotatedElement,
int depth)
Returns the pattern annotation on the given annotated element; either as a direct annotation or
on an annotation which is also annotated
|
Class<?> |
getType() |
boolean |
hasBodyParameter() |
boolean |
hasCustomAnnotation() |
protected boolean |
hasExceptionParameter() |
boolean |
hasHandlerAnnotation() |
boolean |
hasParameters() |
protected Object |
invoke(Method mth,
Object pojo,
Object[] arguments,
org.apache.camel.Exchange exchange) |
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)
|
boolean |
isReturnTypeVoid() |
boolean |
isStaticMethod() |
String |
toString() |
public MethodInvocation createMethodInvocation(Object pojo, boolean hasParameters, org.apache.camel.Exchange exchange)
public Class<?> getType()
public Method getMethod()
public org.apache.camel.ExchangePattern getPattern()
ExchangePattern
that should be used when invoking this method. This value
defaults to ExchangePattern.InOut
unless some Pattern
annotation is used
to override the message exchange pattern.public org.apache.camel.Expression getParametersExpression()
public List<org.apache.camel.component.bean.ParameterInfo> getBodyParameters()
public Class<?> getBodyParameterType()
public boolean bodyParameterMatches(Class<?> bodyType)
public List<org.apache.camel.component.bean.ParameterInfo> getParameters()
public boolean hasBodyParameter()
public boolean hasCustomAnnotation()
public boolean hasHandlerAnnotation()
public boolean hasParameters()
public boolean isReturnTypeVoid()
public boolean isStaticMethod()
public boolean isCovariantWith(MethodInfo method)
protected Object invoke(Method mth, Object pojo, Object[] arguments, org.apache.camel.Exchange exchange) throws InvocationTargetException
InvocationTargetException
protected org.apache.camel.Expression[] createParameterExpressions()
protected org.apache.camel.Expression createParametersExpression()
protected org.apache.camel.Pattern findOneWayAnnotation(Method method)
method
- the method on which to searchprotected org.apache.camel.Pattern getPatternAnnotation(AnnotatedElement annotatedElement)
annotatedElement
- the element to look for the annotationprotected org.apache.camel.Pattern getPatternAnnotation(AnnotatedElement annotatedElement, int depth)
annotatedElement
- the element to look for the annotationdepth
- the current depthprotected void addTypeAndSuperTypes(Class<?> type, List<Class<?>> result)
Object
to the given listprotected org.apache.camel.Pattern findOneWayAnnotationOnMethod(List<Class<?>> classes, Method method)
protected org.apache.camel.Pattern findOneWayAnnotation(List<Class<?>> classes)
protected boolean hasExceptionParameter()
Apache Camel