edu.rice.cs.drjava.config
Class SavableConfiguration

java.lang.Object
  |
  +--edu.rice.cs.drjava.config.Configuration
        |
        +--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,v 1.5 2002/07/08 02:47:14 csreis Exp $

Field Summary
private  File file
           
 
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, getSetting, getStartupException, hadStartupException, removeOptionListener, resetToDefaults, setSetting, storeStartupException, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

file

private File file
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

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 equals to their defaults are not written to disk.