Holders (Grails 4.0.3)
Date: 2020-04-03

Package: grails.util

## [Java] Class Holders

- grails.util.Holders

- Allows looking up key classes in a static context

  Authors:
    Burt Beckwith
    Graeme Rocher
  Since:
    2.0

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Config` | `config`
    `GrailsApplication` | `grailsApplication`
    `GrailsPluginManager` | `pluginManager`
    `GrailsPluginManager` | `pluginManager`
    `java.lang.Object` | `servletContext`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static void` | `addApplicationDiscoveryStrategy(GrailsApplicationDiscoveryStrategy strategy)`
    `` | `static void` | `clear()`
    `` | `static GrailsPluginManager` | `currentPluginManager()`
    `` | `static GrailsApplication` | `findApplication()` @return The ApplicationContext or null if it doesn't exist
    `` | `static org.springframework.context.ApplicationContext` | `findApplicationContext()` @return The ApplicationContext or null if it doesn't exist
    `` | `static org.springframework.context.ApplicationContext` | `getApplicationContext()`
    `` | `static Config` | `getConfig()`
    `` | `static java.util.Map<?, ?>` | `getFlatConfig()`
    `` | `static GrailsApplication` | `getGrailsApplication()`
    `` | `static GrailsPluginManager` | `getPluginManager()`
    `` | `static GrailsPluginManager` | `getPluginManager(boolean mappedOnly)`
    `` | `static java.lang.Object` | `getServletContext()`
    `` | `static void` | `reset()`
    `` | `static void` | `setConfig(Config config)`
    `` | `static void` | `setGrailsApplication(GrailsApplication application)`
    `` | `static void` | `setPluginManager(GrailsPluginManager pluginManager)`
    `` | `static void` | `setPluginManagerInCreation(boolean inCreation)`
    `` | `static void` | `setServletContext(java.lang.Object servletContext)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Property Detail

    - #### Config config

    - #### GrailsApplication grailsApplication

    - #### GrailsPluginManager pluginManager

    - #### java.lang.Object servletContext

  - ### Method Detail

    - #### public static void addApplicationDiscoveryStrategy(GrailsApplicationDiscoveryStrategy strategy)

    - #### public static void clear()

    - #### public static GrailsPluginManager currentPluginManager()

    - #### public static GrailsApplication findApplication()

      Returns:
        The ApplicationContext or null if it doesn't exist

    - #### public static org.springframework.context.ApplicationContext findApplicationContext()

      Returns:
        The ApplicationContext or null if it doesn't exist

    - #### public static org.springframework.context.ApplicationContext getApplicationContext()

    - #### public static Config getConfig()

    - #### public static java.util.Map<?, ?> getFlatConfig()

    - #### public static GrailsApplication getGrailsApplication()

    - #### public static GrailsPluginManager getPluginManager()

    - #### public static GrailsPluginManager getPluginManager(boolean mappedOnly)

    - #### public static java.lang.Object getServletContext()

    - #### public static void reset()

    - #### public static void setConfig(Config config)

    - #### public static void setGrailsApplication(GrailsApplication application)

    - #### public static void setPluginManager(GrailsPluginManager pluginManager)

    - #### public static void setPluginManagerInCreation(boolean inCreation)

    - #### public static void setServletContext(java.lang.Object servletContext)