Package: grails.util

## [Groovy] Class Metadata

- grails.util.Metadata

- All Implemented Interfaces and Traits:
    ConfigMap

      @groovy.transform.CompileStatic
      class Metadata
      extends NavigableMap

  Represents the application Metadata and loading mechanics.

  Authors:
    Graeme Rocher
  Since:
    1.1

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `Metadata.FinalReference` |

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `APPLICATION_GRAILS_VERSION` |
    `static java.lang.String` | `APPLICATION_NAME` |
    `static java.lang.String` | `APPLICATION_VERSION` |
    `static java.lang.String` | `BUILD_INFO_FILE` |
    `static java.lang.String` | `DEFAULT_SERVLET_VERSION` |
    `static java.lang.String` | `FILE` |
    `static java.lang.String` | `SERVLET_VERSION` |
    `static java.lang.String` | `WAR_DEPLOYED` |

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `java.lang.String` | `getApplicationName()` @return The application name
    `` | `java.lang.String` | `getApplicationVersion()` @return The application version
    `` | `static Metadata` | `getCurrent()` @return the metadata for the current application
    `` | `java.lang.String` | `getEnvironment()` @return The environment the application expects to run in
    `` | `java.lang.String` | `getGrailsVersion()` @return The Grails version used to build the application
    `` | `static Metadata` | `getInstance(java.io.InputStream inputStream)` Loads a Metadata instance from a Reader
    `` | `static Metadata` | `getInstance(java.io.File file)` Loads and returns a new Metadata object for the given File.
    `` | `static Metadata` | `getInstance(Resource file)` Loads and returns a new Metadata object for the given File.
    `` | `Resource` | `getMetadataFile()`
    `<T>` | `T` | `getProperty(java.lang.String key, java.lang.Class<T> targetType)`
    `<T>` | `T` | `getProperty(java.lang.String key, java.lang.Class<T> targetType, T defaultValue)`
    `<T>` | `T` | `getRequiredProperty(java.lang.String key, java.lang.Class<T> targetType)`
    `` | `java.lang.String` | `getServletVersion()` @return The version of the servlet spec the application was created for
    `` | `java.lang.Object` | `getSource()` @return The source of the metadata
    `` | `boolean` | `isDevelopmentEnvironmentAvailable()` @return True if the development sources are present
    `` | `boolean` | `isWarDeployed()` @return true if this application is deployed as a WAR
    `` | `java.util.Iterator<Map.Entry<java.lang.String, java.lang.Object>>` | `iterator()`
    `` | `static Metadata` | `reload()` Reloads the application metadata.
    `` | `static void` | `reset()` Resets the current state of the Metadata so it is re-read.
    `` | `void` | `setServletVersion(java.lang.String servletVersion)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class NavigableMap` | `clear, clone, containsKey, containsValue, entrySet, equals, get, getAt, getProperty, hashCode, isEmpty, keySet, merge, mergeMapEntry, mergeMapEntry, navigate, navigateSubMap, put, putAll, remove, setAt, setProperty, size, toFlatConfig, toProperties, toString, values`
    `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()`

- - ### Field Detail

    - #### public static final java.lang.String APPLICATION_GRAILS_VERSION

    - #### public static final java.lang.String APPLICATION_NAME

    - #### public static final java.lang.String APPLICATION_VERSION

    - #### public static final java.lang.String BUILD_INFO_FILE

    - #### public static final java.lang.String DEFAULT_SERVLET_VERSION

    - #### public static final java.lang.String FILE

    - #### public static final java.lang.String SERVLET_VERSION

    - #### public static final java.lang.String WAR_DEPLOYED

  - ### Method Detail

    - #### java.lang.String getApplicationName()

      Returns:
        The application name

    - #### java.lang.String getApplicationVersion()

      Returns:
        The application version

    - #### static Metadata getCurrent()

      Returns:
        the metadata for the current application

    - #### java.lang.String getEnvironment()

      Returns:
        The environment the application expects to run in

    - #### java.lang.String getGrailsVersion()

      Returns:
        The Grails version used to build the application

    - #### static Metadata getInstance(java.io.InputStream inputStream)

      Loads a Metadata instance from a Reader

      Parameters:
        `inputStream` - The InputStream
      Returns:
        a Metadata instance

    - #### static Metadata getInstance(java.io.File file)

      Loads and returns a new Metadata object for the given File.

      Parameters:
        `file` - The File
      Returns:
        A Metadata object

    - #### static Metadata getInstance(Resource file)

      Loads and returns a new Metadata object for the given File.

      Parameters:
        `file` - The File
      Returns:
        A Metadata object

    - #### Resource getMetadataFile()

    - #### <T> @java.lang.Override T getProperty(java.lang.String key, java.lang.Class<T> targetType)

    - #### <T> @java.lang.Override T getProperty(java.lang.String key, java.lang.Class<T> targetType, T defaultValue)

    - #### <T> @java.lang.Override T getRequiredProperty(java.lang.String key, java.lang.Class<T> targetType)

    - #### java.lang.String getServletVersion()

      Returns:
        The version of the servlet spec the application was created for

    - #### java.lang.Object getSource()

      Returns:
        The source of the metadata

    - #### boolean isDevelopmentEnvironmentAvailable()

      Returns:
        True if the development sources are present

    - #### boolean isWarDeployed()

      Returns:
        true if this application is deployed as a WAR

    - #### @java.lang.Override java.util.Iterator<Map.Entry<java.lang.String, java.lang.Object>> iterator()

    - #### static Metadata reload()

      Reloads the application metadata.

      Returns:
        The metadata object

    - #### static void reset()

      Resets the current state of the Metadata so it is re-read.

    - #### void setServletVersion(java.lang.String servletVersion)