|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectUtils.SetSettings
public class SetSettings
Represents the value of settings. See Settings
for further
details of how settings are structured.
Constructor Summary | |
---|---|
SetSettings()
Default constructor |
Method Summary | |
---|---|
boolean |
addSetting(java.lang.String setting,
java.lang.String value)
Adds a new root level setting |
boolean |
addSetting(java.lang.String group,
java.lang.String setting,
java.lang.String value)
Adds a new setting within a group |
static SetSettings |
fromFile(java.io.File f)
Reads settings from a file and returns an instance of this class. |
static SetSettings |
fromFileAndCommandLine(java.io.File f,
java.lang.String[] c)
Returns settings from a file and the command line and returns an instance of this class. |
java.util.Set<java.lang.String> |
getGroups()
Gets the set of all groups that have had a setting set within them |
java.util.Set<java.lang.String> |
getSet()
Gets the set of root level settings that have been set |
java.util.Set<java.lang.String> |
getSet(java.lang.String group)
Gets the set of settings that have been set within a group |
java.lang.String |
getSetting(java.lang.String setting)
Gets the value of a root level setting |
java.lang.String |
getSetting(java.lang.String group,
java.lang.String setting)
Gets the value of a setting within a group |
boolean |
isSet(java.lang.String setting)
Tests whether a root level setting has been set |
boolean |
isSet(java.lang.String group,
java.lang.String setting)
Tests whether a setting within a groups has been set |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SetSettings()
Method Detail |
---|
public boolean addSetting(java.lang.String setting, java.lang.String value)
setting
- The setting namevalue
- The value to set the setting to
public boolean addSetting(java.lang.String group, java.lang.String setting, java.lang.String value)
group
- The group namesetting
- The setting namevalue
- The value to set the setting to
public java.lang.String getSetting(java.lang.String setting)
setting
- The setting's name
public java.lang.String getSetting(java.lang.String group, java.lang.String setting)
group
- The group's namesetting
- The setting's name
public java.util.Set<java.lang.String> getGroups()
public java.util.Set<java.lang.String> getSet()
public java.util.Set<java.lang.String> getSet(java.lang.String group)
group
- The group's name
public boolean isSet(java.lang.String setting)
setting
- The setting's name
public boolean isSet(java.lang.String group, java.lang.String setting)
group
- The group's namesetting
- The setting's anme
public java.lang.String toString()
toString
in class java.lang.Object
public static SetSettings fromFile(java.io.File f) throws java.io.FileNotFoundException, java.io.IOException, SettingException
f
- The file name
java.io.FileNotFoundException
- If the settings file is not found
java.io.IOException
- If there is a problem reading from the settings file
SettingException
- If there is a line in an unexpected formatpublic static SetSettings fromFileAndCommandLine(java.io.File f, java.lang.String[] c) throws java.io.FileNotFoundException, java.io.IOException, SettingException
fromFile(java.io.File)
for file format. If
the value of a setting contains $i (where i is an integer) then it is
replaced by the ith element of c.
f
- The settings file namec
- An array of command line inputs
java.io.FileNotFoundException
- If the settings file is not found
java.io.IOException
- If there is a problem reading from the settings file
SettingException
- If there is a line in an unexpected format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |