story.dbcore.misc
Class Configuration

java.lang.Object
  extended by story.dbcore.misc.Configuration

public class Configuration
extends java.lang.Object

A place to parse and retrieve the text keys and text values of a configuration, especially from a file.

Its mini-parser will accept keys and values in the form
key=value
where the first = sign is interpreted as the delimiter. Keys are case insensitive.


Constructor Summary
Configuration(java.io.File configurationFile)
           
 
Method Summary
 java.io.File getFile()
          Get the File from which this Configuration was parsed.
 java.util.Enumeration getKeys()
           
 java.lang.String getValue(java.lang.String key)
          Retrieves the value of a key.
 java.lang.StringBuffer render()
          Renders the entire Configuration to a StringBuffer.
 boolean valueSet(java.lang.String key)
          Returns whether a value has been set for some key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(java.io.File configurationFile)
              throws Scheherexception
Throws:
Scheherexception
Method Detail

render

public java.lang.StringBuffer render()
Renders the entire Configuration to a StringBuffer.


getValue

public java.lang.String getValue(java.lang.String key)
                          throws Scheherexception
Retrieves the value of a key. Throws an exception if the key has not been set with a value.

Throws:
Scheherexception

valueSet

public boolean valueSet(java.lang.String key)
Returns whether a value has been set for some key.


getFile

public java.io.File getFile()
Get the File from which this Configuration was parsed.


getKeys

public java.util.Enumeration getKeys()


Copyright © 2011 David K. Elson. All Rights Reserved.