Package lumis.util.reflection
Class ReflectionUtil
- java.lang.Object
-
- lumis.util.reflection.ReflectionUtil
-
public class ReflectionUtil extends java.lang.Object
Reflection utilities.- Since:
- 16.0.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description ReflectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.reflect.Method
getFrameworkMethodReference(java.lang.String className, java.lang.String methodName, java.lang.Class<?>... parameters)
Returns a LumisXP framework method reference.static <T> T
invokeFrameworkStaticMethod(java.lang.String className, java.lang.String methodName, java.lang.Class<?>[] parameters, java.lang.Object[] args)
Invokes a framework static method.static <T> T
invokeFrameworkStaticMethod(java.lang.String className, java.lang.String methodName, java.lang.Object[] args)
Invokes a framework static method.
-
-
-
Method Detail
-
getFrameworkMethodReference
public static java.lang.reflect.Method getFrameworkMethodReference(java.lang.String className, java.lang.String methodName, java.lang.Class<?>... parameters)
Returns a LumisXP framework method reference. This method assumes the requested method must exist. If it doesn't, an exception will be raised.- Parameters:
className
- the class that has the requested methodmethodName
- the method nameparameters
- the method parameters- Returns:
- the method reference.
- Since:
- 16.0.0
-
invokeFrameworkStaticMethod
public static <T> T invokeFrameworkStaticMethod(java.lang.String className, java.lang.String methodName, java.lang.Class<?>[] parameters, java.lang.Object[] args) throws PortalException
Invokes a framework static method.- Type Parameters:
T
- the method return type- Parameters:
className
- the class that has the requested methodmethodName
- the method nameparameters
- the method parametersargs
- the method arguments- Returns:
- the method return value
- Throws:
PortalException
- Since:
- 16.1.0
-
invokeFrameworkStaticMethod
public static <T> T invokeFrameworkStaticMethod(java.lang.String className, java.lang.String methodName, java.lang.Object[] args) throws PortalException
Invokes a framework static method. LikeinvokeFrameworkStaticMethod(String, String, Object[])
, but infers the method parameters types from the arguments. In this case, all arguments must be non-null.- Type Parameters:
T
- the method return type- Parameters:
className
- the class that has the requested methodmethodName
- the method nameargs
- the method arguments- Returns:
- the method return value
- Throws:
PortalException
- Since:
- 16.1.0
-
-