org.springframework.richclient.settings.xml
Class StringXmlSettingsReaderWriter

java.lang.Object
  extended by org.springframework.richclient.settings.xml.StringXmlSettingsReaderWriter
All Implemented Interfaces:
XmlSettingsReaderWriter

public class StringXmlSettingsReaderWriter
extends Object
implements XmlSettingsReaderWriter

Helper class, used for testing. The read method returns the xml settings parsed from the xml passed in the constructor, the write method writes to a buffer which can be read with the getBuffer method.

Author:
Peter De Bruycker

Constructor Summary
StringXmlSettingsReaderWriter()
          Creates a new instance.
StringXmlSettingsReaderWriter(String xml)
          Creates a new instance.
 
Method Summary
 String getBuffer()
          Returns the buffered xml.
 RootXmlSettings read(String key)
          Reads the settings with the given key from the backing store.
 void write(RootXmlSettings settings)
          Writes the given settings to the backing store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringXmlSettingsReaderWriter

public StringXmlSettingsReaderWriter(String xml)
Creates a new instance. The xml will be parsed when the read method is invoked.

Parameters:
xml - the xml

StringXmlSettingsReaderWriter

public StringXmlSettingsReaderWriter()
Creates a new instance.

Method Detail

write

public void write(RootXmlSettings settings)
           throws SettingsException
Description copied from interface: XmlSettingsReaderWriter
Writes the given settings to the backing store.

Specified by:
write in interface XmlSettingsReaderWriter
Parameters:
settings - the settings
Throws:
SettingsException - wraps any exception thrown by the backing store

getBuffer

public String getBuffer()
Returns the buffered xml.

Returns:
the buffered xml

read

public RootXmlSettings read(String key)
                     throws SettingsException
Description copied from interface: XmlSettingsReaderWriter
Reads the settings with the given key from the backing store.

Specified by:
read in interface XmlSettingsReaderWriter
Parameters:
key - the key
Returns:
the settings
Throws:
SettingsException - wraps any exception thrown by the backing store


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.