Class ReflectionUtil


  • public class ReflectionUtil
    extends java.lang.Object
    Utilities for Managing Serialization and Reflection
    Version:
    $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
    Author:
    Jacob Hookom [jacob@hookom.net]
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String[] EMPTY_STRING  
      protected static java.lang.String[] PRIMITIVE_NAMES  
      protected static java.lang.Class[] PRIMITIVES  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.reflect.Method findMethod​(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>[] paramTypes, java.lang.Object[] paramValues)  
      static java.lang.Class forName​(java.lang.String name)  
      protected static java.lang.Class forNamePrimitive​(java.lang.String name)  
      static java.beans.PropertyDescriptor getPropertyDescriptor​(java.lang.Object base, java.lang.Object property)  
      static java.lang.Object invokeMethod​(javax.el.ELContext context, java.lang.reflect.Method m, java.lang.Object base, java.lang.Object[] params)  
      static java.lang.Class[] toTypeArray​(java.lang.String[] s)
      Converts an array of Class names to Class types
      static java.lang.String[] toTypeNameArray​(java.lang.Class[] c)
      Converts an array of Class types to Class names
      • Methods inherited from class java.lang.Object

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

      • EMPTY_STRING

        protected static final java.lang.String[] EMPTY_STRING
      • PRIMITIVE_NAMES

        protected static final java.lang.String[] PRIMITIVE_NAMES
      • PRIMITIVES

        protected static final java.lang.Class[] PRIMITIVES
    • Method Detail

      • forName

        public static java.lang.Class forName​(java.lang.String name)
                                       throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • forNamePrimitive

        protected static java.lang.Class forNamePrimitive​(java.lang.String name)
      • toTypeArray

        public static java.lang.Class[] toTypeArray​(java.lang.String[] s)
                                             throws java.lang.ClassNotFoundException
        Converts an array of Class names to Class types
        Parameters:
        s -
        Returns:
        The array of Classes
        Throws:
        java.lang.ClassNotFoundException
      • toTypeNameArray

        public static java.lang.String[] toTypeNameArray​(java.lang.Class[] c)
        Converts an array of Class types to Class names
        Parameters:
        c -
        Returns:
        The array of Classes
      • getPropertyDescriptor

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

        public static java.lang.Object invokeMethod​(javax.el.ELContext context,
                                                    java.lang.reflect.Method m,
                                                    java.lang.Object base,
                                                    java.lang.Object[] params)
      • findMethod

        public static java.lang.reflect.Method findMethod​(java.lang.Class<?> clazz,
                                                          java.lang.String methodName,
                                                          java.lang.Class<?>[] paramTypes,
                                                          java.lang.Object[] paramValues)