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:
jakarta.enterprise.inject.spi.Annotated
,jakarta.enterprise.inject.spi.AnnotatedCallable<T>
,jakarta.enterprise.inject.spi.AnnotatedMember<T>
,jakarta.enterprise.inject.spi.AnnotatedMethod<T>
public class InvokableAnnotatedMethod<T> extends ForwardingAnnotatedMethod<T>
An implementation ofAnnotatedMethod
used at runtime for invoking Java methods.- Author:
- Jozef Hartinger
-
-
Constructor Summary
Constructors Constructor Description InvokableAnnotatedMethod(jakarta.enterprise.inject.spi.AnnotatedMethod<T> annotatedMethod)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.enterprise.inject.spi.AnnotatedMethod<T>
delegate()
<X> X
invoke(Object instance, Object... parameters)
Invokes the method<X> X
invokeOnInstance(Object instance, Object... parameters)
Invokes the method on the class of the passed instance, not the declaring class.static <T> InvokableAnnotatedMethod<T>
of(jakarta.enterprise.inject.spi.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 jakarta.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresent
-
-
-
-
Constructor Detail
-
InvokableAnnotatedMethod
public InvokableAnnotatedMethod(jakarta.enterprise.inject.spi.AnnotatedMethod<T> annotatedMethod)
-
-
Method Detail
-
of
public static <T> InvokableAnnotatedMethod<T> of(jakarta.enterprise.inject.spi.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:
IllegalArgumentException
IllegalAccessException
InvocationTargetException
-
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:
IllegalArgumentException
SecurityException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
-
delegate
public jakarta.enterprise.inject.spi.AnnotatedMethod<T> delegate()
- Specified by:
delegate
in classForwardingAnnotatedMethod<T>
-
-