public interface NinjaProperties
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONF_FILE_LOCATION_BY_CONVENTION
The default configuration.
|
static java.lang.String |
NINJA_EXTERNAL_CONF
Often you may want to use a separate configuration file.
|
static java.lang.String |
NINJA_EXTERNAL_RELOAD
The System property used to enable hot-reloading of the external
configuration file at runtime.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String key)
Get a String property or null if it is not there...
|
java.util.Properties |
getAllCurrentNinjaProperties() |
java.lang.Boolean |
getBoolean(java.lang.String key) |
java.lang.Boolean |
getBooleanOrDie(java.lang.String key)
The "die" method forces this key to be set.
|
java.lang.Boolean |
getBooleanWithDefault(java.lang.String key,
java.lang.Boolean defaultValue)
Get a Boolean property or a default value when property cannot be found
in any configuration file.
|
java.lang.String |
getContextPath()
Returns context under which the application is currently running.
|
java.lang.Integer |
getInteger(java.lang.String key)
Get a property as Integer of null if not there / or property no integer
|
java.lang.Integer |
getIntegerOrDie(java.lang.String key)
The "die" method forces this key to be set.
|
java.lang.Integer |
getIntegerWithDefault(java.lang.String key,
java.lang.Integer defaultValue)
Get a Integer property or a default value when property cannot be found
in any configuration file.
|
java.lang.String |
getOrDie(java.lang.String key)
The "die" method forces this key to be set.
|
java.lang.String[] |
getStringArray(java.lang.String key)
eg.
|
java.lang.String |
getWithDefault(java.lang.String key,
java.lang.String defaultValue)
Get a String property or a default value when property cannot be found in
any configuration file.
|
boolean |
isDev()
Whether we are in dev mode
|
boolean |
isProd()
Whether we are in prod mode
|
boolean |
isTest()
Whether we are in test mode
|
void |
setContextPath(java.lang.String contextPath) |
static final java.lang.String NINJA_EXTERNAL_CONF
static final java.lang.String NINJA_EXTERNAL_RELOAD
static final java.lang.String CONF_FILE_LOCATION_BY_CONVENTION
java.lang.String get(java.lang.String key)
key
- java.lang.String getWithDefault(java.lang.String key, java.lang.String defaultValue)
key
- the key used in the configuration file.defaultValue
- Default value returned, when value cannot be found in
configuration.java.lang.Integer getInteger(java.lang.String key)
key
- java.lang.Integer getIntegerWithDefault(java.lang.String key, java.lang.Integer defaultValue)
key
- the key used in the configuration file.defaultValue
- Default value returned, when value cannot be found in
configuration.java.lang.Boolean getBoolean(java.lang.String key)
key
- java.lang.Boolean getBooleanWithDefault(java.lang.String key, java.lang.Boolean defaultValue)
key
- the key used in the configuration file.defaultValue
- Default value returned, when value cannot be found in
configuration.java.lang.Boolean getBooleanOrDie(java.lang.String key)
key
- java.lang.Integer getIntegerOrDie(java.lang.String key)
key
- java.lang.String getOrDie(java.lang.String key)
key
- java.lang.String[] getStringArray(java.lang.String key)
boolean isDev()
boolean isTest()
boolean isProd()
java.lang.String getContextPath()
void setContextPath(java.lang.String contextPath)
java.util.Properties getAllCurrentNinjaProperties()
Copyright © 2016 ninjaframework. All Rights Reserved.