Class Invoker
- java.lang.Object
-
- org.apache.maven.shared.transfer.dependencies.resolve.internal.Invoker
-
final class Invoker extends java.lang.Object
Invokes method on objects using reflection.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Invoker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
invoke(java.lang.Class<?> objectClazz, java.lang.String staticMethod, java.lang.Class<?>[] argClasses, java.lang.Object[] args)
Note: Ensure that argClasses and args have the same number of elementsstatic <T> T
invoke(java.lang.Class<?> objectClazz, java.lang.String staticMethod, java.lang.Class<?> argClazz, java.lang.Object arg)
static <T> T
invoke(java.lang.Object object, java.lang.String method)
-
-
-
Method Detail
-
invoke
public static <T> T invoke(java.lang.Object object, java.lang.String method) throws DependencyResolverException
- Throws:
DependencyResolverException
-
invoke
public static <T> T invoke(java.lang.Class<?> objectClazz, java.lang.String staticMethod, java.lang.Class<?> argClazz, java.lang.Object arg) throws DependencyResolverException
- Throws:
DependencyResolverException
-
invoke
public static <T> T invoke(java.lang.Class<?> objectClazz, java.lang.String staticMethod, java.lang.Class<?>[] argClasses, java.lang.Object[] args) throws DependencyResolverException
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:
DependencyResolverException
- if any checked exception occurs
-
-