org.igfay.jfig
Class JFigDictionary

java.lang.Object
  extended byorg.igfay.jfig.JFigDictionary
All Implemented Interfaces:
java.io.Serializable

public class JFigDictionary
extends java.lang.Object
implements java.io.Serializable

JFigDictionary contains the configuration entries. It is a TreeMap of TreeMaps. There is a map for each section. Each section map in turn holds its key/value pairs. The dictionary provides methods to set and retrieve the key/value entries. It can also print itself.

Author:
bconrad
See Also:
Serialized Form

Constructor Summary
JFigDictionary()
          default constructor
 
Method Summary
 void addKeyValueToSection(java.lang.String section, java.lang.String key, java.lang.String value)
           
 java.util.TreeMap getDictionaryOfSectionDictionaries()
          Return the DictionaryOfSectionDictionaries value
 java.lang.String getHtmlString()
          Return the configuration dictionary as a string embedded with html.
 java.util.TreeMap getSectionDictionary(java.lang.String sectionName)
          Return a named section dictionary Does the same job as getSectionNamed but the section name must match with case sensitivity.
 java.util.Iterator getSectionIterator()
          Return the DictionaryOfSectionDictionaries value as an iterator
protected  java.util.TreeMap getSectionNamed(java.lang.String sectionName)
           
protected  java.util.TreeMap getSectionNamed(java.lang.String sectionName, boolean addIfNull)
          Return a named section dictionary Iterate through all the section dictionaries so we can check without case sensitivity.
 java.lang.String getValue(java.lang.String section, java.lang.String key)
          Return the value for this section and key.
 java.lang.String getValue(java.lang.String section, java.lang.String key, java.lang.String notFoundValue)
          Return the value for this section and key.
 boolean isHidden(java.lang.String key)
           
 void print()
          Print the configuration dictionary.
 void printConfigurationDictionary()
          Deprecated.  
protected  void setConfigurationValue(java.lang.String sectionName, java.lang.String keyString, java.lang.String valueString)
          Set a value for a given section and key.
 void setHtmlLString(java.lang.String htmlString)
          Sets the htmlString.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFigDictionary

public JFigDictionary()
default constructor

Method Detail

addKeyValueToSection

public void addKeyValueToSection(java.lang.String section,
                                 java.lang.String key,
                                 java.lang.String value)

printConfigurationDictionary

public void printConfigurationDictionary()
Deprecated.  

Print the configuration dictionary. Sections and keys will be in alphabetical order.


print

public void print()
Print the configuration dictionary. Sections and keys will be in alphabetical order.


getHtmlString

public java.lang.String getHtmlString()
Return the configuration dictionary as a string embedded with html. This method will be replaced with a better jsp.

Returns:
String

isHidden

public boolean isHidden(java.lang.String key)

getDictionaryOfSectionDictionaries

public java.util.TreeMap getDictionaryOfSectionDictionaries()
Return the DictionaryOfSectionDictionaries value


getSectionIterator

public java.util.Iterator getSectionIterator()
Return the DictionaryOfSectionDictionaries value as an iterator


getSectionDictionary

public java.util.TreeMap getSectionDictionary(java.lang.String sectionName)
Return a named section dictionary Does the same job as getSectionNamed but the section name must match with case sensitivity. Here for better performance when we are ensured the section will match.


getSectionNamed

protected java.util.TreeMap getSectionNamed(java.lang.String sectionName)

getSectionNamed

protected java.util.TreeMap getSectionNamed(java.lang.String sectionName,
                                            boolean addIfNull)
Return a named section dictionary Iterate through all the section dictionaries so we can check without case sensitivity.


getValue

public java.lang.String getValue(java.lang.String section,
                                 java.lang.String key)
                          throws JFigException
Return the value for this section and key. If not found, throw JFigException.

Parameters:
section - Description of Parameter
key - Description of Parameter
Returns:
The Value value
Throws:
JFigException - Description of Exception

getValue

public java.lang.String getValue(java.lang.String section,
                                 java.lang.String key,
                                 java.lang.String notFoundValue)
Return the value for this section and key. If not found, return defaultValue.

Parameters:
section - Description of Parameter
key - Description of Parameter
notFoundValue - Description of Parameter
Returns:
The Value value

setConfigurationValue

protected void setConfigurationValue(java.lang.String sectionName,
                                     java.lang.String keyString,
                                     java.lang.String valueString)
Set a value for a given section and key.

Parameters:
sectionName - The new ConfigurationValue value
keyString - The new ConfigurationValue value
valueString - The new ConfigurationValue value

setHtmlLString

public void setHtmlLString(java.lang.String htmlString)
Sets the htmlString.

Parameters:
htmlString - The htmlString to set