Package org.codehaus.groovy.reflection

# Class ReflectionCache

java.lang.Object
org.codehaus.groovy.reflection.ReflectionCache

public class ReflectionCache extends Object
Central registry for obtaining cached class information.

Provides factory methods for retrieving `CachedClass` instances for a given Java class. Maintains static references to commonly-used classes for efficient access.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final CachedClass`
  `OBJECT_ARRAY_CLASS`
  The cached representation of `Object[].class`.
  `static final CachedClass`
  `OBJECT_CLASS`
  The cached representation of `Object.class`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReflectionCache()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static CachedClass`
  `getCachedClass(Class klazz)`
  Retrieves the `CachedClass` for the given Java class.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### OBJECT_CLASS

    public static final CachedClass OBJECT_CLASS
    The cached representation of `Object.class`. Frequently accessed during type compatibility checks.

  - ### OBJECT_ARRAY_CLASS

    public static final CachedClass OBJECT_ARRAY_CLASS
    The cached representation of `Object[].class`. Used as the superclass for non-primitive array types.

- ## Constructor Details

  - ### ReflectionCache

    public ReflectionCache()

- ## Method Details

  - ### getCachedClass

    public static CachedClass getCachedClass(Class klazz)
    Retrieves the `CachedClass` for the given Java class. Returns `null` if the class is `null`.
    Parameters:
      `klazz` - the Java class for which to obtain cache information
    Returns:
      the cached class information, or `null` if `klazz` is `null`