pmp.xml
Class XMLConfig

java.lang.Object
  extended by pmp.Macroprocessor.Component
      extended by pmp.xml.XMLConfig

public class XMLConfig
extends Macroprocessor.Component

Loads XML configuration files.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček

Field Summary
static java.lang.String DEFAULT_CONFIG
          Location of default configuration file.
 
Constructor Summary
XMLConfig(Macroprocessor mp, boolean loaddef)
          Reads configuration from default configuration file bundled with macroprocessor.
XMLConfig(Macroprocessor mp, java.lang.String xmlConfig)
          Reads configuration from file.
 
Method Summary
protected  void importConfig(java.lang.String url)
          Imports configuration data from file given by url into this configuration.
 boolean parseXMLDocument(org.w3c.dom.Document doc)
          Parses XML document.
 void reset()
          Clears the content of lists of macros and projects
 void writeToMacroList(MacroList ml)
          Writes list of macros into given MacroList.
 
Methods inherited from class pmp.Macroprocessor.Component
error, getMP, getMPAnalyzer, getMPIO, getMPIQ, getMPMacros, notice, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG

public static final java.lang.String DEFAULT_CONFIG
Location of default configuration file.

See Also:
Constant Field Values
Constructor Detail

XMLConfig

public XMLConfig(Macroprocessor mp,
                 boolean loaddef)
Reads configuration from default configuration file bundled with macroprocessor.

Parameters:
mp - instance of macroprocessor

XMLConfig

public XMLConfig(Macroprocessor mp,
                 java.lang.String xmlConfig)
          throws FatalParserException
Reads configuration from file.

Parameters:
mp - instance of macroprocessor
xmlConfig - name of configuration file
Throws:
FatalParserException - if file opening of file fails
Method Detail

parseXMLDocument

public boolean parseXMLDocument(org.w3c.dom.Document doc)
                         throws FatalParserException
Parses XML document.

Parameters:
doc - DOM Document
Returns:
true if successful
Throws:
FatalParserException

reset

public void reset()
Clears the content of lists of macros and projects


importConfig

protected void importConfig(java.lang.String url)
Imports configuration data from file given by url into this configuration.

Parameters:
url - location of source file

writeToMacroList

public void writeToMacroList(MacroList ml)
Writes list of macros into given MacroList.

Parameters:
ml - destination MacroList