Class ReflectionUtil


  • public class ReflectionUtil
    extends java.lang.Object
    Reflection utilities.
    Since:
    16.0.0
    Version:
    $Revision: 26156 $ $Date: 2024-01-13 10:26:46 -0300 (Sat, 13 Jan 2024) $
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReflectionUtil

        public ReflectionUtil()
    • 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 method
        methodName - the method name
        parameters - 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 method
        methodName - the method name
        parameters - the method parameters
        args - 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. Like invokeFrameworkStaticMethod(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 method
        methodName - the method name
        args - the method arguments
        Returns:
        the method return value
        Throws:
        PortalException
        Since:
        16.1.0