|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.feednread.backend.configuration.XMLConfigurationPersistenceEngine
XMLConfigurationPersistenceEngine represents an xml based persistence layer
for the Feed'n Read cconfiguration. It is plugged into
net.sourceforge.java.feednread.backend.configuration to use it in
conjunction with the JFace preference api.
| Field Summary | |
private HashMap |
configurationData
|
private String |
filename
|
| Constructor Summary | |
XMLConfigurationPersistenceEngine(String filename)
Creates a new XMLConfigurationPersistenceEngine bound to the
specified filename.
|
|
| Method Summary | |
private void |
createArchiveOptions(Element root,
Namespace defaultNs)
Creates the archive options Element which holds archive
specific application settings.
|
private void |
createBrowserOptions(Element element,
Namespace defaultNs)
Creates the browser options Element which holds the
settings for browser specific behaviour of the application.
|
private void |
createCacheOptions(Element root,
Namespace defaultNs)
Creates the cache options Element which holds cache
specific application settings.
|
private void |
createConnectionOptions(Element root,
Namespace defaultNs)
Creates the connection options Element which holds the
settings for all connections established by the application.
|
private void |
createControlOptions(Element root,
Namespace defaultNs)
Creates the control options Element which
holds the information on the application control settings.
|
private void |
createCoolBarOptions(Element root,
Namespace defaultNs)
Creates the CoolBar options Element which
holds the information on the application CoolBar settings.
|
private Document |
createDocument()
Creates a default configuration Document.
|
private void |
createElement(Element topElement,
String name,
Namespace ns)
Creates a new Element in the specified
topElement using the given settings.
|
private void |
createEnclosureOptions(Element root,
Namespace defaultNs)
Creates the enclosure options Element which holds the
settings for enclosure specific behaviour of the application.
|
private void |
createFavoriteOptions(Element root,
Namespace defaultNs)
Creates the Favorite options Element which
holds the information on the application Favorite settings.
|
private void |
createGeneralOptions(Element root,
Namespace defaultNs)
Creates the general options Element which holds general
application settings.
|
private void |
createLanguageOptions(Element element,
Namespace defaultNs)
Creates the language options Element which holds the
language specific settings of the application.
|
private void |
createPodcastOptions(Element element,
Namespace defaultNs)
Creates the podcast options Element which holds the
settings for podcast specific behaviour of the application.
|
private void |
createProxyOptions(Element element,
Namespace defaultNs)
Creates the proxy server options Element which holds the
settings for the proxy server to be used for all connections established
by the application.
|
private void |
createTrayOptions(Element element,
Namespace defaultNs)
Creates the tray options Element which holds the
settings for tray specific behaviour of the application.
|
private void |
createWindowOptions(Element root,
Namespace defaultNs)
Creates the window options Element which holds the
information on the application window settings.
|
private void |
parseDocument(Document doc)
Parses the specified Document holding the application
configuration.
|
void |
persist()
Writes the configuration back to the xml based configuration file. |
Map |
retrieve()
Retrieves the configuration data from the underlying xml based persistance layer and deposits the parsed key/value pairs in a Map.
|
private void |
traverse(Element elem)
Recuirsively traverses the specified Element and maps
the xml configuration elements to their values in the internal
Map.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private String filename
private HashMap configurationData
| Constructor Detail |
public XMLConfigurationPersistenceEngine(String filename)
Creates a new XMLConfigurationPersistenceEngine bound to the
specified filename.
filename - the name of the xml based configuration file that holds
the configuration data| Method Detail |
public Map retrieve()
throws PersistenceException
Retrieves the configuration data from the underlying xml based
persistance layer and deposits the parsed key/value pairs in a
Map.
retrieve in interface IConfigurationPersistenceEngineMap cotaining a list of key/value pairs holding
the settings from the xml based persistance layer
PersistenceException - if an error occured while retrieving the
configuration data from the xml based persistance layer
public void persist()
throws PersistenceException
Writes the configuration back to the xml based configuration file.
persist in interface IConfigurationPersistenceEnginePersistenceException - if an error occured while writing the
configuration back to xml configuration file
private void parseDocument(Document doc)
throws JDOMException
Parses the specified Document holding the application
configuration.
doc - the Document holding the application
configuration
JDOMException - if the specified Document could not
be parsed correctlyprivate void traverse(Element elem)
Recuirsively traverses the specified Element and maps
the xml configuration elements to their values in the internal
Map.
elem - the Element to traversprivate Document createDocument()
Creates a default configuration Document.
Document
private void createWindowOptions(Element root,
Namespace defaultNs)
Creates the window options Element which holds the
information on the application window settings.
root - the root Element in which to store the
created window options ElementdefaultNs - the default Namespace to use
private void createCoolBarOptions(Element root,
Namespace defaultNs)
Creates the CoolBar options Element which
holds the information on the application CoolBar settings.
root - the root Element in which to store the created
CoolBar options ElementdefaultNs - the default Namespace to use
private void createControlOptions(Element root,
Namespace defaultNs)
Creates the control options Element which
holds the information on the application control settings.
root - the root Element in which to store the created
control options ElementdefaultNs - the default Namespace to use
private void createGeneralOptions(Element root,
Namespace defaultNs)
Creates the general options Element which holds general
application settings.
root - the root Element in which to store the
created general options ElementdefaultNs - the default Namespace to use
private void createFavoriteOptions(Element root,
Namespace defaultNs)
Creates the Favorite options Element which
holds the information on the application Favorite settings.
root - the root Element in which to store the created
Favorite options ElementdefaultNs - the default Namespace to use
private void createLanguageOptions(Element element,
Namespace defaultNs)
Creates the language options Element which holds the
language specific settings of the application.
element - the Element in which to store the
created language options ElementdefaultNs - the default Namespace to use
private void createCacheOptions(Element root,
Namespace defaultNs)
Creates the cache options Element which holds cache
specific application settings.
root - the root Element in which to store the created
cache options ElementdefaultNs - the default Namespace to use
private void createArchiveOptions(Element root,
Namespace defaultNs)
Creates the archive options Element which holds archive
specific application settings.
root - the root Element in which to store the created
archive options ElementdefaultNs - the default Namespace to use
private void createConnectionOptions(Element root,
Namespace defaultNs)
Creates the connection options Element which holds the
settings for all connections established by the application.
root - the root Element in which to store the created
connection options ElementdefaultNs - the default Namespace to use
private void createProxyOptions(Element element,
Namespace defaultNs)
Creates the proxy server options Element which holds the
settings for the proxy server to be used for all connections established
by the application.
element - the Element in which to store the created
proxy server options ElementdefaultNs - the default Namespace to use
private void createTrayOptions(Element element,
Namespace defaultNs)
Creates the tray options Element which holds the
settings for tray specific behaviour of the application.
element - the Element in which to store the created
tray options ElementdefaultNs - the default Namespace to use
private void createEnclosureOptions(Element root,
Namespace defaultNs)
Creates the enclosure options Element which holds the
settings for enclosure specific behaviour of the application.
root - the Element in which to store the created
enclosure options ElementdefaultNs - the default Namespace to use
private void createPodcastOptions(Element element,
Namespace defaultNs)
Creates the podcast options Element which holds the
settings for podcast specific behaviour of the application.
element - the Element in which to store the created
podcast options ElementdefaultNs - the default Namespace to use
private void createBrowserOptions(Element element,
Namespace defaultNs)
Creates the browser options Element which holds the
settings for browser specific behaviour of the application.
element - the Element in which to store the created
browser options ElementdefaultNs - the default Namespace to use
private void createElement(Element topElement,
String name,
Namespace ns)
Creates a new Element in the specified
topElement using the given settings.
topElement - the Element to add the created
Element toname - the name of the new Rlementns - the Namespace of the new Element
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||