org.jboss.webbeans.introspector
Class ForwardingAnnotatedMethod<T>

java.lang.Object
  extended by org.jboss.webbeans.introspector.ForwardingAnnotatedItem<T,S>
      extended by org.jboss.webbeans.introspector.ForwardingAnnotatedMember<T,java.lang.reflect.Method>
          extended by org.jboss.webbeans.introspector.ForwardingAnnotatedMethod<T>
All Implemented Interfaces:
AnnotatedItem<T,java.lang.reflect.Method>, AnnotatedMember<T,java.lang.reflect.Method>, AnnotatedMethod<T>
Direct Known Subclasses:
MethodInjectionPoint, WrappedAnnotatedMethod

public abstract class ForwardingAnnotatedMethod<T>
extends ForwardingAnnotatedMember<T,java.lang.reflect.Method>
implements AnnotatedMethod<T>


Field Summary
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedMethod
MAPPED_PARAMETER_ANNOTATIONS
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
MAPPED_METAANNOTATIONS
 
Constructor Summary
ForwardingAnnotatedMethod()
           
 
Method Summary
protected abstract  AnnotatedMethod<T> delegate()
          Gets the annotated item
 java.lang.reflect.Method getAnnotatedMethod()
           
 java.util.List<AnnotatedParameter<?>> getAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
          Gets the list of annotated parameters for a given annotation
 AnnotatedType<?> getDeclaringClass()
          Gets the declaring class
 java.util.List<? extends AnnotatedParameter<?>> getParameters()
          Gets the abstracted parameters of the method
 java.lang.Class<?>[] getParameterTypesAsArray()
          Get the parameter types as an array
 java.lang.String getPropertyName()
          Gets the property name
 MethodSignature getSignature()
           
 T invoke(java.lang.Object instance, java.lang.Object... parameters)
          Invokes the method
 T invokeOnInstance(java.lang.Object instance, java.lang.Object... parameters)
          Invokes the method on the class of the passed instance, not the declaring class.
 boolean isEquivalent(java.lang.reflect.Method method)
          Checks if a this is equivalent to a JLR method
 
Methods inherited from class org.jboss.webbeans.introspector.ForwardingAnnotatedMember
getMember
 
Methods inherited from class org.jboss.webbeans.introspector.ForwardingAnnotatedItem
equals, getActualTypeArguments, getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindings, getBindingsAsArray, getDeclaredMetaAnnotations, getFlattenedTypeHierarchy, getMetaAnnotations, getMetaAnnotationsAsArray, getName, getRawType, getType, hashCode, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isFinal, isParameterizedType, isProxyable, isPublic, isStatic, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedMember
getMember
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
getActualTypeArguments, getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindings, getBindingsAsArray, getDeclaredMetaAnnotations, getFlattenedTypeHierarchy, getMetaAnnotations, getMetaAnnotationsAsArray, getName, getRawType, getType, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isFinal, isParameterizedType, isProxyable, isPublic, isStatic
 

Constructor Detail

ForwardingAnnotatedMethod

public ForwardingAnnotatedMethod()
Method Detail

delegate

protected abstract AnnotatedMethod<T> delegate()
Description copied from class: ForwardingAnnotatedItem
Gets the annotated item

Specified by:
delegate in class ForwardingAnnotatedMember<T,java.lang.reflect.Method>
Returns:
The annotated item

getAnnotatedMethod

public java.lang.reflect.Method getAnnotatedMethod()
Specified by:
getAnnotatedMethod in interface AnnotatedMethod<T>

getAnnotatedParameters

public java.util.List<AnnotatedParameter<?>> getAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Description copied from interface: AnnotatedMethod
Gets the list of annotated parameters for a given annotation

Specified by:
getAnnotatedParameters in interface AnnotatedMethod<T>
Parameters:
metaAnnotationType - The annotation to match
Returns:
A set of matching parameter abstractions. Returns an empty list if there are no matches.

getDeclaringClass

public AnnotatedType<?> getDeclaringClass()
Description copied from interface: AnnotatedMethod
Gets the declaring class

Specified by:
getDeclaringClass in interface AnnotatedMember<T,java.lang.reflect.Method>
Specified by:
getDeclaringClass in interface AnnotatedMethod<T>
Returns:
An abstraction of the declaring class

getParameterTypesAsArray

public java.lang.Class<?>[] getParameterTypesAsArray()
Description copied from interface: AnnotatedMethod
Get the parameter types as an array

Specified by:
getParameterTypesAsArray in interface AnnotatedMethod<T>

getParameters

public java.util.List<? extends AnnotatedParameter<?>> getParameters()
Description copied from interface: AnnotatedMethod
Gets the abstracted parameters of the method

Specified by:
getParameters in interface AnnotatedMethod<T>
Returns:
A list of parameters. Returns an empty list if no parameters are present.

getPropertyName

public java.lang.String getPropertyName()
Description copied from interface: AnnotatedMethod
Gets the property name

Specified by:
getPropertyName in interface AnnotatedMethod<T>
Returns:
The name

invoke

public T invoke(java.lang.Object instance,
                java.lang.Object... parameters)
         throws java.lang.IllegalArgumentException,
                java.lang.IllegalAccessException,
                java.lang.reflect.InvocationTargetException
Description copied from interface: AnnotatedMethod
Invokes the method

Specified by:
invoke in interface AnnotatedMethod<T>
Parameters:
instance - The instance to invoke
parameters - The method parameters
Returns:
A reference to the instance
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

invokeOnInstance

public T invokeOnInstance(java.lang.Object instance,
                          java.lang.Object... parameters)
                   throws java.lang.IllegalArgumentException,
                          java.lang.SecurityException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException,
                          java.lang.NoSuchMethodException
Description copied from interface: AnnotatedMethod
Invokes the method on the class of the passed instance, not the declaring class. Useful with proxies

Specified by:
invokeOnInstance in interface AnnotatedMethod<T>
Parameters:
instance - The instance to invoke
Returns:
A reference to the instance
Throws:
java.lang.IllegalArgumentException
java.lang.SecurityException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException

isEquivalent

public boolean isEquivalent(java.lang.reflect.Method method)
Description copied from interface: AnnotatedMethod
Checks if a this is equivalent to a JLR method

Specified by:
isEquivalent in interface AnnotatedMethod<T>
Parameters:
method - The JLR method
Returns:
true if equivalent

getSignature

public MethodSignature getSignature()
Specified by:
getSignature in interface AnnotatedMethod<T>


Copyright © 2011. All Rights Reserved.