|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvr.system.options.SavableConfiguration
public abstract class SavableConfiguration
The instances of this class provides access to properties provided in a constructor or defined in the properties file. The properties file name is the name of the class extending this abstract class. Class is quite exac copy of class Configuration
Field Summary | |
---|---|
protected static java.lang.String |
CONFIGURATION_DIRECTORY
SavableConfiguration directory path. |
protected java.util.Properties |
m_Properties
Map between property names and property values. |
protected java.lang.String |
path
path to file with properties |
protected static java.lang.String |
PROPERTIES_EXTENSION
Properties file extension. |
Constructor Summary | |
---|---|
SavableConfiguration(java.util.Properties prop)
Constructor that reads properties from properties file. |
Method Summary | |
---|---|
boolean |
getBoolProperty(java.lang.String propertyName)
Returns property value as a boolean. |
double |
getDoubleProperty(java.lang.String propertyName)
Returns property value as double. |
int |
getIntProperty(java.lang.String propertyName)
Returns property value as int. |
protected static java.lang.String[] |
getPropertiesFilePathes(java.lang.String className)
Returns the pathes to the properties files for a given class name. |
java.lang.String |
getProperty(java.lang.String propertyName)
Returns property value as a string. |
static java.util.Properties |
loadDefaultProperties(java.lang.Class configurableClass)
Returns the default properties for a given class. |
void |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Sets property to a given value. |
protected void |
writeProperties()
Write properties to default properties folder. |
void |
writeProperties(java.io.PrintStream arg)
Writes properties through a given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String CONFIGURATION_DIRECTORY
protected static final java.lang.String PROPERTIES_EXTENSION
protected java.util.Properties m_Properties
protected java.lang.String path
Constructor Detail |
---|
public SavableConfiguration(java.util.Properties prop)
prop
- Map between property names and property values.Method Detail |
---|
public static java.util.Properties loadDefaultProperties(java.lang.Class configurableClass)
configurableClass
- Class.
protected static java.lang.String[] getPropertiesFilePathes(java.lang.String className)
className
- Class name.
java.lang.ClassNotFoundException
- If the class is not found.public java.lang.String getProperty(java.lang.String propertyName)
propertyName
- Property name.
public boolean getBoolProperty(java.lang.String propertyName)
propertyName
- Property name.
public int getIntProperty(java.lang.String propertyName)
propertyName
- Property name.
public double getDoubleProperty(java.lang.String propertyName)
propertyName
- Property name.
public void setProperty(java.lang.String propertyName, java.lang.String propertyValue)
propertyName
- Property name.propertyValue
- New property value.public void writeProperties(java.io.PrintStream arg)
arg
- Stream.protected void writeProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |