|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum
griffon.util.Environment
public enum Environment extends Enum
An enum that represents the current environment
Nested Class Summary | |
---|---|
private static class |
Environment.EnvironmentBlockEvaluator
|
Enum Constant Summary | |
---|---|
CUSTOM
|
|
DEVELOPMENT
|
|
PRODUCTION
|
|
TEST
|
Field Summary | |
---|---|
static String |
DEFAULT
Constants that indicates whether this GriffonApplication is running in the default environment |
private static String |
DEVELOPMENT_ENVIRONMENT_SHORT_NAME
|
static String |
KEY
An enum that represents the current environment |
private static String |
PRODUCTION_ENV_SHORT_NAME
|
private static String |
TEST_ENVIRONMENT_SHORT_NAME
|
private static Map |
envNameMappings
|
private String |
name
|
Method Summary | |
---|---|
private static Environment.EnvironmentBlockEvaluator
|
evaluateEnvironmentSpecificBlock(Environment environment, Closure closure)
|
static Object
|
executeForCurrentEnvironment(Closure closure)
Takes an environment specific DSL block like: |
static Object
|
executeForEnvironment(Environment env, Closure closure)
Takes an environment specific DSL block like: |
static Environment
|
getCurrent()
Returns the current environment which is typcally either DEVELOPMENT, PRODUCTION or TEST. |
static Environment
|
getCurrentEnvironment()
@see #getCurrent() |
static Environment
|
getEnvironment(String shortName)
Returns the environment for the given short name |
static Closure
|
getEnvironmentSpecificBlock(Closure closure)
Takes an environment specific DSL block like: |
static Closure
|
getEnvironmentSpecificBlock(Environment env, Closure closure)
Takes an environment specific DSL block like: |
String
|
getName()
@return The name of the environment |
private static boolean
|
isBlank(String value)
|
static boolean
|
isSystemSet()
@return Return true if the environment has been set as a System property |
void
|
setName(String name)
|
Environment
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
Environment[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class Enum | |
---|---|
name, equals, toString, hashCode, compareTo, compareTo, valueOf, getDeclaringClass, ordinal, wait, wait, wait, getClass, notify, notifyAll |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Enum Constant Detail |
---|
Environment CUSTOM
Environment DEVELOPMENT
Environment PRODUCTION
Environment TEST
Field Detail |
---|
public static final String DEFAULT
private static final String DEVELOPMENT_ENVIRONMENT_SHORT_NAME
public static final String KEY
private static final String PRODUCTION_ENV_SHORT_NAME
private static final String TEST_ENVIRONMENT_SHORT_NAME
private static Map envNameMappings
private String name
Method Detail |
---|
private static Environment.EnvironmentBlockEvaluator evaluateEnvironmentSpecificBlock(Environment environment, Closure closure)
public static Object executeForCurrentEnvironment(Closure closure)
environments {
development {}
production {}
}
And executes the closure that relates to the current environment
closure
- The top level closure
public static Object executeForEnvironment(Environment env, Closure closure)
environments {
development {}
production {}
}
And executes the closure that relates to the specified environment
env
- The environment to useclosure
- The top level closure
public static Environment getCurrent()
public static Environment getCurrentEnvironment()
public static Environment getEnvironment(String shortName)
shortName
- The short name
public static Closure getEnvironmentSpecificBlock(Closure closure)
environments {
development {}
production {}
}
And returns the closure that relates to the current environment
closure
- The top level closure
public static Closure getEnvironmentSpecificBlock(Environment env, Closure closure)
environments {
development {}
production {}
}
And returns the closure that relates to the specified
env
- The environment to useclosure
- The top level closure
public String getName()
private static boolean isBlank(String value)
public static boolean isSystemSet()
public void setName(String name)
Environment valueOf(String name)
Environment[] values()
Groovy Documentation