org.aitools.programd.util
Class Settings

java.lang.Object
  extended by org.aitools.programd.util.Settings
Direct Known Subclasses:
CoreSettings

public abstract class Settings
extends java.lang.Object

A Settings object can read properties from a given path, or initialize itself with default values. It also contains getter and setter methods for every property value. Usually the subclasses of Settings will be generated automatically from some other structure, such as (as currently) the properties file itself, since it's annoying to create and maintain these by hand.

Author:
Noel Bush

Field Summary
protected  java.net.URL path
          Path to the properties.
protected  java.util.Properties properties
          The properties.
 
Constructor Summary
Settings()
          Creates a new Settings object, initializing it with default values.
Settings(java.net.URL propertiesPath)
          Creates a new Settings object, filling it with properties read from the given path.
 
Method Summary
protected abstract  void initialize()
          Initializes the Settings object with values from properties as read, or defaults (if properties are not provided).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

protected java.net.URL path
Path to the properties.


properties

protected java.util.Properties properties
The properties.

Constructor Detail

Settings

public Settings()
Creates a new Settings object, initializing it with default values.


Settings

public Settings(java.net.URL propertiesPath)
Creates a new Settings object, filling it with properties read from the given path.

Parameters:
propertiesPath - the path to the properties file
Method Detail

initialize

protected abstract void initialize()
Initializes the Settings object with values from properties as read, or defaults (if properties are not provided).