|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pf.settings.rw.AbstractSettingsReaderWriter
org.pf.settings.rw.AbstractSettingsFileReaderWriter
This class provides a common implementation for SettingsReader and SettingsWriter that use a file as datastore.
| Constructor Summary | |
AbstractSettingsFileReaderWriter()
Initialize the new instance with default values. |
|
AbstractSettingsFileReaderWriter(FileLocator fileLocator)
Initialize the new instance with a file locator. |
|
AbstractSettingsFileReaderWriter(java.lang.String filename)
Initialize the new instance with a filename. |
|
| Method Summary | |
java.lang.String |
getEncoding()
Set the encoding to be used for reading an writing. |
java.lang.String |
getFileName()
Returns the name of the file from which or to which the setting should be written/read. |
Settings |
loadSettings(java.lang.Class settingsClass)
Returns a newly created Settings object filled with the data from the datastore the implementer supports. |
Settings |
loadSettingsFrom(ClasspathElement classpathElement)
Returns a newly created Settings object filled with the data from the file the implementer supports. |
Settings |
loadSettingsFrom(ClasspathElement classpathElement,
java.lang.Class settingsClass)
Returns a newly created Settings object filled with the data from the file the implementer supports. |
Settings |
loadSettingsFrom(java.lang.String content)
Uses the given string as content to parse the settings from. |
Settings |
loadSettingsFrom(java.lang.String content,
java.lang.Class settingsClass)
Uses the given string as content to parse the settings from. |
void |
setEncoding(java.lang.String newValue)
|
void |
setFileName(java.lang.String aValue)
Sets the name of the file from which or to which the setting should be written/read. |
| Methods inherited from class org.pf.settings.rw.AbstractSettingsReaderWriter |
loadSettings |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.pf.settings.SettingsReader |
loadSettings |
| Methods inherited from interface org.pf.settings.SettingsWriter |
storeSettings |
| Constructor Detail |
public AbstractSettingsFileReaderWriter()
public AbstractSettingsFileReaderWriter(java.lang.String filename)
filename - The name of the file the settings must be read frompublic AbstractSettingsFileReaderWriter(FileLocator fileLocator)
fileLocator - The locator for the file the settings must be read from| Method Detail |
public java.lang.String getFileName()
getFileName in interface SettingsFileReaderpublic void setFileName(java.lang.String aValue)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String newValue)
public Settings loadSettings(java.lang.Class settingsClass)
loadSettings in interface SettingsReadersettingsClass - The class of which an instance should be created and returned
public Settings loadSettingsFrom(ClasspathElement classpathElement)
throws java.io.IOException
classpathElement - The classpath element from wich to load the settings file
java.io.IOException - If the file cannot be found or opened
public Settings loadSettingsFrom(ClasspathElement classpathElement,
java.lang.Class settingsClass)
throws java.io.IOException
classpathElement - The classpath element from wich to load the settings filesettingsClass - The class of which an instance should be created and returned
java.io.IOException - If the file cannot be found or openedpublic Settings loadSettingsFrom(java.lang.String content)
public Settings loadSettingsFrom(java.lang.String content,
java.lang.Class settingsClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||