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>
An implementation of
AnnotatedMethod used at runtime for invoking Java methods.- Author:
- Jozef Hartinger
-
Constructor Summary
ConstructorsConstructorDescriptionInvokableAnnotatedMethod(jakarta.enterprise.inject.spi.AnnotatedMethod<T> annotatedMethod) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.enterprise.inject.spi.AnnotatedMethod<T>delegate()<X> XInvokes 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(jakarta.enterprise.inject.spi.AnnotatedMethod<T> delegate) Methods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedMethod
getJavaMemberMethods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedCallable
getParametersMethods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotatedMember
getDeclaringType, isStaticMethods inherited from class org.jboss.weld.util.annotated.ForwardingAnnotated
equals, getAnnotation, getAnnotations, getBaseType, getTypeClosure, hashCode, isAnnotationPresent, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jakarta.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresentMethods inherited from interface jakarta.enterprise.inject.spi.AnnotatedCallable
getParametersMethods inherited from interface jakarta.enterprise.inject.spi.AnnotatedMember
getDeclaringType, isStaticMethods inherited from interface jakarta.enterprise.inject.spi.AnnotatedMethod
getAnnotations
-
Constructor Details
-
InvokableAnnotatedMethod
-
-
Method Details
-
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:
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 invokeparameters- The method parameters- Returns:
- A reference to the instance
- Throws:
IllegalArgumentExceptionSecurityExceptionIllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
delegate
- Specified by:
delegatein classForwardingAnnotatedMethod<T>
-