edu.rice.cs.drjava.config
Class SavableConfiguration

java.lang.Object
  extended by edu.rice.cs.drjava.config.Configuration
      extended by edu.rice.cs.drjava.config.SavableConfiguration
Direct Known Subclasses:
FileConfiguration

public class SavableConfiguration
extends Configuration

A Configuration object that can be read and saved from a Stream.

Version:
$Id: SavableConfiguration.java 4691 2008-12-02 23:33:27Z dlsmith $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.config.Configuration
_startupException, map
 
Constructor Summary
SavableConfiguration(OptionMap map)
          Creates a new Configuration based on the given OptionMap.
 
Method Summary
 void loadConfiguration(InputStream is)
          Creates an OptionMapLoader with the values loaded from the InputStream (and defaults where values weren't specified) and loads them into this Configuration's OptionMap.
 void saveConfiguration(OutputStream os, String header)
          Used to save the values from this Configuration into the given OutputStream as a Properties file.
 
Methods inherited from class edu.rice.cs.drjava.config.Configuration
addOptionListener, getOptionMap, getSetting, getStartupException, hadStartupException, removeOptionListener, resetToDefaults, setSetting, storeStartupException, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SavableConfiguration

public SavableConfiguration(OptionMap map)
Creates a new Configuration based on the given OptionMap.

Parameters:
map - an empty OptionMap
Method Detail

loadConfiguration

public void loadConfiguration(InputStream is)
                       throws IOException
Creates an OptionMapLoader with the values loaded from the InputStream (and defaults where values weren't specified) and loads them into this Configuration's OptionMap.

Parameters:
is - InputStream containing properties-style keys and values
Throws:
IOException

saveConfiguration

public void saveConfiguration(OutputStream os,
                              String header)
                       throws IOException
Used to save the values from this Configuration into the given OutputStream as a Properties file. The elements weren't ordered, so now the properties are written in the same way as the about dialog. Values equal to their defaults are not written to disk.

Throws:
IOException