org.compass.core.util.config
Class NamespacedSAXConfigurationHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.compass.core.util.config.SAXConfigurationHandler
          extended by org.compass.core.util.config.NamespacedSAXConfigurationHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class NamespacedSAXConfigurationHandler
extends SAXConfigurationHandler

A SAXConfigurationHandler helps build Configurations out of sax events, including namespace information.


Constructor Summary
NamespacedSAXConfigurationHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int end)
          Handling hook for character data.
 void clear()
          Clears all data from this configuration handler.
protected  PlainConfigurationHelper createConfiguration(String localName, String namespaceURI, String location)
          Create a new DefaultConfiguration with the specified local name, namespace, and location.
 void endDocument()
          Handling hook for ending the document parsing.
 void endElement(String namespaceURI, String localName, String rawName)
          Handling hook for finishing parsing of an element.
 void error(SAXParseException exception)
          This just throws an exception on a parse error.
 void fatalError(SAXParseException exception)
          This just throws an exception on a parse error.
 ConfigurationHelper getConfiguration()
          Get the configuration object that was built.
protected  String getLocationString()
          Returns a string showing the current system ID, line number and column number.
 void setDocumentLocator(Locator locator)
          Set the document Locator to use.
 void startDocument()
          Handling hook for starting the document parsing.
 void startElement(String namespaceURI, String localName, String rawName, Attributes attributes)
          Handling hook for starting parsing of an element.
 void startPrefixMapping(String prefix, String uri)
          Handling hook for starting prefix mapping.
 void warning(SAXParseException exception)
          This just throws an exception on a parse error.
 
Methods inherited from class org.compass.core.util.config.SAXConfigurationHandler
createConfiguration
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespacedSAXConfigurationHandler

public NamespacedSAXConfigurationHandler()
Method Detail

getConfiguration

public ConfigurationHelper getConfiguration()
Get the configuration object that was built.

Overrides:
getConfiguration in class SAXConfigurationHandler
Returns:
a Configuration object

clear

public void clear()
Clears all data from this configuration handler.

Overrides:
clear in class SAXConfigurationHandler

setDocumentLocator

public void setDocumentLocator(Locator locator)
Set the document Locator to use.

Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class SAXConfigurationHandler

startDocument

public void startDocument()
                   throws SAXException
Handling hook for starting the document parsing.

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Handling hook for ending the document parsing.

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int end)
                throws SAXException
Handling hook for character data.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class SAXConfigurationHandler
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String rawName)
                throws SAXException
Handling hook for finishing parsing of an element.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class SAXConfigurationHandler
Throws:
SAXException

createConfiguration

protected PlainConfigurationHelper createConfiguration(String localName,
                                                       String namespaceURI,
                                                       String location)
Create a new DefaultConfiguration with the specified local name, namespace, and location.


startElement

public void startElement(String namespaceURI,
                         String localName,
                         String rawName,
                         Attributes attributes)
                  throws SAXException
Handling hook for starting parsing of an element.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class SAXConfigurationHandler
Throws:
SAXException

error

public void error(SAXParseException exception)
           throws SAXException
This just throws an exception on a parse error.

Specified by:
error in interface ErrorHandler
Overrides:
error in class SAXConfigurationHandler
Throws:
SAXException

warning

public void warning(SAXParseException exception)
             throws SAXException
This just throws an exception on a parse error.

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class SAXConfigurationHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
This just throws an exception on a parse error.

Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class SAXConfigurationHandler
Throws:
SAXException

getLocationString

protected String getLocationString()
Returns a string showing the current system ID, line number and column number.

Overrides:
getLocationString in class SAXConfigurationHandler

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Handling hook for starting prefix mapping.

Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class DefaultHandler
Throws:
SAXException


Copyright (c) 2004-2008 The Compass Project.