Metadata (Grails 5.1.2)

Package: grails.util

## [Groovy] Class Metadata

- grails.util.Metadata

-     @groovy.transform.CompileStatic
      class Metadata
      extends io.micronaut.context.env.PropertySourcePropertyResolver

  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_APPLICATION_NAME` |
    `static java.lang.String` | `DEFAULT_SERVLET_VERSION` |
    `static java.lang.String` | `FILE` |
    `static java.lang.String` | `SERVLET_VERSION` |
    `static java.lang.String` | `WAR_DEPLOYED` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `java.lang.String` | `servletVersion`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `clear()`
    `` | `boolean` | `containsKey(java.lang.Object key)`
    `` | `java.lang.Object` | `get(java.lang.Object key)`
    `` | `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
    `` | `static Metadata` | `getInstance(java.io.File file)` Loads and returns a new Metadata object for the given File.
    `` | `static Metadata` | `getInstance(org.springframework.core.io.Resource file)` Loads and returns a new Metadata object for the given File.
    `` | `org.springframework.core.io.Resource` | `getMetadataFile()`
    `` | `java.lang.Object` | `getOrDefault(java.lang.Object key, java.lang.Object defaultValue)`
    `<T>` | `T` | `getProperty(java.lang.String key, java.lang.Class<T> targetType, T defaultValue)`
    `` | `java.lang.Object` | `getProperty(java.lang.String propertyName)`
    `<T>` | `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
    `` | `boolean` | `isDevelopmentEnvironmentAvailable()` Returns: True if the development sources are present
    `` | `boolean` | `isWarDeployed()` Returns: true if this application is deployed as a WAR
    `` | `java.lang.Object` | `navigate(java.lang.String[] path)`
    `` | `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 io.micronaut.context.env.PropertySourcePropertyResolver` | `io.micronaut.context.env.PropertySourcePropertyResolver#getAllProperties(io.micronaut.core.naming.conventions.StringConvention, io.micronaut.core.convert.format.MapFormat$MapTransformation), io.micronaut.context.env.PropertySourcePropertyResolver#containsProperties(java.lang.String), io.micronaut.context.env.PropertySourcePropertyResolver#addPropertySource(java.lang.String, java.util.Map), io.micronaut.context.env.PropertySourcePropertyResolver#addPropertySource(io.micronaut.context.env.PropertySource), io.micronaut.context.env.PropertySourcePropertyResolver#getPropertyEntries(java.lang.String), io.micronaut.context.env.PropertySourcePropertyResolver#containsProperty(java.lang.String), io.micronaut.context.env.PropertySourcePropertyResolver#getProperty(java.lang.String, io.micronaut.core.convert.ArgumentConversionContext), io.micronaut.context.env.PropertySourcePropertyResolver#getProperties(java.lang.String, io.micronaut.core.naming.conventions.StringConvention), io.micronaut.context.env.PropertySourcePropertyResolver#wait(long, int), io.micronaut.context.env.PropertySourcePropertyResolver#wait(long), io.micronaut.context.env.PropertySourcePropertyResolver#wait(), io.micronaut.context.env.PropertySourcePropertyResolver#equals(java.lang.Object), io.micronaut.context.env.PropertySourcePropertyResolver#toString(), io.micronaut.context.env.PropertySourcePropertyResolver#hashCode(), io.micronaut.context.env.PropertySourcePropertyResolver#getClass(), io.micronaut.context.env.PropertySourcePropertyResolver#notify(), io.micronaut.context.env.PropertySourcePropertyResolver#notifyAll(), io.micronaut.context.env.PropertySourcePropertyResolver#getRequiredProperty(java.lang.String, java.lang.Class), io.micronaut.context.env.PropertySourcePropertyResolver#get(java.lang.String, io.micronaut.core.convert.ArgumentConversionContext), io.micronaut.context.env.PropertySourcePropertyResolver#get(java.lang.CharSequence, io.micronaut.core.convert.ArgumentConversionContext), io.micronaut.context.env.PropertySourcePropertyResolver#getProperty(java.lang.String, java.lang.Class, io.micronaut.core.convert.ConversionContext), io.micronaut.context.env.PropertySourcePropertyResolver#getProperty(java.lang.String, io.micronaut.core.type.Argument), io.micronaut.context.env.PropertySourcePropertyResolver#getProperty(java.lang.String, java.lang.Class, java.lang.Object), io.micronaut.context.env.PropertySourcePropertyResolver#getProperty(java.lang.String, java.lang.Class), io.micronaut.context.env.PropertySourcePropertyResolver#getProperties(java.lang.String), io.micronaut.context.env.PropertySourcePropertyResolver#get(java.lang.CharSequence, java.lang.Class, java.lang.Object), io.micronaut.context.env.PropertySourcePropertyResolver#get(java.lang.CharSequence, io.micronaut.core.type.Argument), io.micronaut.context.env.PropertySourcePropertyResolver#get(java.lang.CharSequence, java.lang.Class)`

- - ### 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_APPLICATION_NAME

    - #### 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

  - ### Property Detail

    - #### java.lang.String servletVersion

  - ### Method Detail

    - #### void clear()

    - #### boolean containsKey(java.lang.Object key)

    - #### @java.lang.Deprecated java.lang.Object get(java.lang.Object key)

    - #### 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(org.springframework.core.io.Resource file)

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

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

    - #### org.springframework.core.io.Resource getMetadataFile()

    - #### java.lang.Object getOrDefault(java.lang.Object key, java.lang.Object defaultValue)

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

    - #### @java.lang.Deprecated java.lang.Object getProperty(java.lang.String propertyName)

    - #### <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

    - #### boolean isDevelopmentEnvironmentAvailable()

      Returns:
        True if the development sources are present

    - #### boolean isWarDeployed()

      Returns:
        true if this application is deployed as a WAR

    - #### @java.lang.Deprecated java.lang.Object navigate(java.lang.String[] path)

    - #### 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)