org.compass.core.util.config
Class XmlConfigurationHelperBuilder

java.lang.Object
  extended by org.compass.core.util.config.XmlConfigurationHelperBuilder

public class XmlConfigurationHelperBuilder
extends Object

A DefaultConfigurationBuilder builds Configurations from XML, via a SAX2 compliant parser.


Constructor Summary
XmlConfigurationHelperBuilder()
          Create a Configuration Builder with a default XMLReader that ignores namespaces.
XmlConfigurationHelperBuilder(boolean enableNamespaces)
          Create a Configuration Builder, specifying a flag that determines namespace support.
XmlConfigurationHelperBuilder(XMLReader parser)
          Create a Configuration Builder with your own XMLReader.
 
Method Summary
 ConfigurationHelper build(InputSource input)
          Build a configuration object using an XML InputSource object
 ConfigurationHelper build(InputStream inputStream, String systemId)
          Build a configuration object using an InputStream; supplying a systemId to make messages about all kinds of errors more meaningfull.
 ConfigurationHelper build(String uri)
          Build a configuration object using an URI
 ConfigurationHelper buildFromFile(File file)
          Build a configuration object from a file using a File object.
 ConfigurationHelper buildFromFile(String filename)
          Build a configuration object from a file using a filename.
protected  SAXConfigurationHandler getHandler()
          Get a SAXConfigurationHandler for your configuration reading.
 void setEntityResolver(EntityResolver resolver)
          Sets the EntityResolver to be used by parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlConfigurationHelperBuilder

public XmlConfigurationHelperBuilder()
Create a Configuration Builder with a default XMLReader that ignores namespaces. In order to enable namespaces, use either the constructor that has a boolean or that allows you to pass in your own namespace-enabled XMLReader.


XmlConfigurationHelperBuilder

public XmlConfigurationHelperBuilder(boolean enableNamespaces)
Create a Configuration Builder, specifying a flag that determines namespace support.


XmlConfigurationHelperBuilder

public XmlConfigurationHelperBuilder(XMLReader parser)
Create a Configuration Builder with your own XMLReader.

Method Detail

getHandler

protected SAXConfigurationHandler getHandler()
Get a SAXConfigurationHandler for your configuration reading.


buildFromFile

public ConfigurationHelper buildFromFile(String filename)
                                  throws ConfigurationException
Build a configuration object from a file using a filename.

Throws:
ConfigurationException

buildFromFile

public ConfigurationHelper buildFromFile(File file)
                                  throws ConfigurationException
Build a configuration object from a file using a File object.

Throws:
ConfigurationException

build

public ConfigurationHelper build(InputStream inputStream,
                                 String systemId)
                          throws ConfigurationException
Build a configuration object using an InputStream; supplying a systemId to make messages about all kinds of errors more meaningfull.

Throws:
ConfigurationException

build

public ConfigurationHelper build(String uri)
                          throws ConfigurationException
Build a configuration object using an URI

Throws:
ConfigurationException

build

public ConfigurationHelper build(InputSource input)
                          throws ConfigurationException
Build a configuration object using an XML InputSource object

Throws:
ConfigurationException

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Sets the EntityResolver to be used by parser. Useful when dealing with xml files that reference external entities.



Copyright (c) 2004-2008 The Compass Project.