Class ConfigParser

java.lang.Object
yearreview.app.config.ConfigParser

public class ConfigParser extends Object
Parser for the command line arguments and the configuration file.
Author:
ColdStone37
  • Field Details

    • XML_VERSION

      public static final String XML_VERSION
      Version of the configuration.
      See Also:
    • widgets

      private XmlNode widgets
      Configuration for the widgets.
    • dataSources

      private XmlNode dataSources
      Configuration for the data sources.
    • logger

      private static final Logger logger
  • Constructor Details

    • ConfigParser

      public ConfigParser(String[] args)
      Constructs a ConfigParser and parses the arguments and config file.
      Parameters:
      args - command line arguments
  • Method Details

    • getOptions

      private static org.apache.commons.cli.Options getOptions()
      Gets the Command line options.
      Returns:
      options with descriptions
    • parseConfigFile

      private void parseConfigFile(String file)
      Parses the configuration file specified in the command line arguments.
      Parameters:
      file - configuration file to parse
    • getWidgetSettings

      public XmlNode getWidgetSettings()
      Gets the configuration for the widgets.
      Returns:
      configuration
    • getDataSourcesSettings

      public XmlNode getDataSourcesSettings()
      Gets the configuration for the data sources.
      Returns:
      configuration
    • parseSettings

      private void parseSettings(XmlNode settings)
      Parses the settings part of the configuration file.
      Parameters:
      settings - configuration node containing the settings