|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jfw.util.PropertiesManager
public class PropertiesManager
Manage the data of a properties file.
The instance is returned by PropertiesProxy.getProperties(java.lang.String, java.lang.String)
.
Is an observer of UpdateObservable
.
The properties files of JFW is managed by an instance of this class.
You can see an example of the jfw.properties
here.
Constructor Summary | |
---|---|
PropertiesManager(java.lang.String propertiesName,
java.lang.String language)
Create an instance. |
Method Summary | |
---|---|
protected void |
addObserver(java.lang.Object object,
java.lang.String description)
Add this instance as observer of UpdateObservable . |
java.lang.String |
getLanguage()
Get attribute language . |
java.util.Properties |
getProperties()
Get the Propeties object. |
java.lang.String |
getPropertiesName()
Get attribute propertiesName . |
java.lang.Float |
readFloatParameter(java.lang.String key)
Get the value from the properties file. |
java.lang.Float |
readFloatParameter(java.lang.String key,
float defaultValue)
Get the value from the properties file. |
java.lang.Integer |
readIntParameter(java.lang.String key)
Get the value from the properties file. |
java.lang.Integer |
readIntParameter(java.lang.String key,
int defaultValue)
Get the value from the properties file. |
java.lang.String |
readParameter(java.lang.String key)
Get the value from the properties file. |
java.lang.String |
readParameter(java.lang.String key,
java.lang.String defaultValue)
Get the value from the properties file. |
protected void |
readProperties()
Use method PropertiesReader.readProperties(java.lang.String, java.lang.String, java.util.Properties) for read
the properties file. |
java.lang.String |
toString()
Return data relative of this object. |
void |
update(java.util.Observable observable,
java.lang.Object obj)
Called by UpdateObservable.update() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PropertiesManager(java.lang.String propertiesName, java.lang.String language) throws JFWGenericException
propertiesName
- the name the properties file.language
- the language of the prorties file. If null the default
language will be used.
JFWGenericException
Method Detail |
---|
protected void readProperties() throws JFWGenericException
PropertiesReader.readProperties(java.lang.String, java.lang.String, java.util.Properties)
for read
the properties file.
JFWGenericException
protected void addObserver(java.lang.Object object, java.lang.String description)
UpdateObservable
.
object
- this instance.description
- description of this instance.public java.lang.String getPropertiesName()
propertiesName
.
propertiesName
.public java.lang.String getLanguage()
language
.
language
.public java.util.Properties getProperties()
properties
.public java.lang.String readParameter(java.lang.String key)
key
- the key to read.
public java.lang.String readParameter(java.lang.String key, java.lang.String defaultValue)
key
- the key to read.defaultValue
- if key is not found this value is returned.
public java.lang.Integer readIntParameter(java.lang.String key)
key
- the key to read.
public java.lang.Integer readIntParameter(java.lang.String key, int defaultValue)
key
- the key to read.defaultValue
- if key is not found this value is returned.
public java.lang.Float readFloatParameter(java.lang.String key)
key
- the key to read.
public java.lang.Float readFloatParameter(java.lang.String key, float defaultValue)
key
- the key to read.defaultValue
- if key is not found this value is returned.
public void update(java.util.Observable observable, java.lang.Object obj)
UpdateObservable.update()
.
update
in interface java.util.Observer
observable
- the observable object.obj
- the update object.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |