|
|||||||||
| 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
org.pf.settings.rw.PropertiesReaderWriter
public class PropertiesReaderWriter
A reader that can load a properties file into a settings object.
| Constructor Summary | |
|---|---|
PropertiesReaderWriter()
Create a new reader for properties file. |
|
PropertiesReaderWriter(FileLocator locator)
Create a new reader for properties file that loads from the file specified by the given locator. |
|
PropertiesReaderWriter(FileLocator locator,
java.lang.String charsetName)
Create a new reader for properties file that loads from the file specified by the given locator using the specified character encoding. |
|
PropertiesReaderWriter(java.lang.String filename)
Create a new reader for properties file that loads from a file with the given name. |
|
PropertiesReaderWriter(java.lang.String filename,
java.lang.String charsetName)
Create a new reader for properties file that loads from a file with the given name using the specified character encoding. |
|
| Method Summary | |
|---|---|
boolean |
getBackslashIsEscapeChar()
Sets whether or not backslashes should be treated as escape character. |
static Settings |
loadSettings(FileLocator locator,
java.lang.Class settingsClass)
Loads the properties from the specified file and returns them as settings. |
static Settings |
loadSettings(java.lang.String filename,
java.lang.Class settingsClass)
Loads the properties from the specified file and returns them as settings. |
static Settings |
propertiesToSettings(java.util.Properties properties,
java.lang.Class settingsClass)
Converts the given properties object to a settings object and returns it. |
void |
setBackslashIsEscapeChar(boolean newValue)
Returns whether or not backslashes should be treated as escape character. |
boolean |
storeSettings(Settings settings)
Stores the given settings to the file with this object's filename in the format of Java properties files. |
| Methods inherited from class org.pf.settings.rw.AbstractSettingsFileReaderWriter |
|---|
getEncoding, getFileName, loadSettings, loadSettingsFrom, loadSettingsFrom, loadSettingsFrom, loadSettingsFrom, setEncoding, setFileName |
| 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 |
| Constructor Detail |
|---|
public PropertiesReaderWriter()
public PropertiesReaderWriter(java.lang.String filename)
filename - The name of the file to read from
public PropertiesReaderWriter(java.lang.String filename,
java.lang.String charsetName)
filename - The name of the file to read fromcharsetName - The character encoding (e.g. "UTF-8") or nullpublic PropertiesReaderWriter(FileLocator locator)
locator - The locator that points to the file to read from
public PropertiesReaderWriter(FileLocator locator,
java.lang.String charsetName)
locator - The locator that points to the file to read fromcharsetName - The character encoding (e.g. "UTF-8") or null| Method Detail |
|---|
public boolean getBackslashIsEscapeChar()
public void setBackslashIsEscapeChar(boolean newValue)
public static Settings propertiesToSettings(java.util.Properties properties,
java.lang.Class settingsClass)
public static Settings loadSettings(java.lang.String filename,
java.lang.Class settingsClass)
filename - The name of the properties file.settingsClass - The class that implements the Settings interface of which an instance will be created
public static Settings loadSettings(FileLocator locator,
java.lang.Class settingsClass)
locator - The locator that points to the properties file.settingsClass - The class that implements the Settings interface of which an instance will be createdpublic boolean storeSettings(Settings settings)
settings - The settings to store
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||