|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.spaz.cron.CRONConfiguration
public final class CRONConfiguration
Method Summary | |
---|---|
void |
addPropertyValidator(PropertyValidator validator)
Add a PropertyValidator to the configuration. |
static CRONConfiguration |
getInstance()
Get the global singleton instance of the configuration manager |
java.lang.String |
getProperty(java.lang.String property)
Get a property from the configuration set. |
java.lang.String |
getProperty(java.lang.String property,
boolean expandEnv)
|
java.lang.String |
getProperty(java.lang.String property,
java.lang.String defaultValue)
Get a property from the configuration set, with a provided default value. |
java.lang.String |
getProperty(java.lang.String property,
java.lang.String defaultValue,
boolean expandEnv)
|
java.util.Set |
keySet()
Retrieve the set of all keys in both the user and system configurations. |
static void |
main(java.lang.String[] args)
The main method. |
void |
removePropertyValidator(PropertyValidator validator)
Remove a validator from the configuration. |
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
Sets the value of a property in the user configuration section. |
void |
setWriteOnChange(boolean writeOnChange)
Set this value to determine if the configuration manager should write to disk on every change to the configuration, or if it should wait until store() is called to proceed. |
boolean |
store()
Write the configuration to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final CRONConfiguration getInstance()
CRONConfiguration
.public java.lang.String setProperty(java.lang.String key, java.lang.String value)
writeOnChange
is true
, this will immediately commit
the change to the user config file. Otherwise, it will write to the
properties in memory, and the caller must invoke store()
to
write the configuration to permanent storage.
key
- The name of the property to set.value
- The new value of the property
null
,
if the property had not previously been set.public void addPropertyValidator(PropertyValidator validator)
PropertyValidator
to the configuration. This will be checked
against each time a property is set.
validator
- the validator.public void removePropertyValidator(PropertyValidator validator)
validator
- The validator to remove.public java.lang.String getProperty(java.lang.String property, java.lang.String defaultValue, boolean expandEnv)
public java.lang.String getProperty(java.lang.String property, boolean expandEnv)
public java.lang.String getProperty(java.lang.String property, java.lang.String defaultValue)
property
- The name of the property to retrieve.defaultValue
- The default value of the named property.
defaultValue
if none was set.public java.lang.String getProperty(java.lang.String property)
property
- The name of the property to retrieve.
null
if none was set.public void setWriteOnChange(boolean writeOnChange)
store()
is called to proceed.
writeOnChange
- Set to true
to enable writes, false
to disable.public boolean store()
true
if the write succeeded, false
if some
exception was thrown.public java.util.Set keySet()
Set
containing the union of the property keys in both
the user properties and system properties.public static void main(java.lang.String[] args)
args
- The command-line arguments for the application.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |