|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ReadOnlySettings
This interface provides read/only access to settings.
The structure is, that there is a category with any number of
key/value pairs inside.
A key is unique in one category but may occur several times in
different categories.
If a category of null is passed to any method, the default category
will be taken instead.
Apart from the interface each implementing class must provide a
public default constructor so that instance creation with newInstance()
is possible !
Additionaly the settings object can be named to distinguish between several
settings objects. The name also might be used to keep the source (e.g.
file name or URL) of the settings.
Each settings object can have another settings objects with default settings.
Whenever a setting can't be found in the main settings, it will be looked
up in the default settings. Of course this can be cascaded unlimited.
| Method Summary | |
|---|---|
java.lang.String[] |
getCategoryNames()
Returns an array of all currently known categories. |
ReadOnlySettings |
getDefaults()
Gets the defaults that are looked up, if a setting can't be found in the main settings object. |
java.lang.String[] |
getKeyNamesOf(java.lang.String categoryName)
Returns all currently known key names in the category with the specified name. |
java.lang.String[] |
getKeyNamesOfDefaultCategory()
Returns all currently known key names in the default category. |
java.lang.String |
getName()
Returns the name of the settings object as a whole. |
java.lang.String |
getSettingsNameOf(java.lang.String keyName)
Returns the name of the name of the settings where the specified key is found in the default category. |
java.lang.String |
getSettingsNameOf(java.lang.String categoryName,
java.lang.String keyName)
Returns the name of the name of the settings where the specified category and key are found. |
java.lang.String |
getValueOf(java.lang.String keyName)
Returns the value of keyName in the default category. |
java.lang.String |
getValueOf(java.lang.String categoryName,
java.lang.String keyName)
Returns the value of keyName in the specified category. |
void |
setDefaults(ReadOnlySettings defaults)
Sets defaults that must be looked up, if a setting can't be found in the main settings object. |
void |
setName(java.lang.String aName)
Sets the name of the settings object as a whole. |
| Method Detail |
|---|
java.lang.String getName()
void setName(java.lang.String aName)
java.lang.String getValueOf(java.lang.String categoryName,
java.lang.String keyName)
categoryName - The name of the category (null means the default category)keyName - The name of a key inside the category
java.lang.String getValueOf(java.lang.String keyName)
keyName - The name of a key inside the default category
java.lang.String[] getCategoryNames()
java.lang.String[] getKeyNamesOf(java.lang.String categoryName)
categoryName - The name of the category the keys are wanted fromjava.lang.String[] getKeyNamesOfDefaultCategory()
ReadOnlySettings getDefaults()
void setDefaults(ReadOnlySettings defaults)
defaults - A settings object with default values or null
java.lang.String getSettingsNameOf(java.lang.String categoryName,
java.lang.String keyName)
categoryName - The name of the category (null means the default category)keyName - The name of a key inside the category
java.lang.String getSettingsNameOf(java.lang.String keyName)
keyName - The name of a key inside the default category
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||