Class NamespacedSAXConfigurationHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.avalon.framework.configuration.SAXConfigurationHandler
org.apache.avalon.framework.configuration.NamespacedSAXConfigurationHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
A SAXConfigurationHandler helps build Configurations out of sax events,
including namespace information.
- Version:
- CVS $Revision: 1.20 $ $Date: 2004/02/11 14:34:25 $
- Author:
- Avalon Development Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int end) Handling hook for character data.void
clear()
Clears all data from this configuration handler.protected DefaultConfiguration
createConfiguration
(String localName, String namespaceURI, String location) Create a newDefaultConfiguration
with the specified local name, namespace, and location.void
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.Get the configuration object that was built.protected String
Returns a string showing the current system ID, line number and column number.void
setDocumentLocator
(Locator locator) Set the documentLocator
to use.void
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.apache.avalon.framework.configuration.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
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
NamespacedSAXConfigurationHandler
public NamespacedSAXConfigurationHandler()
-
-
Method Details
-
getConfiguration
Get the configuration object that was built.- Overrides:
getConfiguration
in classSAXConfigurationHandler
- Returns:
- a
Configuration
object
-
clear
public void clear()Clears all data from this configuration handler.- Overrides:
clear
in classSAXConfigurationHandler
-
setDocumentLocator
Set the documentLocator
to use.- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classSAXConfigurationHandler
- Parameters:
locator
- aLocator
value
-
startDocument
Handling hook for starting the document parsing.- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
- if an error occurs
-
endDocument
Handling hook for ending the document parsing.- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
- if an error occurs
-
characters
Handling hook for character data.- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classSAXConfigurationHandler
- Parameters:
ch
- achar[]
of datastart
- offset in the character array from which to start readingend
- length of character data- Throws:
SAXException
- if an error occurs
-
endElement
Handling hook for finishing parsing of an element.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classSAXConfigurationHandler
- Parameters:
namespaceURI
- aString
valuelocalName
- aString
valuerawName
- aString
value- Throws:
SAXException
- if an error occurs
-
createConfiguration
protected DefaultConfiguration createConfiguration(String localName, String namespaceURI, String location) Create a newDefaultConfiguration
with the specified local name, namespace, and location.- Parameters:
localName
- aString
valuenamespaceURI
- aString
valuelocation
- aString
value- Returns:
- a
DefaultConfiguration
value
-
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 interfaceContentHandler
- Overrides:
startElement
in classSAXConfigurationHandler
- Parameters:
namespaceURI
- aString
valuelocalName
- aString
valuerawName
- aString
valueattributes
- anAttributes
value- Throws:
SAXException
- if an error occurs
-
error
This just throws an exception on a parse error.- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classSAXConfigurationHandler
- Parameters:
exception
- the parse error- Throws:
SAXException
- if an error occurs
-
warning
This just throws an exception on a parse error.- Specified by:
warning
in interfaceErrorHandler
- Overrides:
warning
in classSAXConfigurationHandler
- Parameters:
exception
- the parse error- Throws:
SAXException
- if an error occurs
-
fatalError
This just throws an exception on a parse error.- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classSAXConfigurationHandler
- Parameters:
exception
- the parse error- Throws:
SAXException
- if an error occurs
-
getLocationString
Returns a string showing the current system ID, line number and column number.- Overrides:
getLocationString
in classSAXConfigurationHandler
- Returns:
- a
String
value
-
startPrefixMapping
Handling hook for starting prefix mapping.- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classDefaultHandler
- Parameters:
prefix
- aString
valueuri
- aString
value- Throws:
SAXException
- if an error occurs
-