com.lonniepryor.blues.xml
Class XmlParser

java.lang.Object
  |
  +--com.lonniepryor.blues.xml.XmlParser

public class XmlParser
extends java.lang.Object

Responsible for loading XML Schemas and parsing application and module configurations. NOTE: this class is NOT thread-safe and instances may only be used on a single thread at a time.

Version:
$Revision: 1.2 $
Author:
Lonnie Pryor

Constructor Summary
  XmlParser(java.lang.ClassLoader classLoader)
          Creates a new XmlParser object.
protected XmlParser(java.lang.ClassLoader classLoader, javax.xml.parsers.SAXParser schemaValidatingParser)
          Creates a new XmlParser object.
  XmlParser(java.lang.ClassLoader classLoader, javax.xml.parsers.SAXParserFactory saxParserFactory)
          Creates a new XmlParser object.
 
Method Summary
static javax.xml.parsers.SAXParser createSchemaValidatingParser(java.lang.ClassLoader classLoader, javax.xml.parsers.SAXParserFactory saxParserFactory)
          Creates a JAXP 1.2 parser that validates according to XML Schema.
 ApplicationCfg parseApplication(java.lang.String documentPath)
          Parses a Blues application configuration file.
 ModuleCfg parseModule(java.lang.String documentPath)
          Parses a Blues module configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlParser

public XmlParser(java.lang.ClassLoader classLoader)
Creates a new XmlParser object.

Parameters:
classLoader - The class loader to use.

XmlParser

public XmlParser(java.lang.ClassLoader classLoader,
                 javax.xml.parsers.SAXParserFactory saxParserFactory)
Creates a new XmlParser object.

Parameters:
classLoader - The class loader to use.
saxParserFactory - FIXME

XmlParser

protected XmlParser(java.lang.ClassLoader classLoader,
                    javax.xml.parsers.SAXParser schemaValidatingParser)
Creates a new XmlParser object.

Parameters:
classLoader - The class loader to use.
schemaValidatingParser - FIXME
Method Detail

createSchemaValidatingParser

public static javax.xml.parsers.SAXParser createSchemaValidatingParser(java.lang.ClassLoader classLoader,
                                                                       javax.xml.parsers.SAXParserFactory saxParserFactory)
Creates a JAXP 1.2 parser that validates according to XML Schema.

Parameters:
classLoader - The class loader to load schemas from.
saxParserFactory - The sax parser factory to construct a parser with.
Returns:
A JAXP 1.2 parser that validates according to XML Schema.

parseApplication

public ApplicationCfg parseApplication(java.lang.String documentPath)
Parses a Blues application configuration file.

Parameters:
documentPath - The location of the configuration file.
Returns:
The assembled application configuration.

parseModule

public ModuleCfg parseModule(java.lang.String documentPath)
Parses a Blues module configuration file.

Parameters:
documentPath - The location of the configuration file.
Returns:
The assembled module configuration.


Copyright © 2003 Blues Framework. All Rights Reserved.