org.apache.struts2.el.util

## Class ReflectionUtil

- java.lang.Object
- - org.apache.struts2.el.util.ReflectionUtil

-     public class ReflectionUtil
      extends Object

  Utilities for Managing Serialization and Reflection
  Version:
    $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
  Author:
    Jacob Hookom [jacob@hookom.net]

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String[]` | `EMPTY_STRING`
    `protected static String[]` | `PRIMITIVE_NAMES`
    `protected static Class[]` | `PRIMITIVES`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Class` | `forName(String name)`
    `protected static Class` | `forNamePrimitive(String name)`
    `static Method` | `getMethod(Object base, Object property, Class[] paramTypes)` Returns a method based on the criteria
    `static PropertyDescriptor` | `getPropertyDescriptor(Object base, Object property)`
    `protected static String` | `paramString(Class[] types)`
    `static Class[]` | `toTypeArray(String[] s)` Converts an array of Class names to Class types
    `static String[]` | `toTypeNameArray(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 String[] EMPTY_STRING

    - #### PRIMITIVE_NAMES

          protected static final String[] PRIMITIVE_NAMES

    - #### PRIMITIVES

          protected static final Class[] PRIMITIVES

  - ### Method Detail

    - #### forName

          public static Class forName(String name)
                               throws ClassNotFoundException

      Throws:
        `ClassNotFoundException`

    - #### forNamePrimitive

          protected static Class forNamePrimitive(String name)

    - #### toTypeArray

          public static Class[] toTypeArray(String[] s)
                                     throws ClassNotFoundException

      Converts an array of Class names to Class types
      Parameters:
        `s` - array of class names
      Returns:
        array of class types
      Throws:
        `ClassNotFoundException` - if class was not found

    - #### toTypeNameArray

          public static String[] toTypeNameArray(Class[] c)

      Converts an array of Class types to Class names
      Parameters:
        `c` - array of class types
      Returns:
        array of class names

    - #### getMethod

          public static Method getMethod(Object base,
                                         Object property,
                                         Class[] paramTypes)
                                  throws javax.el.MethodNotFoundException

      Returns a method based on the criteria
      Parameters:
        `base` - the object that owns the method
        `property` - the name of the method
        `paramTypes` - the parameter types to use
      Returns:
        the method specified
      Throws:
        `javax.el.MethodNotFoundException` - if method was not found

    - #### paramString

          protected static final String paramString(Class[] types)

    - #### getPropertyDescriptor

          public static PropertyDescriptor getPropertyDescriptor(Object base,
                                                                 Object property)
                                                          throws javax.el.ELException,
                                                                 javax.el.PropertyNotFoundException

      Parameters:
        `base` - object
        `property` - property
      Returns:
        property descriptor
      Throws:
        `javax.el.ELException` - in case of EL errors
        `javax.el.PropertyNotFoundException` - if property was not found

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.