Class ReflectionUtil

java.lang.Object
org.glassfish.expressly.util.ReflectionUtil

public class ReflectionUtil extends Object
Utilities for Managing Serialization and Reflection
Version:
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
  • Field Details

    • EMPTY_STRING

      protected static final String[] EMPTY_STRING
    • PRIMITIVE_NAMES

      protected static final String[] PRIMITIVE_NAMES
    • PRIMITIVES

      protected static final Class<?>[] PRIMITIVES
  • Constructor Details

    • ReflectionUtil

      private ReflectionUtil()
  • Method Details

    • forName

      public static Class<?> forName(String name) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • forNamePrimitive

      protected static Class<?> forNamePrimitive(String name)
    • toTypeArray

      public static Class<?>[] toTypeArray(String[] classNames) throws ClassNotFoundException
      Converts an array of Class names to Class types
      Parameters:
      classNames -
      Returns:
      The array of Classes
      Throws:
      ClassNotFoundException
    • toTypeNameArray

      public static String[] toTypeNameArray(Class<?>[] classTypes)
      Converts an array of Class types to Class names
      Parameters:
      classTypes -
      Returns:
      The array of Classes
    • getPropertyDescriptor

      public static PropertyDescriptor getPropertyDescriptor(Object base, Object property) throws jakarta.el.ELException, jakarta.el.PropertyNotFoundException
      Parameters:
      base - The base object
      property - The property
      Returns:
      The PropertyDescriptor for the base with the given property
      Throws:
      jakarta.el.ELException
      jakarta.el.PropertyNotFoundException
    • invokeMethod

      public static Object invokeMethod(jakarta.el.ELContext context, Method method, Object base, Object[] params)
    • findMethod

      public static Method findMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes, Object[] paramValues)
    • findWrapper

      private static ReflectionUtil.Wrapper findWrapper(Class<?> clazz, List<ReflectionUtil.Wrapper> wrappers, String name, Class<?>[] requiredParamTypes, Object[] requiredParamValues)
    • getParamCount

      private static int getParamCount(Class<?>[] paramTypes)
    • findMostSpecificWrapper

      private static ReflectionUtil.Wrapper findMostSpecificWrapper(List<ReflectionUtil.Wrapper> candidates, Class<?>[] matchingTypes, boolean elSpecific, String errorMsg)
    • isMoreSpecific

      private static int isMoreSpecific(ReflectionUtil.Wrapper wrapper1, ReflectionUtil.Wrapper wrapper2, Class<?>[] matchingTypes, boolean elSpecific)
    • isMoreSpecific

      private static int isMoreSpecific(Class<?> type1, Class<?> type2, Class<?> matchingType, boolean elSpecific)
    • getBoxingTypeIfPrimitive

      private static Class<?> getBoxingTypeIfPrimitive(Class<?> clazz)
    • getComparingParamTypesForVarArgsMethod

      private static Class<?>[] getComparingParamTypesForVarArgsMethod(Class<?>[] paramTypes, int length)
    • paramString

      private static final String paramString(Class<?>[] types)
    • isAssignableFrom

      static boolean isAssignableFrom(Class<?> src, Class<?> target)
    • isCoercibleFrom

      private static boolean isCoercibleFrom(Object src, Class<?> target)
    • getTypesFromValues

      public static Class<?>[] getTypesFromValues(Object[] values)
    • getMethod

      static Method getMethod(Class<?> type, Method method)
    • getConstructor

      static Constructor<?> getConstructor(Class<?> type, Constructor<?> constructor)
    • buildParameters

      public static Object[] buildParameters(jakarta.el.ELContext context, Class<?>[] parameterTypes, boolean isVarArgs, Object[] params)