Package org.jboss.weld.annotated.runtime
Class InvokableAnnotatedMethod<T>
- java.lang.Object
-
- org.jboss.weld.util.annotated.ForwardingAnnotated
-
- org.jboss.weld.util.annotated.ForwardingAnnotatedMember<X>
-
- org.jboss.weld.util.annotated.ForwardingAnnotatedCallable<X>
-
- org.jboss.weld.util.annotated.ForwardingAnnotatedMethod<T>
-
- org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod<T>
-
- All Implemented Interfaces:
Annotated,AnnotatedCallable<T>,AnnotatedMember<T>,AnnotatedMethod<T>
public class InvokableAnnotatedMethod<T> extends ForwardingAnnotatedMethod<T>
An implementation ofAnnotatedMethodused at runtime for invoking Java methods.- Author:
- Jozef Hartinger
-
-
Constructor Summary
Constructors Constructor Description InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedMethod<T>delegate()<X> Xinvoke(Object instance, Object... parameters)Invokes the method<X> XinvokeOnInstance(Object instance, Object... parameters)Invokes the method on the class of the passed instance, not the declaring class.static <T> InvokableAnnotatedMethod<T>of(AnnotatedMethod<T> delegate)-
Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedMethod
getJavaMember
-
Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedCallable
getParameters
-
Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedMember
getDeclaringType, isStatic
-
Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotated
equals, getAnnotation, getAnnotations, getBaseType, getTypeClosure, hashCode, isAnnotationPresent, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresent
-
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedCallable
getParameters
-
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedMember
getDeclaringType, isStatic
-
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedMethod
getAnnotations
-
-
-
-
Constructor Detail
-
InvokableAnnotatedMethod
public InvokableAnnotatedMethod(AnnotatedMethod<T> annotatedMethod)
-
-
Method Detail
-
of
public static <T> InvokableAnnotatedMethod<T> of(AnnotatedMethod<T> delegate)
-
invoke
public <X> X invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
Invokes the method- Parameters:
instance- The instance to invokeparameters- The method parameters- Returns:
- A reference to the instance
- Throws:
IllegalArgumentExceptionIllegalAccessExceptionInvocationTargetException
-
invokeOnInstance
public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
Invokes the method on the class of the passed instance, not the declaring class. Useful with proxies- Parameters:
instance- The instance to invokemanager- The Bean manager- Returns:
- A reference to the instance
- Throws:
IllegalArgumentExceptionSecurityExceptionIllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
delegate
public AnnotatedMethod<T> delegate()
- Specified by:
delegatein classForwardingAnnotatedMethod<T>
-
-