org.apache.xerces.parsers

Class AbstractSAXParser

Implemented Interfaces:
Parser, org.apache.xerces.xs.PSVIProvider, XMLReader, org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.XMLDTDContentModelHandler, org.apache.xerces.xni.XMLDTDHandler
Known Direct Subclasses:
SAXParser

public abstract class AbstractSAXParser
extends AbstractXMLDocumentParser
implements org.apache.xerces.xs.PSVIProvider, Parser, XMLReader

This is the base class of all SAX parsers. It implements both the SAX1 and SAX2 parser functionality, while the actual pipeline is defined in the parser configuration.
Version:
$Id: AbstractSAXParser.java,v 1.59 2005/06/24 02:33:43 mrglavas Exp $
Authors:
Arnaud Le Hors, IBM
Andy Clark, IBM

Nested Class Summary

protected static class
AbstractSAXParser.AttributesProxy
protected class
AbstractSAXParser.LocatorProxy

Field Summary

protected static String
ALLOW_UE_AND_NOTATION_EVENTS
Feature identifier: allow notation and unparsed entity events to be sent out of order.
protected static String
DECLARATION_HANDLER
Property id: declaration handler.
protected static String
DOM_NODE
Property id: DOM node.
protected static String
LEXICAL_HANDLER
Property id: lexical handler.
protected static String
NAMESPACES
Feature identifier: namespaces.
protected static String
NAMESPACE_PREFIXES
Feature identifier: namespace prefixes.
protected static String
STRING_INTERNING
Feature id: string interning.
protected ContentHandler
fContentHandler
Content handler.
protected org.xml.sax.DTDHandler
fDTDHandler
DTD handler.
protected DeclHandler
fDeclHandler
Decl handler.
protected SymbolHash
fDeclaredAttrs
protected DocumentHandler
fDocumentHandler
Document handler.
protected LexicalHandler
fLexicalHandler
Lexical handler.
protected boolean
fLexicalHandlerParameterEntities
Lexical handler parameter entities.
protected org.apache.xerces.xni.NamespaceContext
fNamespaceContext
Namespace context
protected boolean
fNamespacePrefixes
Namespace prefixes.
protected boolean
fNamespaces
Namespaces.
protected boolean
fParseInProgress
True if a parse is in progress.
protected org.apache.xerces.xni.QName
fQName
protected boolean
fResolveDTDURIs
Resolve DTD URIs.
protected boolean
fStandalone
Standalone document declaration.
protected boolean
fUseEntityResolver2
Use EntityResolver2.
protected String
fVersion
protected boolean
fXMLNSURIs
XMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace.

Fields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser

fDTDContentModelSource, fDTDSource, fDocumentSource, fInDTD

Fields inherited from class org.apache.xerces.parsers.XMLParser

ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration

Fields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler

OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE

Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler

CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE

Constructor Summary

AbstractSAXParser(org.apache.xerces.xni.parser.XMLParserConfiguration config)
Default constructor.

Method Summary

void
attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, org.apache.xerces.xni.XMLString defaultValue, org.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.apache.xerces.xni.Augmentations augs)
An attribute declaration.
void
characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
Character content.
void
comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
A comment.
void
doctypeDecl(String rootElement, String publicId, String systemId, org.apache.xerces.xni.Augmentations augs)
Notifies of the presence of the DOCTYPE line in the document.
void
elementDecl(String name, String contentModel, org.apache.xerces.xni.Augmentations augs)
An element declaration.
void
endCDATA(org.apache.xerces.xni.Augmentations augs)
The end of a CDATA section.
void
endDTD(org.apache.xerces.xni.Augmentations augs)
The end of the DTD.
void
endDocument(org.apache.xerces.xni.Augmentations augs)
The end of the document.
void
endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs)
The end of an element.
void
endExternalSubset(org.apache.xerces.xni.Augmentations augs)
The end of the DTD external subset.
void
endGeneralEntity(String name, org.apache.xerces.xni.Augmentations augs)
This method notifies the end of an entity.
protected void
endNamespaceMapping()
Send endPrefixMapping events
void
endParameterEntity(String name, org.apache.xerces.xni.Augmentations augs)
This method notifies the end of an entity.
void
externalEntityDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs)
An external entity declaration.
org.apache.xerces.xs.AttributePSVI
getAttributePSVI(int index)
org.apache.xerces.xs.AttributePSVI
getAttributePSVIByName(String uri, String localname)
ContentHandler
getContentHandler()
Return the current content handler.
DTDHandler
getDTDHandler()
Return the current DTD handler.
protected DeclHandler
getDeclHandler()
Returns the DTD declaration event handler.
org.apache.xerces.xs.ElementPSVI
getElementPSVI()
EntityResolver
getEntityResolver()
Return the current entity resolver.
ErrorHandler
getErrorHandler()
Return the current error handler.
boolean
getFeature(String featureId)
Query the state of a feature.
protected LexicalHandler
getLexicalHandler()
Returns the lexical handler.
Object
getProperty(String propertyId)
Query the value of a property.
void
ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
Ignorable whitespace.
void
internalEntityDecl(String name, org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.XMLString nonNormalizedText, org.apache.xerces.xni.Augmentations augs)
An internal entity declaration.
void
notationDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs)
A notation declaration
void
parse(InputSource inputSource)
parse
void
parse(String systemId)
Parses the input source specified by the given system identifier.
void
processingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs)
A processing instruction.
void
reset()
Reset all components before parsing.
void
setContentHandler(ContentHandler contentHandler)
Allow an application to register a content event handler.
void
setDTDHandler(DTDHandler dtdHandler)
Allow an application to register a DTD event handler.
protected void
setDeclHandler(DeclHandler handler)
Set the DTD declaration event handler.
void
setDocumentHandler(DocumentHandler documentHandler)
Allow an application to register a document event handler.
void
setEntityResolver(EntityResolver resolver)
Sets the resolver used to resolve external entities.
void
setErrorHandler(ErrorHandler errorHandler)
Allow an application to register an error event handler.
void
setFeature(String featureId, boolean state)
Set the state of any feature in a SAX2 parser.
protected void
setLexicalHandler(LexicalHandler handler)
Set the lexical event handler.
void
setLocale(Locale locale)
Set the locale to use for messages.
void
setProperty(String propertyId, Object value)
Set the value of any property in a SAX2 parser.
void
startCDATA(org.apache.xerces.xni.Augmentations augs)
The start of a CDATA section.
void
startDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs)
The start of the document.
void
startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
The start of an element.
void
startExternalSubset(org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augs)
The start of the DTD external subset.
void
startGeneralEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs)
This method notifies of the start of an entity.
protected void
startNamespaceMapping()
Send startPrefixMapping events
void
startParameterEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs)
This method notifies of the start of parameter entity.
void
unparsedEntityDecl(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String notation, org.apache.xerces.xni.Augmentations augs)
An unparsed entity declaration.
void
xmlDecl(String version, String encoding, String standalone, org.apache.xerces.xni.Augmentations augs)
Notifies of the presence of an XMLDecl line in the document.

Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser

any, attributeDecl, characters, comment, doctypeDecl, element, elementDecl, empty, emptyElement, endAttlist, endCDATA, endConditional, endContentModel, endDTD, endDocument, endElement, endExternalSubset, endGeneralEntity, endGroup, endParameterEntity, externalEntityDecl, getDTDContentModelSource, getDTDSource, getDocumentSource, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, occurrence, pcdata, processingInstruction, reset, separator, setDTDContentModelSource, setDTDSource, setDocumentSource, startAttlist, startCDATA, startConditional, startContentModel, startDTD, startDocument, startElement, startExternalSubset, startGeneralEntity, startGroup, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl

Methods inherited from class org.apache.xerces.parsers.XMLParser

parse, reset

Field Details

ALLOW_UE_AND_NOTATION_EVENTS

protected static final String ALLOW_UE_AND_NOTATION_EVENTS
Feature identifier: allow notation and unparsed entity events to be sent out of order.

DECLARATION_HANDLER

protected static final String DECLARATION_HANDLER
Property id: declaration handler.

DOM_NODE

protected static final String DOM_NODE
Property id: DOM node.

LEXICAL_HANDLER

protected static final String LEXICAL_HANDLER
Property id: lexical handler.

NAMESPACES

protected static final String NAMESPACES
Feature identifier: namespaces.

NAMESPACE_PREFIXES

protected static final String NAMESPACE_PREFIXES
Feature identifier: namespace prefixes.

STRING_INTERNING

protected static final String STRING_INTERNING
Feature id: string interning.

fContentHandler

protected ContentHandler fContentHandler
Content handler.

fDTDHandler

protected org.xml.sax.DTDHandler fDTDHandler
DTD handler.

fDeclHandler

protected DeclHandler fDeclHandler
Decl handler.

fDeclaredAttrs

protected SymbolHash fDeclaredAttrs

fDocumentHandler

protected DocumentHandler fDocumentHandler
Document handler.

fLexicalHandler

protected LexicalHandler fLexicalHandler
Lexical handler.

fLexicalHandlerParameterEntities

protected boolean fLexicalHandlerParameterEntities
Lexical handler parameter entities.

fNamespaceContext

protected org.apache.xerces.xni.NamespaceContext fNamespaceContext
Namespace context

fNamespacePrefixes

protected boolean fNamespacePrefixes
Namespace prefixes.

fNamespaces

protected boolean fNamespaces
Namespaces.

fParseInProgress

protected boolean fParseInProgress
True if a parse is in progress. This state is needed because some features/properties cannot be set while parsing (e.g. validation and namespaces).

fQName

protected org.apache.xerces.xni.QName fQName

fResolveDTDURIs

protected boolean fResolveDTDURIs
Resolve DTD URIs.

fStandalone

protected boolean fStandalone
Standalone document declaration.

fUseEntityResolver2

protected boolean fUseEntityResolver2
Use EntityResolver2.

fVersion

protected String fVersion

fXMLNSURIs

protected boolean fXMLNSURIs
XMLNS URIs: Namespace declarations in the http://www.w3.org/2000/xmlns/ namespace.

Constructor Details

AbstractSAXParser

protected AbstractSAXParser(org.apache.xerces.xni.parser.XMLParserConfiguration config)
Default constructor.

Method Details

attributeDecl

public void attributeDecl(String elementName,
                          String attributeName,
                          String type,
                          String[] enumeration,
                          String defaultType,
                          org.apache.xerces.xni.XMLString defaultValue,
                          org.apache.xerces.xni.XMLString nonNormalizedDefaultValue,
                          org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
An attribute declaration.
Specified by:
attributeDecl in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
attributeDecl in interface AbstractXMLDocumentParser
Parameters:
elementName - The name of the element that this attribute is associated with.
attributeName - The name of the attribute.
type - The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION".
enumeration - If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null.
defaultType - The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null.
defaultValue - The attribute default value, or null if no default value is specified.
nonNormalizedDefaultValue - The attribute default value with no normalization performed, or null if no default value is specified.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

characters

public void characters(org.apache.xerces.xni.XMLString text,
                       org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
Character content.
Specified by:
characters in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
characters in interface AbstractXMLDocumentParser
Parameters:
text - The content.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

comment

public void comment(org.apache.xerces.xni.XMLString text,
                    org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
A comment.
Specified by:
comment in interface org.apache.xerces.xni.XMLDocumentHandler
comment in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
comment in interface AbstractXMLDocumentParser
Parameters:
text - The text in the comment.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by application to signal an error.

doctypeDecl

public void doctypeDecl(String rootElement,
                        String publicId,
                        String systemId,
                        org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
Notifies of the presence of the DOCTYPE line in the document.
Specified by:
doctypeDecl in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
doctypeDecl in interface AbstractXMLDocumentParser
Parameters:
rootElement - The name of the root element.
publicId - The public identifier if an external DTD or null if the external DTD is specified using SYSTEM.
systemId - The system identifier if an external DTD, null otherwise.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

elementDecl

public void elementDecl(String name,
                        String contentModel,
                        org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
An element declaration.
Specified by:
elementDecl in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
elementDecl in interface AbstractXMLDocumentParser
Parameters:
name - The name of the element.
contentModel - The element content model.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endCDATA

public void endCDATA(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The end of a CDATA section.
Specified by:
endCDATA in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endCDATA in interface AbstractXMLDocumentParser
Parameters:
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endDTD

public void endDTD(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The end of the DTD.
Specified by:
endDTD in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
endDTD in interface AbstractXMLDocumentParser
Parameters:
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endDocument

public void endDocument(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The end of the document.
Specified by:
endDocument in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endDocument in interface AbstractXMLDocumentParser
Parameters:
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endElement

public void endElement(org.apache.xerces.xni.QName element,
                       org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The end of an element.
Specified by:
endElement in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endElement in interface AbstractXMLDocumentParser
Parameters:
element - The name of the element.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endExternalSubset

public void endExternalSubset(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The end of the DTD external subset.
Specified by:
endExternalSubset in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
endExternalSubset in interface AbstractXMLDocumentParser
Parameters:
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endGeneralEntity

public void endGeneralEntity(String name,
                             org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
This method notifies the end of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

Note: Since the document is an entity, the handler will be notified of the end of the document entity by calling the endEntity method with the entity name "[xml]" after calling the endDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

Note: This method is not called for entity references appearing as part of attribute values.

Specified by:
endGeneralEntity in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
endGeneralEntity in interface AbstractXMLDocumentParser
Parameters:
name - The name of the entity.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

endNamespaceMapping

protected final void endNamespaceMapping()
            throws SAXException
Send endPrefixMapping events

endParameterEntity

public void endParameterEntity(String name,
                               org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
This method notifies the end of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

Note: Since the document is an entity, the handler will be notified of the end of the document entity by calling the endEntity method with the entity name "[xml]" after calling the endDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

Note: This method is not called for entity references appearing as part of attribute values.

Specified by:
endParameterEntity in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
endParameterEntity in interface AbstractXMLDocumentParser
Parameters:
name - The name of the parameter entity.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

externalEntityDecl

public void externalEntityDecl(String name,
                               org.apache.xerces.xni.XMLResourceIdentifier identifier,
                               org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
An external entity declaration.
Specified by:
externalEntityDecl in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
externalEntityDecl in interface AbstractXMLDocumentParser
Parameters:
name - The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.
identifier - An object containing all location information pertinent to this entity.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

getAttributePSVI

public org.apache.xerces.xs.AttributePSVI getAttributePSVI(int index)
Specified by:
getAttributePSVI in interface org.apache.xerces.xs.PSVIProvider

getAttributePSVIByName

public org.apache.xerces.xs.AttributePSVI getAttributePSVIByName(String uri,
                                                                 String localname)
Specified by:
getAttributePSVIByName in interface org.apache.xerces.xs.PSVIProvider

getContentHandler

public ContentHandler getContentHandler()
Return the current content handler.
Returns:
The current content handler, or null if none has been registered.

getDTDHandler

public DTDHandler getDTDHandler()
Return the current DTD handler.
Returns:
The current DTD handler, or null if none has been registered.

getDeclHandler

protected DeclHandler getDeclHandler()
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Returns the DTD declaration event handler.

getElementPSVI

public org.apache.xerces.xs.ElementPSVI getElementPSVI()
Specified by:
getElementPSVI in interface org.apache.xerces.xs.PSVIProvider

getEntityResolver

public EntityResolver getEntityResolver()
Return the current entity resolver.
Returns:
The current entity resolver, or null if none has been registered.

getErrorHandler

public ErrorHandler getErrorHandler()
Return the current error handler.
Returns:
The current error handler, or null if none has been registered.

getFeature

public boolean getFeature(String featureId)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Query the state of a feature. Query the current state of any feature in a SAX2 parser. The parser might not recognize the feature.
Parameters:
featureId - The unique identifier (URI) of the feature being set.
Returns:
The current state of the feature.

getLexicalHandler

protected LexicalHandler getLexicalHandler()
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Returns the lexical handler.

getProperty

public Object getProperty(String propertyId)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Query the value of a property. Return the current value of a property in a SAX2 parser. The parser might not recognize the property.
Parameters:
propertyId - The unique identifier (URI) of the property being set.
Returns:
The current value of the property.

ignorableWhitespace

public void ignorableWhitespace(org.apache.xerces.xni.XMLString text,
                                org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
Ignorable whitespace. For this method to be called, the document source must have some way of determining that the text containing only whitespace characters should be considered ignorable. For example, the validator can determine if a length of whitespace characters in the document are ignorable based on the element content model.
Specified by:
ignorableWhitespace in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
ignorableWhitespace in interface AbstractXMLDocumentParser
Parameters:
text - The ignorable whitespace.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

internalEntityDecl

public void internalEntityDecl(String name,
                               org.apache.xerces.xni.XMLString text,
                               org.apache.xerces.xni.XMLString nonNormalizedText,
                               org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
An internal entity declaration.
Specified by:
internalEntityDecl in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
internalEntityDecl in interface AbstractXMLDocumentParser
Parameters:
name - The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.
text - The value of the entity.
nonNormalizedText - The non-normalized value of the entity. This value contains the same sequence of characters that was in the internal entity declaration, without any entity references expanded.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

notationDecl

public void notationDecl(String name,
                         org.apache.xerces.xni.XMLResourceIdentifier identifier,
                         org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
A notation declaration
Specified by:
notationDecl in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
notationDecl in interface AbstractXMLDocumentParser
Parameters:
name - The name of the notation.
identifier - An object containing all location information pertinent to this notation.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

parse

public void parse(InputSource inputSource)
            throws SAXException,
                   IOException
parse
Parameters:
inputSource -

parse

public void parse(String systemId)
            throws SAXException,
                   IOException
Parses the input source specified by the given system identifier.

This method is equivalent to the following:

     parse(new InputSource(systemId));
 
Parameters:
systemId - The system identifier (URI).

processingInstruction

public void processingInstruction(String target,
                                  org.apache.xerces.xni.XMLString data,
                                  org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
A processing instruction. Processing instructions consist of a target name and, optionally, text data. The data is only meaningful to the application.

Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.

Specified by:
processingInstruction in interface org.apache.xerces.xni.XMLDocumentHandler
processingInstruction in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
processingInstruction in interface AbstractXMLDocumentParser
Parameters:
target - The target.
data - The data or null if none specified.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

reset

public void reset()
            throws org.apache.xerces.xni.XNIException
Reset all components before parsing.
Overrides:
reset in interface AbstractXMLDocumentParser
Throws:
org.apache.xerces.xni.XNIException - Thrown if an error occurs during initialization.

setContentHandler

public void setContentHandler(ContentHandler contentHandler)
Allow an application to register a content event handler.

If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
contentHandler - The content handler.

setDTDHandler

public void setDTDHandler(DTDHandler dtdHandler)
Allow an application to register a DTD event handler.

If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
dtdHandler - The DTD handler.

setDeclHandler

protected void setDeclHandler(DeclHandler handler)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Set the DTD declaration event handler.

This method is the equivalent to the property:

 http://xml.org/sax/properties/declaration-handler
 
Parameters:
handler - The new handler.

setDocumentHandler

public void setDocumentHandler(DocumentHandler documentHandler)
Allow an application to register a document event handler.

If the application does not register a document handler, all document events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by HandlerBase).

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
documentHandler - The document handler.

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Sets the resolver used to resolve external entities. The EntityResolver interface supports resolution of public and system identifiers.
Parameters:
resolver - The new entity resolver. Passing a null value will uninstall the currently installed resolver.

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Allow an application to register an error event handler.

If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
errorHandler - The error handler.

setFeature

public void setFeature(String featureId,
                       boolean state)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.
Parameters:
featureId - The unique identifier (URI) of the feature.
state - The requested state of the feature (true or false).

setLexicalHandler

protected void setLexicalHandler(LexicalHandler handler)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Set the lexical event handler.

This method is the equivalent to the property:

 http://xml.org/sax/properties/lexical-handler
 
Parameters:
handler - lexical event handler

setLocale

public void setLocale(Locale locale)
            throws SAXException
Set the locale to use for messages.
Parameters:
locale - The locale object to use for localization of messages.
See Also:
org.xml.sax.Parser

setProperty

public void setProperty(String propertyId,
                        Object value)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
Set the value of any property in a SAX2 parser. The parser might not recognize the property, and if it does recognize it, it might not support the requested value.
Parameters:
propertyId - The unique identifier (URI) of the property being set.
value - The value to which the property is being set.

startCDATA

public void startCDATA(org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The start of a CDATA section.
Specified by:
startCDATA in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startCDATA in interface AbstractXMLDocumentParser
Parameters:
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

startDocument

public void startDocument(org.apache.xerces.xni.XMLLocator locator,
                          String encoding,
                          org.apache.xerces.xni.NamespaceContext namespaceContext,
                          org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The start of the document.
Specified by:
startDocument in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startDocument in interface AbstractXMLDocumentParser
Parameters:
locator - The document locator, or null if the document location cannot be reported during the parsing of this document. However, it is strongly recommended that a locator be supplied that can at least report the system identifier of the document.
encoding - The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader).
namespaceContext - The namespace context in effect at the start of this document. This object represents the current context. Implementors of this class are responsible for copying the namespace bindings from the the current context (and its parent contexts) if that information is important.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

startElement

public void startElement(org.apache.xerces.xni.QName element,
                         org.apache.xerces.xni.XMLAttributes attributes,
                         org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The start of an element. If the document specifies the start element by using an empty tag, then the startElement method will immediately be followed by the endElement method, with no intervening methods.
Specified by:
startElement in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startElement in interface AbstractXMLDocumentParser
Parameters:
element - The name of the element.
attributes - The element attributes.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

startExternalSubset

public void startExternalSubset(org.apache.xerces.xni.XMLResourceIdentifier identifier,
                                org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
The start of the DTD external subset.
Specified by:
startExternalSubset in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
startExternalSubset in interface AbstractXMLDocumentParser
Parameters:
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

startGeneralEntity

public void startGeneralEntity(String name,
                               org.apache.xerces.xni.XMLResourceIdentifier identifier,
                               String encoding,
                               org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
This method notifies of the start of an entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

Note: Since the document is an entity, the handler will be notified of the start of the document entity by calling the startEntity method with the entity name "[xml]" before calling the startDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

Note: This method is not called for entity references appearing as part of attribute values.

Specified by:
startGeneralEntity in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
startGeneralEntity in interface AbstractXMLDocumentParser
Parameters:
name - The name of the entity.
identifier - The resource identifier.
encoding - The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal parameter entities).
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

startNamespaceMapping

protected final void startNamespaceMapping()
            throws SAXException
Send startPrefixMapping events

startParameterEntity

public void startParameterEntity(String name,
                                 org.apache.xerces.xni.XMLResourceIdentifier identifier,
                                 String encoding,
                                 org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
This method notifies of the start of parameter entity. The DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entity names are just the entity name.

Note: Since the document is an entity, the handler will be notified of the start of the document entity by calling the startEntity method with the entity name "[xml]" before calling the startDocument method. When exposing entity boundaries through the SAX API, the document entity is never reported, however.

Note: This method is not called for entity references appearing as part of attribute values.

Specified by:
startParameterEntity in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
startParameterEntity in interface AbstractXMLDocumentParser
Parameters:
name - The name of the parameter entity.
identifier - The resource identifier.
encoding - The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal parameter entities).
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

unparsedEntityDecl

public void unparsedEntityDecl(String name,
                               org.apache.xerces.xni.XMLResourceIdentifier identifier,
                               String notation,
                               org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
An unparsed entity declaration.
Specified by:
unparsedEntityDecl in interface org.apache.xerces.xni.XMLDTDHandler
Overrides:
unparsedEntityDecl in interface AbstractXMLDocumentParser
Parameters:
name - The name of the entity.
identifier - An object containing all location information pertinent to this entity.
notation - The name of the notation.
augs - Additional information that may include infoset augmentations.
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

xmlDecl

public void xmlDecl(String version,
                    String encoding,
                    String standalone,
                    org.apache.xerces.xni.Augmentations augs)
            throws org.apache.xerces.xni.XNIException
Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.
Specified by:
xmlDecl in interface org.apache.xerces.xni.XMLDocumentHandler
Overrides:
xmlDecl in interface AbstractXMLDocumentParser
Parameters:
version - The XML version.
encoding - The IANA encoding name of the document, or null if not specified.
standalone - The standalone value, or null if not specified.
augs - Additional information that may include infoset augmentations
Throws:
org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.

Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.