APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.jaxp

public Class SAXParserImpl

extends SAXParser
implements JAXPConstants, PSVIProvider
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xs.PSVIProvider, com.sun.org.apache.xerces.internal.jaxp.JAXPConstants
Annotations
@SuppressWarnings:deprecation
Imports
com.sun.org.apache.xerces.internal.impl.Constants, com.sun.org.apache.xerces.internal.impl.validation.ValidationManager, com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator, com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer, com.sun.org.apache.xerces.internal.util.SAXMessageFormatter, .Status, com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler, com.sun.org.apache.xerces.internal.xni.parser.XMLComponent, .XMLComponentManager, .XMLConfigurationException, .XMLDocumentSource, .XMLParserConfiguration, com.sun.org.apache.xerces.internal.xs.AttributePSVI, .ElementPSVI, .PSVIProvider, java.io.IOException, java.util.HashMap, .Locale, .Map, javax.xml.XMLConstants, javax.xml.validation.Schema, jdk.xml.internal.FeaturePropertyBase, .JdkConstants, .JdkXmlConfig, .JdkXmlUtils, .XMLSecurityManager, .XMLSecurityPropertyManager, org.xml.sax.EntityResolver, .ErrorHandler, .HandlerBase, .InputSource, .Parser, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .XMLReader, org.xml.sax.helpers.DefaultHandler

This is the implementation specific class for the javax.xml.parsers.SAXParser.
Authors
Rajiv Mordani, Edwin Goei

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SAXParserImpl.JAXPSAXParser

References Deprecated SAXParser is deprecated or references (maybe indirectly) at least one deprecated element.
Extension of SAXParser.

Field Summary

Modifier and TypeField and Description
private final EntityResolver
fInitEntityResolver

Initial EntityResolver

private final ErrorHandler
fInitErrorHandler

Initial ErrorHandler

private final ValidationManager
private final XMLComponent
private final XMLComponentManager
private final XMLSecurityManager
private final XMLSecurityPropertyManager
private final UnparsedEntityHandler
private final Schema
private static final String
NAMESPACE_PREFIXES_FEATURE

Feature identifier: namespace prefixes.

private static final String
NAMESPACES_FEATURE

Feature identifier: namespaces.

private String
private static final String
SECURITY_MANAGER

Property identifier: security manager.

private static final String
VALIDATION_FEATURE

Feature identifier: validation.

private static final String
XINCLUDE_FEATURE

Feature identifier: XInclude processing

private static final String
XML_SECURITY_PROPERTY_MANAGER

Property identifier: Security property manager.

private final SAXParserImpl.JAXPSAXParser
xmlReader

References Deprecated SAXParserImpl.JAXPSAXParser is deprecated or references (maybe indirectly) at least one deprecated element.
private static final String
XMLSCHEMA_VALIDATION_FEATURE

Feature identifier: XML Schema validation

Constructor Summary

AccessConstructor and Description
pack-priv
SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean>
Map of SAX features, may be null
features
)

Create a SAX parser with the associated features

pack-priv
SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean>
Map of SAX features, may be null
features
,
boolean secureProcessing)

Create a SAX parser with the associated features

Method Summary

Modifier and TypeMethod and Description
public AttributePSVI
getAttributePSVI(int index)

Implements com.sun.org.apache.xerces.internal.xs.PSVIProvider.getAttributePSVI.

Provides AttributePSVI given the index of an attribute information item in the current element's attribute list.

public AttributePSVI
getAttributePSVIByName(String uri, String localname)

Implements com.sun.org.apache.xerces.internal.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 ElementPSVI
getElementPSVI()

Implements com.sun.org.apache.xerces.internal.xs.PSVIProvider.getElementPSVI.

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

public Parser
getParser()

Implements abstract javax.xml.parsers.SAXParser.getParser.

References Deprecated Parser is deprecated or references (maybe indirectly) at least one deprecated element.

Returns the SAX parser that is encapsulated by the implementation of this class.

public Object
getProperty(String name)

Implements abstract javax.xml.parsers.SAXParser.getProperty.

returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.

public Schema
getSchema()

Overrides javax.xml.parsers.SAXParser.getSchema.

Get a reference to the Schema being used by the XML processor.

public XMLReader
getXMLReader()

Implements abstract javax.xml.parsers.SAXParser.getXMLReader.

Returns the XMLReader that is encapsulated by the implementation of this class.

public boolean
isNamespaceAware()

Implements abstract javax.xml.parsers.SAXParser.isNamespaceAware.

Indicates whether or not this parser is configured to understand namespaces.

public boolean
isValidating()

Implements abstract javax.xml.parsers.SAXParser.isValidating.

Indicates whether or not this parser is configured to validate XML documents.

public boolean

Returns:

the state of XInclude processing mode
isXIncludeAware
()

Overrides javax.xml.parsers.SAXParser.isXIncludeAware.

Gets the XInclude processing mode for this parser

public void
public void
parse(InputSource is, HandlerBase hb)

Overrides javax.xml.parsers.SAXParser.parse.

References Deprecated HandlerBase is deprecated or references (maybe indirectly) at least one deprecated element.

Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.HandlerBase.

public void
reset()

Overrides javax.xml.parsers.SAXParser.reset.

Reset this SAXParser to its original configuration.

private void
setFeatures(Map<String, Boolean> features)

Set any features of our XMLReader based on any features set on the SAXParserFactory.

public void
setProperty(String name, Object value)

Implements abstract javax.xml.parsers.SAXParser.setProperty.

Sets the particular property in the underlying implementation of org.xml.sax.XMLReader.

Inherited from javax.xml.parsers.SAXParser:
parseparseparseparseparseparseparseparse

Field Detail

fInitEntityResolverback to summary
private final EntityResolver fInitEntityResolver

Initial EntityResolver

fInitErrorHandlerback to summary
private final ErrorHandler fInitErrorHandler

Initial ErrorHandler

fSchemaValidationManagerback to summary
private final ValidationManager fSchemaValidationManager
fSchemaValidatorback to summary
private final XMLComponent fSchemaValidator
fSchemaValidatorComponentManagerback to summary
private final XMLComponentManager fSchemaValidatorComponentManager
fSecurityManagerback to summary
private final XMLSecurityManager fSecurityManager
fSecurityPropertyMgrback to summary
private final XMLSecurityPropertyManager fSecurityPropertyMgr
fUnparsedEntityHandlerback to summary
private final UnparsedEntityHandler fUnparsedEntityHandler
grammarback to summary
private final Schema grammar
NAMESPACE_PREFIXES_FEATUREback to summary
private static final String NAMESPACE_PREFIXES_FEATURE

Feature identifier: namespace prefixes.

NAMESPACES_FEATUREback to summary
private static final String NAMESPACES_FEATURE

Feature identifier: namespaces.

schemaLanguageback to summary
private String schemaLanguage
SECURITY_MANAGERback to summary
private static final String SECURITY_MANAGER

Property identifier: security manager.

VALIDATION_FEATUREback to summary
private static final String VALIDATION_FEATURE

Feature identifier: validation.

XINCLUDE_FEATUREback to summary
private static final String XINCLUDE_FEATURE

Feature identifier: XInclude processing

XML_SECURITY_PROPERTY_MANAGERback to summary
private static final String XML_SECURITY_PROPERTY_MANAGER

Property identifier: Security property manager.

xmlReaderback to summary
private final SAXParserImpl.JAXPSAXParser xmlReader

References Deprecated

SAXParserImpl.JAXPSAXParser is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

XMLSCHEMA_VALIDATION_FEATUREback to summary
private static final String XMLSCHEMA_VALIDATION_FEATURE

Feature identifier: XML Schema validation

Constructor Detail

SAXParserImplback to summary
pack-priv SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean> features) throws SAXException

Create a SAX parser with the associated features

Parameters
features:Map<String, Boolean>

Map of SAX features, may be null

SAXParserImplback to summary
pack-priv SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean> features, boolean secureProcessing) throws SAXException

Create a SAX parser with the associated features

Parameters
features:Map<String, Boolean>

Map of SAX features, may be null

Method Detail

getAttributePSVIback to summary
public AttributePSVI getAttributePSVI(int index)

Implements com.sun.org.apache.xerces.internal.xs.PSVIProvider.getAttributePSVI.

Doc from com.sun.org.apache.xerces.internal.xs.PSVIProvider.getAttributePSVI.

Provides AttributePSVI given the index of an attribute information item in the current element's attribute list. The method must be called by an application while in the scope of the methods which report the start and end of an element at a point where the attribute list is available. For example, for SAX the method must be called while in the scope of the document handler's startElement call. If the method is called outside of the specified scope, the return value is undefined.

getAttributePSVIByNameback to summary
public AttributePSVI getAttributePSVIByName(String uri, String localname)

Implements com.sun.org.apache.xerces.internal.xs.PSVIProvider.getAttributePSVIByName.

Doc from com.sun.org.apache.xerces.internal.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. The method must be called by an application while in the scope of the methods which report the start and end of an element at a point where the attribute list is available. For example, for SAX the method must be called while in the scope of the document handler's startElement call. If the method is called outside of the specified scope, the return value is undefined.

getElementPSVIback to summary
public ElementPSVI getElementPSVI()

Implements com.sun.org.apache.xerces.internal.xs.PSVIProvider.getElementPSVI.

Doc from com.sun.org.apache.xerces.internal.xs.PSVIProvider.getElementPSVI.

Provides the post schema validation item for the current element information item. The method must be called by an application while in the scope of the methods which report the start and end of an element. For example, for SAX the method must be called within the scope of the document handler's startElement or endElement call. If the method is called outside of the specified scope, the return value is undefined.

getParserback to summary
public Parser getParser() throws SAXException

Implements abstract javax.xml.parsers.SAXParser.getParser.

Doc from javax.xml.parsers.SAXParser.getParser.

References Deprecated

Parser is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns the SAX parser that is encapsulated by the implementation of this class.

Exceptions
SAXException:
If any SAX errors occur during processing.
getPropertyback to summary
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Implements abstract javax.xml.parsers.SAXParser.getProperty.

returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.

Exceptions
SAXNotRecognizedException:

Doc from javax.xml.parsers.SAXParser.getProperty.

When the underlying XMLReader does not recognize the property name.

SAXNotSupportedException:

Doc from javax.xml.parsers.SAXParser.getProperty.

When the underlying XMLReader recognizes the property name but doesn't support the property.

getSchemaback to summary
public Schema getSchema()

Overrides javax.xml.parsers.SAXParser.getSchema.

Doc from javax.xml.parsers.SAXParser.getSchema.

Get a reference to the Schema being used by the XML processor.

If no schema is being used, null is returned.

getXMLReaderback to summary
public XMLReader getXMLReader()

Implements abstract javax.xml.parsers.SAXParser.getXMLReader.

Returns the XMLReader that is encapsulated by the implementation of this class.

isNamespaceAwareback to summary
public boolean isNamespaceAware()

Implements abstract javax.xml.parsers.SAXParser.isNamespaceAware.

Doc from javax.xml.parsers.SAXParser.isNamespaceAware.

Indicates whether or not this parser is configured to understand namespaces.

isValidatingback to summary
public boolean isValidating()

Implements abstract javax.xml.parsers.SAXParser.isValidating.

Doc from javax.xml.parsers.SAXParser.isValidating.

Indicates whether or not this parser is configured to validate XML documents.

isXIncludeAwareback to summary
public boolean isXIncludeAware()

Overrides javax.xml.parsers.SAXParser.isXIncludeAware.

Gets the XInclude processing mode for this parser

Returns:boolean

the state of XInclude processing mode

parseback to summary
public void parse(InputSource is, DefaultHandler dh) throws SAXException, IOException

Overrides javax.xml.parsers.SAXParser.parse.

Doc from javax.xml.parsers.SAXParser.parse.

Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.helpers.DefaultHandler.

Exceptions
SAXException:
If any SAX errors occur during processing.
IOException:
If any IO errors occur.
parseback to summary
public void parse(InputSource is, HandlerBase hb) throws SAXException, IOException

Overrides javax.xml.parsers.SAXParser.parse.

Doc from javax.xml.parsers.SAXParser.parse.

References Deprecated

HandlerBase is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Parse the content given org.xml.sax.InputSource as XML using the specified org.xml.sax.HandlerBase. Use of the DefaultHandler version of this method is recommended as the HandlerBase class has been deprecated in SAX 2.0

Exceptions
SAXException:
If any SAX errors occur during processing.
IOException:
If any IO errors occur.
resetback to summary
public void reset()

Overrides javax.xml.parsers.SAXParser.reset.

Doc from javax.xml.parsers.SAXParser.reset.

Reset this SAXParser to its original configuration.

SAXParser is reset to the same state as when it was created with SAXParserFactory#newSAXParser(). reset() is designed to allow the reuse of existing SAXParsers thus saving resources associated with the creation of new SAXParsers.

The reset SAXParser is not guaranteed to have the same Schema Object, e.g. Object#equals(Object obj). It is guaranteed to have a functionally equal Schema.

setFeaturesback to summary
private void setFeatures(Map<String, Boolean> features) throws SAXNotSupportedException, SAXNotRecognizedException

Set any features of our XMLReader based on any features set on the SAXParserFactory. XXX Does not handle possible conflicts between SAX feature names and JAXP specific feature names, eg. SAXParserFactory.isValidating()

setPropertyback to summary
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException

Implements abstract javax.xml.parsers.SAXParser.setProperty.

Sets the particular property in the underlying implementation of org.xml.sax.XMLReader.

Exceptions
SAXNotRecognizedException:

Doc from javax.xml.parsers.SAXParser.setProperty.

When the underlying XMLReader does not recognize the property name.

SAXNotSupportedException:

Doc from javax.xml.parsers.SAXParser.setProperty.

When the underlying XMLReader recognizes the property name but doesn't support the property.

com.sun.org.apache.xerces.internal.jaxp back to summary

public Class SAXParserImpl.JAXPSAXParser

extends SAXParser
Class Inheritance

References Deprecated

SAXParser is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Extension of SAXParser. This class tracks changes to features and properties to allow the parser to be reset to its initial state.

Field Summary

Modifier and TypeField and Description
private final Map<String, Boolean>
private final Map<String, Object>
private final SAXParserImpl
private XMLSecurityManager
private XMLSecurityPropertyManager
Inherited from com.sun.org.apache.xerces.internal.parsers.SAXParser:
NOTIFY_BUILTIN_REFSREPORT_WHITESPACESYMBOL_TABLEXMLGRAMMAR_POOL

Constructor Summary

AccessConstructor and Description
public
pack-priv
JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager securityPropertyMgr, XMLSecurityManager securityManager)

Method Summary

Modifier and TypeMethod and Description
public synchronized boolean
pack-priv boolean
pack-priv Locale
public synchronized Object
pack-priv Object
pack-priv XMLParserConfiguration
public void
public void
parse(String systemId)

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse.

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

Parses the input source specified by the given system identifier.

private void
pack-priv synchronized void
public synchronized void
setFeature(String name, boolean value)

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setFeature.

Implements org.xml.sax.XMLReader.setFeature.

Override SAXParser's setFeature method to track the initial state of features.

pack-priv void
setFeature0(String name, boolean value)

public synchronized void
setProperty(String name, Object value)

Overrides com.sun.org.apache.xerces.internal.parsers.SAXParser.setProperty.

Implements org.xml.sax.XMLReader.setProperty.

Override SAXParser's setProperty method to track the initial state of properties.

pack-priv void
setProperty0(String name, Object value)

private void
setSchemaValidatorFeature(String name, boolean value)

private void

Field Detail

fInitFeaturesback to summary
private final Map<String, Boolean> fInitFeatures
fInitPropertiesback to summary
private final Map<String, Object> fInitProperties
fSAXParserback to summary
private final SAXParserImpl fSAXParser
fSecurityManagerback to summary
private XMLSecurityManager fSecurityManager
fSecurityPropertyMgrback to summary
private XMLSecurityPropertyManager fSecurityPropertyMgr

Constructor Detail

JAXPSAXParserback to summary
public JAXPSAXParser()
JAXPSAXParserback to summary
pack-priv JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager securityPropertyMgr, XMLSecurityManager securityManager)

Method Detail

getFeatureback to summary
public synchronized boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.getFeature.

Implements org.xml.sax.XMLReader.getFeature.

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.getFeature.

Query the state of a feature. Query the current state of any feature in a SAX2 parser. The parser might not recognize the feature.

Exceptions
SAXNotRecognizedException:
If the requested feature is not known.
SAXNotSupportedException:
If the requested feature is known but not supported.
getFeature0back to summary
pack-priv boolean getFeature0(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getLocaleback to summary
pack-priv Locale getLocale()
getPropertyback to summary
public synchronized Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.getProperty.

Implements org.xml.sax.XMLReader.getProperty.

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.getProperty.

Query the value of a property. Return the current value of a property in a SAX2 parser. The parser might not recognize the property.

Exceptions
SAXNotRecognizedException:
If the requested property is not known.
SAXNotSupportedException:
If the requested property is known but not supported.
getProperty0back to summary
pack-priv Object getProperty0(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getXMLParserConfigurationback to summary
pack-priv XMLParserConfiguration getXMLParserConfiguration()
parseback to summary
public void parse(InputSource inputSource) throws SAXException, IOException

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse.

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

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse.

parse

Exceptions
SAXException:

Doc from org.xml.sax.Parser.parse.

Any SAX exception, possibly wrapping another exception.

IOException:

Doc from org.xml.sax.Parser.parse.

An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

parseback to summary
public void parse(String systemId) throws SAXException, IOException

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse.

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

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse.

Parses the input source specified by the given system identifier.

This method is equivalent to the following:

    parse(new InputSource(systemId));
Exceptions
SAXException:
Throws exception on SAX error.
IOException:
Throws exception on i/o error.
resetSchemaValidatorback to summary
private void resetSchemaValidator() throws SAXException
restoreInitStateback to summary
pack-priv synchronized void restoreInitState() throws SAXNotRecognizedException, SAXNotSupportedException
setFeatureback to summary
public synchronized void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setFeature.

Implements org.xml.sax.XMLReader.setFeature.

Override SAXParser's setFeature method to track the initial state of features. This keeps us from affecting the performance of the SAXParser when it is created with XMLReaderFactory.

Exceptions
SAXNotRecognizedException:

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setFeature.

If the requested feature is not known.

SAXNotSupportedException:

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setFeature.

If the requested feature is known, but the requested state is not supported.

setFeature0back to summary
pack-priv void setFeature0(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setPropertyback to summary
public synchronized void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides com.sun.org.apache.xerces.internal.parsers.SAXParser.setProperty.

Implements org.xml.sax.XMLReader.setProperty.

Override SAXParser's setProperty method to track the initial state of properties. This keeps us from affecting the performance of the SAXParser when it is created with XMLReaderFactory.

Exceptions
SAXNotRecognizedException:

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setProperty.

If the requested property is not known.

SAXNotSupportedException:

Doc from com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setProperty.

If the requested property is known, but the requested value is not supported.

setProperty0back to summary
pack-priv void setProperty0(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setSchemaValidatorFeatureback to summary
private void setSchemaValidatorFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setSchemaValidatorPropertyback to summary
private void setSchemaValidatorProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException