Top Description Fields Constructors Methods
org.apache.avalon.framework.configuration

public Class NamespacedSAXConfigurationHandler

extends SAXConfigurationHandler
Class Inheritance
Imports
java.util.ArrayList, .BitSet, .Iterator, org.xml.sax.Attributes, .Locator, .SAXException, .SAXParseException, org.xml.sax.helpers.AttributesImpl, .NamespaceSupport

A SAXConfigurationHandler helps build Configurations out of sax events, including namespace information.
Author
Avalon Development Team
Version
$Id: NamespacedSAXConfigurationHandler.java 506231 2007-02-12 02:36:54Z crossley $

Field Summary

Modifier and TypeField and Description
private static final int
private Configuration
private final ArrayList<E>
private Locator
private NamespaceSupport
private final ArrayList<E>
private final BitSet
m_preserveSpace

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.m_preserveSpace.

Contains true at index n if space in the configuration with depth n is to be preserved.
private final ArrayList<E>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
characters(final char[]
a char[] of data
ch
,
int
offset in the character array from which to start reading
start
,
int
length of character data
end
)

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Handling hook for character data.
public void
clear()

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.clear.

Clears all data from this configuration handler.
protected DefaultConfiguration

Returns:

a DefaultConfiguration value
createConfiguration
(final String
a String value
localName
,
final String
a String value
namespaceURI
,
final String
a String value
location
)

Create a new DefaultConfiguration with the specified local name, namespace, and location.

public void
endDocument()

Overrides org.xml.sax.helpers.DefaultHandler.endDocument.

Implements org.xml.sax.ContentHandler.endDocument.

Handling hook for ending the document parsing.
public void
endElement(final String
a String value
namespaceURI
,
final String
a String value
localName
,
final String
a String value
rawName
)

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Handling hook for finishing parsing of an element.
public void
error(final SAXParseException
the parse error
exception
)

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.error.

Implements org.xml.sax.ErrorHandler.error.

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

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

This just throws an exception on a parse error.
public Configuration

Returns:

a Configuration object
getConfiguration
()

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.getConfiguration.

Get the configuration object that was built.
protected String

Returns:

a String value
getLocationString
()

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.getLocationString.

Returns a string showing the current system ID, line number and column number.
public void
public void
startDocument()

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Handling hook for starting the document parsing.
public void
startElement(final String
a String value
namespaceURI
,
final String
a String value
localName
,
final String
a String value
rawName
,
final Attributes
an Attributes value
attributes
)

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Handling hook for starting parsing of an element.
public void
startPrefixMapping(String
a String value
prefix
,
String
a String value
uri
)

Overrides org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Handling hook for starting prefix mapping.
public void
warning(final SAXParseException
the parse error
exception
)

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

This just throws an exception on a parse error.
Inherited from org.apache.avalon.framework.configuration.SAXConfigurationHandler:
createConfiguration

Field Detail

EXPECTED_DEPTHback to summary
private static final int EXPECTED_DEPTH

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.EXPECTED_DEPTH.

Likely number of nested configuration items. If more is encountered the lists will grow automatically.

m_configurationback to summary
private Configuration m_configuration

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.m_configuration.

m_elementsback to summary
private final ArrayList<E> m_elements

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.m_elements.

m_locatorback to summary
private Locator m_locator

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.m_locator.

m_namespaceSupportback to summary
private NamespaceSupport m_namespaceSupport
m_prefixesback to summary
private final ArrayList<E> m_prefixes
m_preserveSpaceback to summary
private final BitSet m_preserveSpace

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.m_preserveSpace.

Contains true at index n if space in the configuration with depth n is to be preserved.

m_valuesback to summary
private final ArrayList<E> m_values

Hides org.apache.avalon.framework.configuration.SAXConfigurationHandler.m_values.

Constructor Detail

NamespacedSAXConfigurationHandlerback to summary
public NamespacedSAXConfigurationHandler()

Method Detail

charactersback to summary
public void characters(final char[] ch, int start, int end) throws SAXException

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Handling hook for character data.

Parameters
ch:char[]

a char[] of data

start:int

offset in the character array from which to start reading

end:int

length of character data

Exceptions
SAXException:
if an error occurs
clearback to summary
public void clear()

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.clear.

Clears all data from this configuration handler.

createConfigurationback to summary
protected DefaultConfiguration createConfiguration(final String localName, final String namespaceURI, final String location)

Create a new DefaultConfiguration with the specified local name, namespace, and location.

Parameters
localName:String

a String value

namespaceURI:String

a String value

location:String

a String value

Returns:DefaultConfiguration

a DefaultConfiguration value

endDocumentback to summary
public void endDocument() throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.endDocument.

Implements org.xml.sax.ContentHandler.endDocument.

Handling hook for ending the document parsing.

Exceptions
SAXException:
if an error occurs
endElementback to summary
public void endElement(final String namespaceURI, final String localName, final String rawName) throws SAXException

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Handling hook for finishing parsing of an element.

Parameters
namespaceURI:String

a String value

localName:String

a String value

rawName:String

a String value

Exceptions
SAXException:
if an error occurs
errorback to summary
public void error(final SAXParseException exception) throws SAXException

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.error.

Implements org.xml.sax.ErrorHandler.error.

This just throws an exception on a parse error.

Parameters
exception:SAXParseException

the parse error

Exceptions
SAXException:
if an error occurs
fatalErrorback to summary
public void fatalError(final SAXParseException exception) throws SAXException

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

This just throws an exception on a parse error.

Parameters
exception:SAXParseException

the parse error

Exceptions
SAXException:
if an error occurs
getConfigurationback to summary
public Configuration getConfiguration()

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.getConfiguration.

Get the configuration object that was built.

Returns:Configuration

a Configuration object

getLocationStringback to summary
protected String getLocationString()

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.getLocationString.

Returns a string showing the current system ID, line number and column number.

Returns:String

a String value

setDocumentLocatorback to summary
public void setDocumentLocator(final Locator locator)

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Set the document Locator to use.

Parameters
locator:Locator

a Locator value

startDocumentback to summary
public void startDocument() throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Handling hook for starting the document parsing.

Exceptions
SAXException:
if an error occurs
startElementback to summary
public void startElement(final String namespaceURI, final String localName, final String rawName, final Attributes attributes) throws SAXException

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Handling hook for starting parsing of an element.

Parameters
namespaceURI:String

a String value

localName:String

a String value

rawName:String

a String value

attributes:Attributes

an Attributes value

Exceptions
SAXException:
if an error occurs
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Handling hook for starting prefix mapping.

Parameters
prefix:String

a String value

uri:String

a String value

Exceptions
SAXException:
if an error occurs
warningback to summary
public void warning(final SAXParseException exception) throws SAXException

Overrides org.apache.avalon.framework.configuration.SAXConfigurationHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

This just throws an exception on a parse error.

Parameters
exception:SAXParseException

the parse error

Exceptions
SAXException:
if an error occurs