cz.zcu.fav.kiv.editor.config
Class ConfigParser

java.lang.Object
  extended by cz.zcu.fav.kiv.editor.config.ConfigParser

public class ConfigParser
extends java.lang.Object

The ConfigParser class contains methods for parsing configuration files.

Version:
1.0, 05/2007
Author:
Marta Vaclavikova

Constructor Summary
ConfigParser()
          Initializes a newly created ConfigParser.
 
Method Summary
 AttributeGroup[] readAttributes(CommonTypes commonTypes)
          Parses the configuration file with attributes - attributes.xml.
 java.util.Map<java.lang.String,Figure> readConfig(ConfigData configData, AttributeGroup[] attributeGroupList)
          Parses the configuration file with layout of parameters and attribute-sets - config.xml.
 void readFigures(java.util.Map<java.lang.String,Parameter> parameterList, java.util.Map<java.lang.String,Figure> figureList)
          Parses the configuration file with graphics figures - graphics.xml.
 CommonTypes readTypes()
          Parses the configuration file with types - types.xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigParser

public ConfigParser()
Initializes a newly created ConfigParser. Sets up the SAX parser used for parsing.

Method Detail

readFigures

public void readFigures(java.util.Map<java.lang.String,Parameter> parameterList,
                        java.util.Map<java.lang.String,Figure> figureList)
                 throws ConfigException,
                        FileNotFoundException
Parses the configuration file with graphics figures - graphics.xml.

Parameters:
parameterList - the list of loaded parameters.
figureList - the list of loaded figures.
Throws:
ConfigException - if the configuration file or its XML schema isn't well-formed.
FileNotFoundException - if the configuration file or its XML schema doesn't exist.

readAttributes

public AttributeGroup[] readAttributes(CommonTypes commonTypes)
                                throws ConfigException,
                                       FileNotFoundException
Parses the configuration file with attributes - attributes.xml.

Parameters:
commonTypes - common types of parameters.
Returns:
a list of loaded attributes - key is attribute name.
Throws:
ConfigException - if the configuration file or its XML schema isn't well-formed.
FileNotFoundException - if the configuration file or its XML schema doesn't exist.

readConfig

public java.util.Map<java.lang.String,Figure> readConfig(ConfigData configData,
                                                         AttributeGroup[] attributeGroupList)
                                                  throws ConfigException,
                                                         FileNotFoundException
Parses the configuration file with layout of parameters and attribute-sets - config.xml.

Parameters:
configData - so far loaded data from configuration files.
attributeGroupList - the list of attribute groups.
Throws:
ConfigException - if the configuration file or its XML schema isn't well-formed.
FileNotFoundException - if the configuration file or its XML schema doesn't exist.

readTypes

public CommonTypes readTypes()
                      throws ConfigException,
                             FileNotFoundException
Parses the configuration file with types - types.xml.

Throws:
ConfigException - if the configuration file or its XML schema isn't well-formed.
FileNotFoundException - if the configuration file or its XML schema doesn't exist.