Metadata (Grails 2.4.4)
Date: 2014-10-28

Package: grails.util

## [Java] Class Metadata

- grails.util.Metadata

- Represents the application Metadata and loading mechanics.

  Authors:
    Graeme Rocher
  Since:
    1.1

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

  - ### Methods Summary

    Methods
    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
    `java.util.Map<java.lang.String, java.lang.String>` | `getInstalledPlugins()` Obtains a map (name->version) of installed plugins specified in the project metadata
    `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.
    `java.io.File` | `getMetadataFile()`
    `java.lang.String` | `getServletVersion()` @return The version of the servlet spec the application was created for
    `boolean` | `isWarDeployed()` @return true if this application is deployed as a WAR
    `java.util.Enumeration` | `keys()` Overrides, called by the store method.
    `void` | `persist()` Saves the current state of the Metadata object.
    `boolean` | `propertiesHaveNotChanged()` @return Returns true if these properties have not changed since they were loaded
    `java.lang.Object` | `put(java.lang.Object key, java.lang.Object o2)`
    `static Metadata` | `reload()` Reloads the application metadata.
    `static void` | `reset()` Resets the current state of the Metadata so it is re-read.
    `void` | `setGrailsVersion(java.lang.String version)`
    `void` | `setServletVersion(java.lang.String servletVersion)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.util.Properties` | `java.util.Properties#setProperty(java.lang.String, java.lang.String), java.util.Properties#getProperty(java.lang.String, java.lang.String), java.util.Properties#getProperty(java.lang.String), java.util.Properties#load(java.io.Reader), java.util.Properties#load(java.io.InputStream), java.util.Properties#list(java.io.PrintWriter), java.util.Properties#list(java.io.PrintStream), java.util.Properties#save(java.io.OutputStream, java.lang.String), java.util.Properties#store(java.io.OutputStream, java.lang.String), java.util.Properties#store(java.io.Writer, java.lang.String), java.util.Properties#loadFromXML(java.io.InputStream), java.util.Properties#storeToXML(java.io.OutputStream, java.lang.String), java.util.Properties#storeToXML(java.io.OutputStream, java.lang.String, java.lang.String), java.util.Properties#propertyNames(), java.util.Properties#stringPropertyNames(), java.util.Properties#remove(java.lang.Object), java.util.Properties#get(java.lang.Object), java.util.Properties#put(java.lang.Object, java.lang.Object), java.util.Properties#equals(java.lang.Object), java.util.Properties#toString(), java.util.Properties#values(), java.util.Properties#hashCode(), java.util.Properties#clone(), java.util.Properties#clear(), java.util.Properties#isEmpty(), java.util.Properties#contains(java.lang.Object), java.util.Properties#size(), java.util.Properties#entrySet(), java.util.Properties#putAll(java.util.Map), java.util.Properties#elements(), java.util.Properties#keys(), java.util.Properties#keySet(), java.util.Properties#containsValue(java.lang.Object), java.util.Properties#containsKey(java.lang.Object), java.util.Properties#wait(long, int), java.util.Properties#wait(long), java.util.Properties#wait(), java.util.Properties#getClass(), java.util.Properties#notify(), java.util.Properties#notifyAll()`
    `class java.util.Hashtable` | `java.util.Hashtable#remove(java.lang.Object), java.util.Hashtable#get(java.lang.Object), java.util.Hashtable#put(java.lang.Object, java.lang.Object), java.util.Hashtable#equals(java.lang.Object), java.util.Hashtable#toString(), java.util.Hashtable#values(), java.util.Hashtable#hashCode(), java.util.Hashtable#clone(), java.util.Hashtable#clear(), java.util.Hashtable#isEmpty(), java.util.Hashtable#contains(java.lang.Object), java.util.Hashtable#size(), java.util.Hashtable#entrySet(), java.util.Hashtable#putAll(java.util.Map), java.util.Hashtable#elements(), java.util.Hashtable#keys(), java.util.Hashtable#keySet(), java.util.Hashtable#containsValue(java.lang.Object), java.util.Hashtable#containsKey(java.lang.Object), java.util.Hashtable#wait(long, int), java.util.Hashtable#wait(long), java.util.Hashtable#wait(), java.util.Hashtable#getClass(), java.util.Hashtable#notify(), java.util.Hashtable#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 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

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

      Returns:
        The application name

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

      Returns:
        The application version

    - #### public static Metadata getCurrent()

      Returns:
        the metadata for the current application

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

      Returns:
        The environment the application expects to run in

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

      Returns:
        The Grails version used to build the application

    - #### public java.util.Map<java.lang.String, java.lang.String> getInstalledPlugins()

      Obtains a map (name->version) of installed plugins specified in the project metadata

      Returns:
        A map of installed plugins

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

      Loads a Metadata instance from a Reader

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

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

    - #### public java.io.File getMetadataFile()

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

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

    - #### public boolean isWarDeployed()

      Returns:
        true if this application is deployed as a WAR

    - #### @java.lang.Override @java.lang.SuppressWarnings({"unchecked","rawtypes"}) public java.util.Enumeration keys()

      Overrides, called by the store method.

    - #### public void persist()

      Saves the current state of the Metadata object.

    - #### public boolean propertiesHaveNotChanged()

      Returns:
        Returns true if these properties have not changed since they were loaded

    - #### @java.lang.Override public java.lang.Object put(java.lang.Object key, java.lang.Object o2)

    - #### public static Metadata reload()

      Reloads the application metadata.

      Returns:
        The metadata object

    - #### public static void reset()

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

    - #### public void setGrailsVersion(java.lang.String version)

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