Class Invoker
java.lang.Object
org.apache.maven.shared.transfer.collection.internal.Invoker
Invokes method on objects using reflection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Note: Ensure that argClasses and args have the same number of elementsstatic <T> T
static <T> T
-
Constructor Details
-
Invoker
private Invoker()
-
-
Method Details
-
invoke
- Throws:
DependencyCollectionException
-
invoke
public static <T> T invoke(Class<?> objectClazz, String staticMethod, Class<?> argClazz, Object arg) throws DependencyCollectionException - Throws:
DependencyCollectionException
-
invoke
public static <T> T invoke(Class<?> objectClazz, String staticMethod, Class<?>[] argClasses, Object[] args) throws DependencyCollectionException Note: Ensure that argClasses and args have the same number of elements- Parameters:
objectClazz
- the class of the static methodstaticMethod
- the static method to callargClasses
- the classes of the argument, used to select the right static methodargs
- the actual arguments to be passed- Returns:
- the result of the method invocation
- Throws:
DependencyCollectionException
- if any checked exception occurs
-