org.sump.analyzer
Class Project

java.lang.Object
  extended by org.sump.analyzer.Project

public class Project
extends java.lang.Object

Project maintains a global properties list for all registered objects implementing Configurable. It also provides methods for loading and storing these properties from and to project configuration files. This allows to keep multiple sets of user settings across multiple instance lifecycles.

Version:
0.7
Author:
Michael "Mr. Sump" Poppitz

Constructor Summary
Project()
          Constructs a new project with an empty set of properties and configurable objects.
 
Method Summary
 void addConfigurable(Configurable configurable)
          Adds a configurable object to the project.
 Properties getProperties()
          Gets all currently defined properties for this project.
 void load(java.io.File file)
          Loads properties from the given file and notifies all registered configurable objects.
 void store(java.io.File file)
          Stores properties fetched from all registered configurable objects in the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project

public Project()
Constructs a new project with an empty set of properties and configurable objects.

Method Detail

addConfigurable

public void addConfigurable(Configurable configurable)
Adds a configurable object to the project. The given objects properties will be read and written whenever load and store operations take place.

Parameters:
configurable - configurable object

getProperties

public Properties getProperties()
Gets all currently defined properties for this project.

Returns:
project properties

load

public void load(java.io.File file)
          throws java.io.IOException
Loads properties from the given file and notifies all registered configurable objects.

Parameters:
file - file to read properties from
Throws:
java.io.IOException - when IO operation failes

store

public void store(java.io.File file)
           throws java.io.IOException
Stores properties fetched from all registered configurable objects in the given file.

Parameters:
file - file to store properties in
Throws:
java.io.IOException - when IO operation failes