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,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,Method>, WeldCallable<T,X,Method>, WeldMember<T,X,Method>, WeldMethod<T,X>

public class WeldMethodImpl<T,X>
extends AbstractWeldCallable<T,X,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.WeldCallable
MAPPED_PARAMETER_ANNOTATIONS
 
Fields inherited from interface org.jboss.weld.introspector.WeldAnnotated
MAPPED_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS
 
Method Summary
 Method getDelegate()
           
 List<javax.enterprise.inject.spi.AnnotatedParameter<X>> getParameters()
           
 Class<?>[] getParameterTypesAsArray()
          Get the parameter types as an array
 String getPropertyName()
          Gets the property name
 MethodSignature getSignature()
           
 List<WeldParameter<?,X>> getWeldParameters()
          Gets the abstracted parameters of the method
 List<WeldParameter<?,X>> getWeldParameters(Class<? extends Annotation> annotationType)
          Gets the list of annotated parameters for a given annotation
 T invoke(Object instance, Object... parameters)
          Invokes the method
 T invokeOnInstance(Object instance, Object... parameters)
          Invokes the method on the class of the passed instance, not the declaring class.
 boolean isEquivalent(Method method)
          Checks if a this is equivalent to a JLR method
 boolean isGeneric()
           
static
<T,X> WeldMethodImpl<T,X>
of(javax.enterprise.inject.spi.AnnotatedMethod<? super X> method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
           
static
<T,X> WeldMethodImpl<T,X>
of(Method method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
           
 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
addMetaAnnotations, addMetaAnnotations, buildAnnotationMap, buildAnnotationMap, getActualTypeArguments, getAnnotation, getAnnotations, getBaseType, getBindingsAsArray, getInterfaceClosure, getJavaClass, getMetaAnnotations, getQualifiers, getTypeClosure, isAnnotationPresent, isParameterizedType, isPrimitive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldMember
getDeclaringType
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getActualTypeArguments, getBindingsAsArray, getInterfaceClosure, getJavaClass, getMetaAnnotations, getName, getPackage, getQualifiers, isFinal, isPackagePrivate, isParameterizedType, isPrimitive, isPrivate, 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(Method method,
                                           WeldClass<X> declaringClass,
                                           ClassTransformer classTransformer)

of

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

getDelegate

public Method getDelegate()
Specified by:
getDelegate in class AbstractWeldAnnotated<T,Method>

getWeldParameters

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

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

getParameterTypesAsArray

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

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

getWeldParameters

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

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

isEquivalent

public boolean isEquivalent(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

invokeOnInstance

public T invokeOnInstance(Object instance,
                          Object... parameters)
                   throws IllegalArgumentException,
                          SecurityException,
                          IllegalAccessException,
                          InvocationTargetException,
                          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:
IllegalArgumentException
SecurityException
IllegalAccessException
InvocationTargetException
NoSuchMethodException

invoke

public T invoke(Object instance,
                Object... parameters)
         throws IllegalArgumentException,
                IllegalAccessException,
                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:
IllegalArgumentException
IllegalAccessException
InvocationTargetException

getPropertyName

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

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

toString

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

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

getSignature

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

getParameters

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

isGeneric

public boolean isGeneric()
Specified by:
isGeneric in interface WeldAnnotated<T,Method>


Copyright © 2013 Seam Framework. All Rights Reserved.