org.jboss.weld.introspector.jlr
Class WeldMethodImpl<T,X>

java.lang.Object
  extended by org.jboss.weld.introspector.jlr.AbstractWeldAnnotated<T,S>
      extended by org.jboss.weld.introspector.jlr.AbstractWeldMember<T,X,S>
          extended by org.jboss.weld.introspector.jlr.AbstractWeldCallable<T,X,java.lang.reflect.Method>
              extended by org.jboss.weld.introspector.jlr.WeldMethodImpl<T,X>
Type Parameters:
T -
All Implemented Interfaces:
javax.enterprise.inject.spi.Annotated, javax.enterprise.inject.spi.AnnotatedCallable<X>, javax.enterprise.inject.spi.AnnotatedMember<X>, javax.enterprise.inject.spi.AnnotatedMethod<X>, WeldAnnotated<T,java.lang.reflect.Method>, WeldCallable<T,X,java.lang.reflect.Method>, WeldMember<T,X,java.lang.reflect.Method>, WeldMethod<T,X>

public class WeldMethodImpl<T,X>
extends AbstractWeldCallable<T,X,java.lang.reflect.Method>
implements WeldMethod<T,X>

Represents an annotated method This class is immutable and therefore threadsafe

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.weld.introspector.WeldMethod
MAPPED_PARAMETER_ANNOTATIONS
 
Fields inherited from interface org.jboss.weld.introspector.WeldAnnotated
MAPPED_METAANNOTATIONS
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares two AbstractAnnotatedItems
 java.lang.reflect.Method getAnnotatedMethod()
           
 java.util.List<WeldParameter<?,X>> getAnnotatedWBParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets the list of annotated parameters for a given annotation
 java.lang.reflect.Method getDelegate()
           
 java.util.List<javax.enterprise.inject.spi.AnnotatedParameter<X>> getParameters()
           
 java.lang.Class<?>[] getParameterTypesAsArray()
          Get the parameter types as an array
 java.lang.String getPropertyName()
          Gets the property name
 MethodSignature getSignature()
           
 java.util.List<WeldParameter<?,X>> getWBParameters()
          Gets the abstracted parameters of the method
 int hashCode()
          Gets the hash code of the actual type
 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
static
<T,X> WeldMethodImpl<T,X>
of(javax.enterprise.inject.spi.AnnotatedMethod<T> method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
           
static
<T,X> WeldMethodImpl<T,X>
of(java.lang.reflect.Method method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
           
 java.lang.String toString()
          Gets a string representation of the member
 
Methods inherited from class org.jboss.weld.introspector.jlr.AbstractWeldMember
getDeclaringType, getJavaMember, getName, getPackage, isFinal, isPackagePrivate, isPrivate, isPublic, isStatic, isTransient
 
Methods inherited from class org.jboss.weld.introspector.jlr.AbstractWeldAnnotated
getActualTypeArguments, getAnnotation, getAnnotations, getAnnotationStore, getBaseType, getBindingsAsArray, getDeclaredMetaAnnotations, getInterfaceOnlyFlattenedTypeHierarchy, getJavaClass, getMetaAnnotations, getMetaAnnotationsAsArray, getQualifiers, getTypeClosure, isAnnotationPresent, isDeclaredAnnotationPresent, isParameterizedType, isProxyable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldMember
getDeclaringType, getJavaMember
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getActualTypeArguments, getBindingsAsArray, getDeclaredMetaAnnotations, getInterfaceOnlyFlattenedTypeHierarchy, getJavaClass, getMetaAnnotations, getMetaAnnotationsAsArray, getName, getPackage, getQualifiers, isDeclaredAnnotationPresent, isFinal, isPackagePrivate, isParameterizedType, isPrivate, isProxyable, isPublic, isStatic
 
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedMethod
getJavaMember
 
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedMember
isStatic
 
Methods inherited from interface javax.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresent
 

Method Detail

of

public static <T,X> WeldMethodImpl<T,X> of(java.lang.reflect.Method method,
                                           WeldClass<X> declaringClass,
                                           ClassTransformer classTransformer)

of

public static <T,X> WeldMethodImpl<T,X> of(javax.enterprise.inject.spi.AnnotatedMethod<T> method,
                                           WeldClass<X> declaringClass,
                                           ClassTransformer classTransformer)

getAnnotatedMethod

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

getDelegate

public java.lang.reflect.Method getDelegate()
Specified by:
getDelegate in class AbstractWeldAnnotated<T,java.lang.reflect.Method>

getWBParameters

public java.util.List<WeldParameter<?,X>> getWBParameters()
Description copied from interface: WeldCallable
Gets the abstracted parameters of the method

Specified by:
getWBParameters in interface WeldCallable<T,X,java.lang.reflect.Method>
Returns:
A list of parameters. Returns an empty list if no parameters are present.

getParameterTypesAsArray

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

Specified by:
getParameterTypesAsArray in interface WeldMethod<T,X>

getAnnotatedWBParameters

public java.util.List<WeldParameter<?,X>> getAnnotatedWBParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Description copied from interface: WeldCallable
Gets the list of annotated parameters for a given annotation

Specified by:
getAnnotatedWBParameters in interface WeldCallable<T,X,java.lang.reflect.Method>
Parameters:
annotationType - The annotation to match
Returns:
A set of matching parameter abstractions. Returns an empty list if there are no matches.

equals

public boolean equals(java.lang.Object other)
Description copied from class: AbstractWeldAnnotated
Compares two AbstractAnnotatedItems

Overrides:
equals in class AbstractWeldAnnotated<T,java.lang.reflect.Method>
Parameters:
other - The other item
Returns:
True if equals, false otherwise

isEquivalent

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

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

hashCode

public int hashCode()
Description copied from class: AbstractWeldAnnotated
Gets the hash code of the actual type

Overrides:
hashCode in class AbstractWeldAnnotated<T,java.lang.reflect.Method>
Returns:
The hash code

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: WeldMethod
Invokes the method on the class of the passed instance, not the declaring class. Useful with proxies

Specified by:
invokeOnInstance in interface WeldMethod<T,X>
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

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: WeldMethod
Invokes the method

Specified by:
invoke in interface WeldMethod<T,X>
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

getPropertyName

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

Specified by:
getPropertyName in interface WeldMethod<T,X>
Returns:
The name

toString

public java.lang.String toString()
Description copied from class: AbstractWeldMember
Gets a string representation of the member

Overrides:
toString in class AbstractWeldMember<T,X,java.lang.reflect.Method>
Returns:
A string representation

getSignature

public MethodSignature getSignature()
Specified by:
getSignature in interface WeldMethod<T,X>

getParameters

public java.util.List<javax.enterprise.inject.spi.AnnotatedParameter<X>> getParameters()
Specified by:
getParameters in interface javax.enterprise.inject.spi.AnnotatedCallable<X>


Copyright © 2008-2009 Seam Framework. All Rights Reserved.