|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappl.ext.XuluConfig
public class XuluConfig
Simple Property store, which is loaded at each Xulu start and saved at each
Xulu exit. Every class or plugin can store and retrieve configuration
information easy through a static method. To keep the property file readable
and to avoid conflicts with other plugins please prefix the key-name with a
unique name, which identifies your class, followed by a dot and the property.
This is important for correct display in a User-GUI (which could be
implemented).
Keyformat: domain.property
Example key: DiscoveryService.className
There could be no double entries.But you can save multiple values to one key
using the setMultiProperty
method.
These values are internally separated with ';', so see that you don't use
';' in your values of Multi
Properties
First the settings of the file "DefaultProperties" are loaded. After that the
values are possibly overwritten by the loading of the file "XuluProperties"
in which is intended to store a actual user configuration.
"DefaultPropoerties" should never be modified by the user. The
programmer should store all default values there.
The user may change values through the ConfigurationEditorGUI
.
ConfigurationEditorGUI
,
ConfigurationEditorEngine
Method Summary | |
---|---|
boolean |
getBooleanProperty(String key)
|
double |
getDoubleProperty(String key)
|
int |
getIntProperty(String key)
|
Set<String> |
getKeysStartingWith(String startingString)
Gets all entries starting with the given String |
String[] |
getMultiProperty(String key)
A multiproperty stores multiple values for one key. |
Set<String> |
getPrefixes()
Gets all prefixes. |
String |
getProperty(String key)
|
String |
getProperty(String key,
boolean giveWarning)
Same as getProperty(String) , but you can disable the warning
message |
Set<String> |
getSuffixesOfPrefix(String prefix)
Gets all suffixes for one prefix. |
static XuluConfig |
getXuluConfig()
|
static XuluConfig |
getXuluConfig(File rootDir)
|
void |
load()
loads the Properties from the Propertyfile. |
static void |
main(String[] args)
Deprecated. |
void |
removeAll(String key)
removes all keys starting with the value given. |
void |
removeProperty(String key)
removes the Property from the list |
void |
setBooleanProperty(String key,
boolean value)
inserts the property value with the specified key into the XuluConfig |
void |
setIntProperty(String key,
int value)
inserts the property value with the specified key into the XuluConfig |
void |
setMultiProperty(String key,
String[] values)
A multiproperty stores multiple values for one key. |
void |
setProperty(String key,
String value)
inserts the property value with the specified key into the XuluConfig |
void |
setPropertyFile(File file)
Sets the Property file. |
void |
store()
Saves the configuration to the file system |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static XuluConfig getXuluConfig()
public static XuluConfig getXuluConfig(File rootDir)
public void store()
public void setPropertyFile(File file)
file
- public void load()
public void setProperty(String key, String value)
XuluConfig
key
- the keyvalue
- the value associated with the keypublic String getProperty(String key)
public String getProperty(String key, boolean giveWarning)
getProperty(String)
, but you can disable the warning
message
giveWarning
- if true, a warning is given to the console if the specified
entry was not found
public int getIntProperty(String key)
public double getDoubleProperty(String key)
public void setBooleanProperty(String key, boolean value)
XuluConfig
key
- the keyvalue
- the value associated with the keypublic void setIntProperty(String key, int value)
XuluConfig
key
- the keyvalue
- the value associated with the keypublic boolean getBooleanProperty(String key)
public void setMultiProperty(String key, String[] values)
key
- the keyvalues
- array of the values which should be associated with the keypublic String[] getMultiProperty(String key)
public void removeProperty(String key)
key
- public void removeAll(String key)
key
- public Set<String> getPrefixes()
public Set<String> getSuffixesOfPrefix(String prefix)
prefix
- the prefix.public Set<String> getKeysStartingWith(String startingString)
String
startingString
- the prefixstring
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |