Class gpjpp.GPProperties
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpjpp.GPProperties

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----java.util.Properties
                           |
                           +----gpjpp.GPProperties

public class GPProperties
extends Properties
Extends the standard Properties class. GPProperties fixes mishandling of tab and space in the load() method of JDK 1.0 (fixed in JDK 1.1). It makes keynames case-insensitive ala Windows ini files. And it allows comments at the end of each line, delimited by the first space, tab, #, or ! character after the value string. This means that the value string cannot contain any of these characters, of course, but this does not impose an important limitation for this package.
Version:
1.0

Constructor Index

 o GPProperties()
Creates an empty property set.
 o GPProperties(Properties)
Creates an empty property set with specified default values.

Method Index

 o getProperty(String)
Looks up a property value based on a key.
 o load(InputStream)
Loads a property set from an InputStream.
 o show()
Writes the contents of the properties to System.out.

Constructors

 o GPProperties
  public GPProperties()
Creates an empty property set.
 o GPProperties
  public GPProperties(Properties defaults)
Creates an empty property set with specified default values.

Methods

 o getProperty
  public String getProperty(String key)
Looks up a property value based on a key. The key is forced to lowercase before calling Properties.getProperty.
Overrides:
getProperty in class Properties
 o load
  public synchronized void load(InputStream in) throws IOException
Loads a property set from an InputStream. This completely replaces Properties.load() with the following differences: fixes bugs in handling embedded tab and space characters in JDK 1.0; terminates the value string with the first space, tab, !, or # character, treating the rest of the line as a comment; and forces key strings to lowercase before adding them to the property table.
Throws: IOException
if an error occurs while reading the stream.
Overrides:
load in class Properties
 o show
  public void show()
Writes the contents of the properties to System.out. For testing and debugging.

All Packages  Class Hierarchy  This Package  Previous  Next  Index