|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscone.util.PersistentProperties
public class PersistentProperties
Properties which are defined and stored in an XML document.
Properties files must contain a properties element which may contain property elements.
There are three types of properties: boolean, choice and text.
Text properties are defined like this:
<property name="example1" type="text" value="example value"/>
<property name="example2" type="boolean" value="true">
<property name="example3" type="choice" value="harald"> <value>volkert</value> <value>harald</value> <value>matthias</value> </property>
Every Scone plugin has a properties file named [sconepath]/config/properties/[fullclassname].xml The class PersistentPropertiesGui can generate a dialog from such a properties file.
Constructor Summary | |
---|---|
PersistentProperties(java.lang.String fileName)
creates a new instance of PersitentProperties. |
Method Summary | |
---|---|
java.lang.String |
get(java.lang.String name)
returns the value of the specified property as a String |
java.util.Enumeration |
getKeys()
returns an enumeration of the property names in the order in which they are defined in the xml document |
java.lang.String |
getName()
returns the file name of the xml document |
protected java.lang.String |
getType(java.lang.String name)
returns the type of this property |
protected java.util.Vector |
getValues(java.lang.String name)
returns the possible values of a choice property or null if the property does not exist or if it is no choice property. |
void |
set(java.lang.String name,
java.lang.String value)
sets a property value. |
void |
store()
stores the current property values to the xml document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PersistentProperties(java.lang.String fileName)
fileName
- the file name of the XML definitions.Method Detail |
---|
public java.util.Enumeration getKeys()
public java.lang.String get(java.lang.String name)
name
- the name of the property
protected java.util.Vector getValues(java.lang.String name)
name
- the name
protected java.lang.String getType(java.lang.String name)
name
- the name of the property
public void set(java.lang.String name, java.lang.String value)
name
- the name of the propertyvalue
- the value of the propertypublic void store()
public java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |