org.igfay.jfig
Class JFigParser

java.lang.Object
  extended byorg.igfay.jfig.JFigParser
Direct Known Subclasses:
IniJFigParser, XMLJFigParser

public abstract class JFigParser
extends java.lang.Object

Abstract class to parse a configuration file. Concrete classes parse either XML or INI file. This class contains common logic to resolve symbolic and property variables.

Author:
bconrad

Constructor Summary
JFigParser(JFig config, JFigLocatorIF jfigLocator)
          Constructor to allow user to override configFileName default.
 
Method Summary
protected  void addPropertyValues()
           
 java.util.Map getAllConfigFiles()
          Returns the allConfigFiles.
 JFig getConfig()
           
protected  JFigDictionary getConfigDictionary()
           
protected  java.lang.String getConfigFileName()
           
 JFigLocatorIF getJFigLocator()
           
protected static java.util.regex.Pattern getRegexGlobalSubstitution()
           
protected static java.util.regex.Pattern getRegexPropertyVariable()
           
protected static java.util.regex.Pattern getRegexSubstitution()
           
protected abstract  boolean processConfig()
          processConfig
protected  void resolveSymbolicValues()
          Resolve symbolic values in the configuration.
 void setConfig(JFig config)
           
 void setJFigLocator(JFigLocatorIF locatorIF)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFigParser

public JFigParser(JFig config,
                  JFigLocatorIF jfigLocator)
Constructor to allow user to override configFileName default. Get the location from ConfigLocator

Method Detail

getAllConfigFiles

public java.util.Map getAllConfigFiles()
Returns the allConfigFiles.

Returns:
List

processConfig

protected abstract boolean processConfig()
                                  throws JFigException
processConfig

Returns:
Description of the Returned Value
Throws:
JFigException - Description of Exception

resolveSymbolicValues

protected void resolveSymbolicValues()
                              throws JFigException
Resolve symbolic values in the configuration. This method is called after all configuration files have been parsed. Iterate through the dictionary and resolve values for each section/key.

Throws:
JFigException

addPropertyValues

protected void addPropertyValues()

getConfigDictionary

protected JFigDictionary getConfigDictionary()

getConfigFileName

protected java.lang.String getConfigFileName()

getRegexPropertyVariable

protected static java.util.regex.Pattern getRegexPropertyVariable()

getRegexSubstitution

protected static java.util.regex.Pattern getRegexSubstitution()
                                                       throws JFigException
Throws:
JFigException

getRegexGlobalSubstitution

protected static java.util.regex.Pattern getRegexGlobalSubstitution()
                                                             throws JFigException
Throws:
JFigException

getConfig

public JFig getConfig()
Returns:

setConfig

public void setConfig(JFig config)
Parameters:
config -

getJFigLocator

public JFigLocatorIF getJFigLocator()
Returns:

setJFigLocator

public void setJFigLocator(JFigLocatorIF locatorIF)
Parameters:
locatorIF -