org.dmonix.util
Class PropertyHandler

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.dmonix.util.PropertyHandler
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class PropertyHandler
extends java.util.Properties

Title: PropertyHandler Description: A class to handle property files Copyright: Copyright (c) 2001 Company:

Version:
1.0.0
Author:
Peter Nerg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PropertyHandler()
          Creates an empty property list with no default values.
PropertyHandler(java.util.Properties properties)
          Creates an empty property list with the specified defaults.
PropertyHandler(java.lang.String fileName)
          Creates an empty property list with the specified defaults from the file
 
Method Summary
 void load(java.lang.String fileName)
          Reads a property list (key and element pairs) from the given file.
 void store(java.lang.String header)
          Store the properties to the define file
 void store(java.lang.String fileName, java.lang.String header)
          Store the properties to the specified file
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyHandler

public PropertyHandler()
Creates an empty property list with no default values.


PropertyHandler

public PropertyHandler(java.util.Properties properties)
Creates an empty property list with the specified defaults.

Parameters:
properties - Default properties to use

PropertyHandler

public PropertyHandler(java.lang.String fileName)
                throws java.io.IOException
Creates an empty property list with the specified defaults from the file

Parameters:
fileName - The file to read the properties from
Method Detail

load

public void load(java.lang.String fileName)
          throws java.io.IOException
Reads a property list (key and element pairs) from the given file.

Parameters:
fileName - The property file
Throws:
java.io.IOException

store

public void store(java.lang.String header)
           throws java.io.IOException
Store the properties to the define file

Parameters:
header - A header line can be added to the file
Throws:
java.io.IOException

store

public void store(java.lang.String fileName,
                  java.lang.String header)
           throws java.io.IOException
Store the properties to the specified file

Parameters:
header - A header line can be added to the file
Throws:
java.io.IOException


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.