Top Description Inners Fields Constructors Methods
org.apache.xerces.parsers

public abstract Class AbstractSAXParser

extends AbstractXMLDocumentParser
implements PSVIProvider, Parser, XMLReader
Class Inheritance
All Implemented Interfaces
org.xml.sax.XMLReader, org.xml.sax.Parser, org.apache.xerces.xs.PSVIProvider
Known Direct Subclasses
org.apache.xerces.parsers.SAXParser
Imports
java.io.CharConversionException, .IOException, java.util.Locale, org.apache.xerces.impl.Constants, org.apache.xerces.util.EntityResolver2Wrapper, .EntityResolverWrapper, .ErrorHandlerWrapper, .SAXMessageFormatter, .SymbolHash, .XMLSymbols, org.apache.xerces.xni.Augmentations, .NamespaceContext, .QName, .XMLAttributes, .XMLLocator, .XMLResourceIdentifier, .XMLString, .XNIException, org.apache.xerces.xni.parser.XMLConfigurationException, .XMLEntityResolver, .XMLErrorHandler, .XMLInputSource, .XMLParseException, .XMLParserConfiguration, org.apache.xerces.xs.AttributePSVI, .ElementPSVI, .PSVIProvider, org.xml.sax.AttributeList, .ContentHandler, .DTDHandler, .DocumentHandler, .EntityResolver, .ErrorHandler, .InputSource, .Parser, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .SAXParseException, .XMLReader, org.xml.sax.ext.Attributes2, .DeclHandler, .EntityResolver2, .LexicalHandler, .Locator2, .Locator2Impl

Deprecated

as a consequence of Parser being deprecated. See corresponding docs for further information.

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.
Authors
Arnaud Le Hors, IBM, Andy Clark, IBM
Version
$Id: AbstractSAXParser.java 1135017 2011-06-13 03:31:26Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
AbstractSAXParser.AttributesProxy

Deprecated as a consequence of AttributeList being deprecated.
protected static class

Field Summary

Modifier and TypeField and Description
protected static final String
ALLOW_UE_AND_NOTATION_EVENTS

Feature identifier: allow notation and unparsed entity events to be sent out of order.

protected static final String
DECLARATION_HANDLER

Property id: declaration handler.

protected static final String
DOM_NODE

Property id: DOM node.

private final AbstractSAXParser.AttributesProxy
fAttributesProxy

Deprecated as a consequence of AbstractSAXParser.AttributesProxy being deprecated.
private Augmentations
protected ContentHandler
fContentHandler

Content handler.

protected SymbolHash
protected DeclHandler
fDeclHandler

Decl handler.

protected DocumentHandler
fDocumentHandler

Document handler.

protected DTDHandler
fDTDHandler

DTD handler.

protected LexicalHandler
fLexicalHandler

Lexical handler.

protected boolean
fLexicalHandlerParameterEntities

Lexical handler parameter entities.

protected NamespaceContext
fNamespaceContext

Namespace context

protected boolean
fNamespacePrefixes

Namespace prefixes.

protected boolean
fNamespaces

Namespaces.

protected boolean
fParseInProgress

True if a parse is in progress.

protected final QName
protected boolean
fResolveDTDURIs

Resolve DTD URIs.

protected boolean
fStandalone

Standalone document declaration.

protected boolean
fUseEntityResolver2

Use EntityResolver2.

protected String
protected boolean
fXMLNSURIs

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

protected static final String
LEXICAL_HANDLER

Property id: lexical handler.

protected static final String
NAMESPACES

Feature identifier: namespaces.

private static final String[]
RECOGNIZED_FEATURES

Recognized features.

private static final String[]
protected static final String
STRING_INTERNING

Feature id: string interning.

Inherited from org.apache.xerces.parsers.AbstractXMLDocumentParser:
fDocumentSourcefDTDContentModelSourcefDTDSourcefInDTD

Constructor Summary

AccessConstructor and Description
protected
AbstractSAXParser(XMLParserConfiguration config)

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
attributeDecl(String
The name of the element that this attribute is associated with.
elementName
,
String
The name of the attribute.
attributeName
,
String
The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION".
type
,
String[]
If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null.
enumeration
,
String
The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null.
defaultType
,
XMLString
The attribute default value, or null if no default value is specified.
defaultValue
,
XMLString
The attribute default value with no normalization performed, or null if no default value is specified.
nonNormalizedDefaultValue
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.attributeDecl.

Implements org.apache.xerces.xni.XMLDTDHandler.attributeDecl.

An attribute declaration.
public void
characters(XMLString
The content.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.characters.

Implements org.apache.xerces.xni.XMLDocumentHandler.characters.

Character content.
public void
comment(XMLString
The text in the comment.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.comment.

Implements org.apache.xerces.xni.XMLDocumentHandler.comment, org.apache.xerces.xni.XMLDTDHandler.comment.

A comment.
public void
doctypeDecl(String
The name of the root element.
rootElement
,
String
The public identifier if an external DTD or null if the external DTD is specified using SYSTEM.
publicId
,
String
The system identifier if an external DTD, null otherwise.
systemId
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.doctypeDecl.

Implements org.apache.xerces.xni.XMLDocumentHandler.doctypeDecl.

Notifies of the presence of the DOCTYPE line in the document.
public void
elementDecl(String
The name of the element.
name
,
String
The element content model.
contentModel
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.elementDecl.

Implements org.apache.xerces.xni.XMLDTDHandler.elementDecl.

An element declaration.
public void
endCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endCDATA.

Implements org.apache.xerces.xni.XMLDocumentHandler.endCDATA.

The end of a CDATA section.
public void
endDocument(Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endDocument.

Implements org.apache.xerces.xni.XMLDocumentHandler.endDocument.

The end of the document.
public void
endDTD(Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endDTD.

Implements org.apache.xerces.xni.XMLDTDHandler.endDTD.

The end of the DTD.
public void
endElement(QName
The name of the element.
element
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endElement.

Implements org.apache.xerces.xni.XMLDocumentHandler.endElement.

The end of an element.
public void
endExternalSubset(Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endExternalSubset.

Implements org.apache.xerces.xni.XMLDTDHandler.endExternalSubset.

The end of the DTD external subset.
public void
endGeneralEntity(String
The name of the entity.
name
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endGeneralEntity.

Implements org.apache.xerces.xni.XMLDocumentHandler.endGeneralEntity.

This method notifies the end of an entity.
protected final void
endNamespaceMapping()

Send endPrefixMapping events

public void
endParameterEntity(String
The name of the parameter entity.
name
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.endParameterEntity.

Implements org.apache.xerces.xni.XMLDTDHandler.endParameterEntity.

This method notifies the end of an entity.
public void
externalEntityDecl(String
The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this entity.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.externalEntityDecl.

Implements org.apache.xerces.xni.XMLDTDHandler.externalEntityDecl.

An external entity declaration.
public AttributePSVI
getAttributePSVI(int
The attribute index.
index
)

Implements org.apache.xerces.xs.PSVIProvider.getAttributePSVI.

Provides AttributePSVI given the index of an attribute information item in the current element's attribute list.
public AttributePSVI
getAttributePSVIByName(String
The namespace name of an attribute.
uri
,
String
The local name of an attribute.
localname
)

Implements org.apache.xerces.xs.PSVIProvider.getAttributePSVIByName.

Provides AttributePSVI given the namespace name and the local name of an attribute information item in the current element's attribute list.
public ContentHandler

Returns:

The current content handler, or null if none has been registered.
getContentHandler
()

Implements org.xml.sax.XMLReader.getContentHandler.

Return the current content handler.
protected DeclHandler
getDeclHandler()

Returns the DTD declaration event handler.

public DTDHandler

Returns:

The current DTD handler, or null if none has been registered.
getDTDHandler
()

Implements org.xml.sax.XMLReader.getDTDHandler.

Return the current DTD handler.
public ElementPSVI
getElementPSVI()

Implements org.apache.xerces.xs.PSVIProvider.getElementPSVI.

Provides the post schema validation item for the current element information item.
public EntityResolver

Returns:

The current entity resolver, or null if none has been registered.
getEntityResolver
()

Implements org.xml.sax.XMLReader.getEntityResolver.

Return the current entity resolver.
public ErrorHandler

Returns:

The current error handler, or null if none has been registered.
getErrorHandler
()

Implements org.xml.sax.XMLReader.getErrorHandler.

Return the current error handler.
public boolean

Returns:

The current state of the feature.
getFeature
(String
The unique identifier (URI) of the feature being set.
featureId
)

Implements org.xml.sax.XMLReader.getFeature.

Query the state of a feature.
protected LexicalHandler
getLexicalHandler()

Returns the lexical handler.

public Object

Returns:

The current value of the property.
getProperty
(String
The unique identifier (URI) of the property being set.
propertyId
)

Implements org.xml.sax.XMLReader.getProperty.

Query the value of a property.
public void
ignorableWhitespace(XMLString
The ignorable whitespace.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.ignorableWhitespace.

Implements org.apache.xerces.xni.XMLDocumentHandler.ignorableWhitespace.

Ignorable whitespace.
public void
internalEntityDecl(String
The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.
name
,
XMLString
The value of the entity.
text
,
XMLString
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.
nonNormalizedText
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.internalEntityDecl.

Implements org.apache.xerces.xni.XMLDTDHandler.internalEntityDecl.

An internal entity declaration.
public void
notationDecl(String
The name of the notation.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this notation.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.notationDecl.

Implements org.apache.xerces.xni.XMLDTDHandler.notationDecl.

A notation declaration
public void
parse(String
The system identifier (URI).
systemId
)

Implements org.xml.sax.Parser.parse, org.xml.sax.XMLReader.parse.

Parses the input source specified by the given system identifier.
public void
public void
processingInstruction(String
The target.
target
,
XMLString
The data or null if none specified.
data
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.processingInstruction.

Implements org.apache.xerces.xni.XMLDocumentHandler.processingInstruction, org.apache.xerces.xni.XMLDTDHandler.processingInstruction.

A processing instruction.
public void
reset()

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.reset.

Reset all components before parsing.
public void
setContentHandler(ContentHandler
The content handler.
contentHandler
)

Implements org.xml.sax.XMLReader.setContentHandler.

Allow an application to register a content event handler.
protected void
setDeclHandler(DeclHandler
The new handler.
handler
)

Set the DTD declaration event handler.

public void
setDocumentHandler(DocumentHandler
The document handler.
documentHandler
)

Implements org.xml.sax.Parser.setDocumentHandler.

Deprecated as a consequence of DocumentHandler being deprecated.
Allow an application to register a document event handler.
public void
setDTDHandler(DTDHandler
The DTD handler.
dtdHandler
)

Implements org.xml.sax.Parser.setDTDHandler, org.xml.sax.XMLReader.setDTDHandler.

Allow an application to register a DTD event handler.
public void
setEntityResolver(EntityResolver
The new entity resolver. Passing a null value will uninstall the currently installed resolver.
resolver
)

Implements org.xml.sax.Parser.setEntityResolver, org.xml.sax.XMLReader.setEntityResolver.

Sets the resolver used to resolve external entities.
public void
setErrorHandler(ErrorHandler
The error handler.
errorHandler
)

Implements org.xml.sax.Parser.setErrorHandler, org.xml.sax.XMLReader.setErrorHandler.

Allow an application to register an error event handler.
public void
setFeature(String
The unique identifier (URI) of the feature.
featureId
,
boolean
The requested state of the feature (true or false).
state
)

Implements org.xml.sax.XMLReader.setFeature.

Set the state of any feature in a SAX2 parser.
protected void
setLexicalHandler(LexicalHandler
lexical event handler
handler
)

Set the lexical event handler.

public void
setLocale(Locale
The locale object to use for localization of messages.
locale
)

Implements org.xml.sax.Parser.setLocale.

Set the locale to use for messages.
public void
setProperty(String
The unique identifier (URI) of the property being set.
propertyId
,
Object
The value to which the property is being set.
value
)

Implements org.xml.sax.XMLReader.setProperty.

Set the value of any property in a SAX2 parser.
public void
startCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.startCDATA.

Implements org.apache.xerces.xni.XMLDocumentHandler.startCDATA.

The start of a CDATA section.
public void
startDocument(XMLLocator
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.
locator
,
String
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).
encoding
,
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.
namespaceContext
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.startDocument.

Implements org.apache.xerces.xni.XMLDocumentHandler.startDocument.

The start of the document.
public void
startElement(QName
The name of the element.
element
,
XMLAttributes
The element attributes.
attributes
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.startElement.

Implements org.apache.xerces.xni.XMLDocumentHandler.startElement.

The start of an element.
public void
startExternalSubset(XMLResourceIdentifier
The resource identifier.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.startExternalSubset.

Implements org.apache.xerces.xni.XMLDTDHandler.startExternalSubset.

The start of the DTD external subset.
public void
startGeneralEntity(String
The name of the entity.
name
,
XMLResourceIdentifier
The resource identifier.
identifier
,
String
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).
encoding
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.startGeneralEntity.

Implements org.apache.xerces.xni.XMLDocumentHandler.startGeneralEntity.

This method notifies of the start of an entity.
protected final void
startNamespaceMapping()

Send startPrefixMapping events

public void
startParameterEntity(String
The name of the parameter entity.
name
,
XMLResourceIdentifier
The resource identifier.
identifier
,
String
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).
encoding
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.startParameterEntity.

Implements org.apache.xerces.xni.XMLDTDHandler.startParameterEntity.

This method notifies of the start of parameter entity.
public void
unparsedEntityDecl(String
The name of the entity.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this entity.
identifier
,
String
The name of the notation.
notation
,
Augmentations
Additional information that may include infoset augmentations.
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.unparsedEntityDecl.

Implements org.apache.xerces.xni.XMLDTDHandler.unparsedEntityDecl.

An unparsed entity declaration.
public void
xmlDecl(String
The XML version.
version
,
String
The IANA encoding name of the document, or null if not specified.
encoding
,
String
The standalone value, or null if not specified.
standalone
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.parsers.AbstractXMLDocumentParser.xmlDecl.

Implements org.apache.xerces.xni.XMLDocumentHandler.xmlDecl.

Notifies of the presence of an XMLDecl line in the document.
Inherited from org.apache.xerces.parsers.AbstractXMLDocumentParser:
anyelementemptyemptyElementendAttlistendConditionalendContentModelendGroupgetDocumentSourcegetDTDContentModelSourcegetDTDSourceignoredCharactersoccurrencepcdataseparatorsetDocumentSourcesetDTDContentModelSourcesetDTDSourcestartAttliststartConditionalstartContentModelstartDTDstartGrouptextDecl