Package daikon.config

Class Configuration

  • All Implemented Interfaces:
    Serializable

    public final class Configuration
    extends Object
    implements Serializable
    This class applies settings from a configuration file that lists variable names and values (see "example-settings.txt" in this directory for an example). Multiple configuration files can be read, and the results can be re-written to a new configuration file.

    Important note: classes that have fields set via this Configuration (dkconfig) interface may not reference daikon.Global in their static initializers, since Global loads the default configuration, which classloads that class, and we would have a classloading circularity.

    See Also:
    Serialized Form
    • Method Detail

      • getInstance

        public static Configuration getInstance()
        Returns the singleton instance of this class.
        Returns:
        the singleton instance of this class
      • replay

        public void replay()
      • overlap

        public void overlap​(Configuration config)
        Take the settings given in the argument and call this.apply(String) for each of them. This essentially overlaps the settings given in the argument over this (appending them to this in the process). This method is intended for loading a saved configuration from a file, since calling this method with the Configuration singleton makes no sense.
      • apply

        public void apply​(InputStream input)
        Apply the settings in the given InputStream.
        Parameters:
        input - the commands to set confiuration
      • apply

        public void apply​(String line)
        Apply the setting in the given InputStream.
        Parameters:
        line - the command to set confiuration
      • apply

        public void apply​(String name,
                          String value)
        Set the given setting to the given value.
        Parameters:
        name - the setting to modify
        value - the setting's new value