|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
java.util.Properties
griffon.util.Metadata
public class Metadata extends Properties
Represents the application Metadata and loading mechanics
Nested Class Summary | |
---|---|
static class |
Metadata.FinalReference
|
Field Summary | |
---|---|
static String |
APPLICATION_GRIFFON_VERSION
|
static String |
APPLICATION_NAME
|
static String |
APPLICATION_TOOLKIT
|
static String |
APPLICATION_VERSION
|
static String |
FILE
|
static String |
GRIFFON_START_DIR
|
static String |
GRIFFON_WORKING_DIR
|
private static Pattern |
SKIP_PATTERN
|
private boolean |
initialized
|
private static Reference |
metadata
|
private File |
metadataFile
|
Constructor Summary | |
private Metadata()
|
|
private Metadata(File f)
|
Method Summary | |
---|---|
private static void
|
closeQuietly(Closeable c)
|
private static InputStream
|
fetchApplicationProperties(ClassLoader classLoader)
|
String
|
getApplicationName()
@return The application name |
String
|
getApplicationToolkit()
@return Supported toolkit by this application |
String
|
getApplicationVersion()
@return The application version |
Map
|
getArchetype()
|
static Metadata
|
getCurrent()
@return Returns the metadata for the current application |
String
|
getEnvironment()
@return The environment the application expects to run in |
String
|
getGriffonStartDir()
Returns the application's starting directory. |
String
|
getGriffonStartDirSafe()
Returns ia non-null value for the application's starting directory. |
String
|
getGriffonVersion()
@return The Griffon version used to build the application |
File
|
getGriffonWorkingDir()
@return The application working directory |
Map
|
getInstalledPlugins()
Obtains a map (name->version) of installed plugins specified in the project metadata |
static Metadata
|
getInstance(InputStream inputStream)
Loads a Metadata instance from a Reader |
static Metadata
|
getInstance(File file)
Loads and returns a new Metadata object for the given File |
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 |
static Metadata
|
reload()
Reloads the application metadata |
static void
|
reset()
Resets the current state of the Metadata so it is re-read |
Methods inherited from class Properties | |
---|---|
setProperty, getProperty, getProperty, load, load, list, list, save, store, store, loadFromXML, storeToXML, storeToXML, propertyNames, stringPropertyNames, get, put, equals, toString, values, hashCode, clone, clear, isEmpty, contains, size, entrySet, putAll, remove, elements, keys, keySet, containsValue, containsKey, wait, wait, wait, getClass, notify, notifyAll |
Methods inherited from class Hashtable | |
---|---|
get, put, equals, toString, values, hashCode, clone, clear, isEmpty, contains, size, entrySet, putAll, remove, elements, keys, keySet, containsValue, containsKey, wait, wait, wait, getClass, notify, notifyAll |
Field Detail |
---|
public static final String APPLICATION_GRIFFON_VERSION
public static final String APPLICATION_NAME
public static final String APPLICATION_TOOLKIT
public static final String APPLICATION_VERSION
public static final String FILE
public static final String GRIFFON_START_DIR
public static final String GRIFFON_WORKING_DIR
private static final Pattern SKIP_PATTERN
private boolean initialized
private static Reference metadata
private File metadataFile
Constructor Detail |
---|
private Metadata()
private Metadata(File f)
Method Detail |
---|
private static void closeQuietly(Closeable c)
private static InputStream fetchApplicationProperties(ClassLoader classLoader)
public String getApplicationName()
public String getApplicationToolkit()
public String getApplicationVersion()
public Map getArchetype()
public static Metadata getCurrent()
public String getEnvironment()
public String getGriffonStartDir()
The value comes from the System property 'griffon.start.dir' if set. Result may be null.
public String getGriffonStartDirSafe()
the path to new File(".") if that path is writable, returns the value of 'user.dir' otherwise.
public String getGriffonVersion()
public File getGriffonWorkingDir()
public Map getInstalledPlugins()
public static Metadata getInstance(InputStream inputStream)
inputStream
- The InputStream
public static Metadata getInstance(File file)
file
- The File
@SuppressWarnings("unchecked") public Enumeration keys()
public void persist()
public boolean propertiesHaveNotChanged()
public static Metadata reload()
public static void reset()
Groovy Documentation