org.foray.core
Class ConfigurationParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.foray.core.ConfigurationParser
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class ConfigurationParser
extends org.xml.sax.helpers.DefaultHandler

SAX2 Handler which retrieves the configuration information and stores them in Configuration. Normally this class doesn't need to be accessed directly.


Field Summary
static String FORAY_CONFIG_DTD_PUBLIC_ID
          Public ID of the FOray configuration DTD.
 
Constructor Summary
ConfigurationParser(SessionConfig sessionConfig, Configuration outputConfig, InputSource source)
          Constructor.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String localName, String qName)
           
 void parseDocument()
          Parses the encapsulated SAX InputSource and updates the encapsulated Configuration instances accordingly.
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORAY_CONFIG_DTD_PUBLIC_ID

public static final String FORAY_CONFIG_DTD_PUBLIC_ID
Public ID of the FOray configuration DTD.

See Also:
Constant Field Values
Constructor Detail

ConfigurationParser

public ConfigurationParser(SessionConfig sessionConfig,
                           Configuration outputConfig,
                           InputSource source)
                    throws FOrayException
Constructor.

Parameters:
sessionConfig - The SessionConfig instance which should be updated with general options found in the configuration file.
outputConfig - The RenderConfig instance which should be updated with renderer-specific options found in the configuration file.
source - the SAX InputSource which encapsulates the configuration file XML that should be parsed.
Throws:
FOrayException - For null sessionConfig or null outputConfig.
Method Detail

parseDocument

public void parseDocument()
                   throws FOrayException
Parses the encapsulated SAX InputSource and updates the encapsulated Configuration instances accordingly.

Throws:
FOrayException - If there are errors parsing the input.

startDocument

public void startDocument()
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler


Copyright © 2017. All rights reserved.