com.taursys.tools
Class Settings

java.lang.Object
  extended bycom.taursys.tools.Settings
Direct Known Subclasses:
ProjectSettings, UserSettings

public abstract class Settings
extends java.lang.Object

Settings is a class which contains, stores and retrieves properties

Version:
1.0
Author:
Marty Phelan

Field Summary
protected  java.util.Properties properties
           
 
Constructor Summary
Settings(java.lang.String description)
          Constructs a new Settings
 
Method Summary
 java.lang.String getDescription()
          Gets the description of this Settings object.
 java.util.Properties getProperties()
          Gets the CodeGen Properties
 java.lang.String getProperty(java.lang.String key)
          Gets CodeGen property value for given key
protected abstract  java.lang.String getPropertyFileName()
          Gets the full property file name
protected abstract  java.lang.String getPropertyFilePath()
          Gets the full property file name
 void loadSettings()
          Loads the CodeGen Settings from the default settings file (if exists)
 void loadSettings(java.io.File propFile)
          Loads the CodeGen Settings from the default settings file (if exists)
 void saveSettings()
          Saves the CodeGen Settings to the default settings file.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets the CodeGen property value for the given key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected java.util.Properties properties
Constructor Detail

Settings

public Settings(java.lang.String description)
Constructs a new Settings

Method Detail

getPropertyFilePath

protected abstract java.lang.String getPropertyFilePath()
Gets the full property file name


getPropertyFileName

protected abstract java.lang.String getPropertyFileName()
Gets the full property file name


loadSettings

public void loadSettings()
                  throws java.io.IOException
Loads the CodeGen Settings from the default settings file (if exists)

Throws:
IOException - if problem loading properties file

loadSettings

public void loadSettings(java.io.File propFile)
                  throws java.io.IOException
Loads the CodeGen Settings from the default settings file (if exists)

Throws:
IOException - if problem loading properties file

saveSettings

public void saveSettings()
                  throws java.io.IOException
Saves the CodeGen Settings to the default settings file.

Throws:
IOException - if problem loading properties file

getProperties

public java.util.Properties getProperties()
Gets the CodeGen Properties

Returns:
the CodeGen Properties

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets CodeGen property value for given key

Parameters:
key - of requested property
Returns:
CodeGen property value for given key

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets the CodeGen property value for the given key

Parameters:
key - of the property
value - for the property

getDescription

public java.lang.String getDescription()
Gets the description of this Settings object. The description is stored in the properties file during a save.

Returns:
the description of this Settings object


Copyright © 2007 Martin T Phelan. All Rights Reserved.