com.opensymphony.module.propertyset
Class XMLPropertySet

java.lang.Object
  |
  +--com.opensymphony.module.propertyset.AbstractPropertySet
        |
        +--com.opensymphony.module.propertyset.MemoryPropertySet
              |
              +--com.opensymphony.module.propertyset.SerializablePropertySet
                    |
                    +--com.opensymphony.module.propertyset.XMLPropertySet
All Implemented Interfaces:
PropertySet, java.io.Serializable

public class XMLPropertySet
extends SerializablePropertySet

The XMLPropertySet behaves as an in-memory typed PropertySet, with the ability to load and save all the properties to/from an XML document.

Example:

XMLPropertySet p = new XMLPropertySet(); // create blank property-set
p.load( new FileReader("my-properties.xml") ); // load properties from XML.
System.out.println( p.getString("name") );
p.setString("name","blah blah");
p.save( new FileWriter("my-properties.xml") ); // save properties back to XML.

Version:
$Revision: 1.5 $
Author:
Joe Walnes
See Also:
PropertySet, SerializablePropertySet, Serialized Form

Inner classes inherited from class com.opensymphony.module.propertyset.MemoryPropertySet
MemoryPropertySet.ValueEntry
 
Fields inherited from class com.opensymphony.module.propertyset.MemoryPropertySet
map
 
Fields inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
schema
 
Fields inherited from interface com.opensymphony.module.propertyset.PropertySet
BOOLEAN, DATA, DATE, DOUBLE, INT, LONG, OBJECT, PROPERTIES, STRING, TEXT, XML
 
Constructor Summary
XMLPropertySet()
           
 
Method Summary
 void load(java.io.InputStream in)
          Load properties from XML input.
 void load(java.io.Reader in)
          Load properties from XML input.
 void loadFromDocument(org.w3c.dom.Document doc)
          Load properties from XML document.
 void save(java.io.OutputStream out)
          Save properties to XML output.
 void save(java.io.Writer out)
          Save properties to XML output.
 org.w3c.dom.Document saveToDocument()
          Save properties to XML Document.
 
Methods inherited from class com.opensymphony.module.propertyset.SerializablePropertySet
setImpl
 
Methods inherited from class com.opensymphony.module.propertyset.MemoryPropertySet
exists, get, getKeys, getType, remove
 
Methods inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
getBoolean, getData, getDate, getDouble, getInt, getKeys, getKeys, getKeys, getLong, getObject, getProperties, getSchema, getString, getText, getXML, isSettable, setAsActualType, setBoolean, setData, setDate, setDouble, setInt, setLong, setObject, setProperties, setSchema, setString, setText, setXML, supportsType, supportsTypes, toString, type, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLPropertySet

public XMLPropertySet()
Method Detail

saveToDocument

public org.w3c.dom.Document saveToDocument()
                                    throws javax.xml.parsers.ParserConfigurationException
Save properties to XML Document.

save

public void save(java.io.Writer out)
          throws javax.xml.parsers.ParserConfigurationException,
                 java.io.IOException
Save properties to XML output.

save

public void save(java.io.OutputStream out)
          throws javax.xml.parsers.ParserConfigurationException,
                 java.io.IOException
Save properties to XML output.

loadFromDocument

public void loadFromDocument(org.w3c.dom.Document doc)
                      throws PropertyImplementationException
Load properties from XML document.

load

public void load(java.io.Reader in)
          throws javax.xml.parsers.ParserConfigurationException,
                 java.io.IOException,
                 org.xml.sax.SAXException
Load properties from XML input.

load

public void load(java.io.InputStream in)
          throws javax.xml.parsers.ParserConfigurationException,
                 java.io.IOException,
                 org.xml.sax.SAXException
Load properties from XML input.

See www.opensymphony.com for more information.