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

public Class XMLGrammarCachingConfiguration

extends XIncludeAwareParserConfiguration
Class Inheritance
Imports
java.io.IOException, com.sun.org.apache.xerces.internal.impl.Constants, com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar, .XMLDTDLoader, com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar, .XMLSchemaLoader, .XSMessageFormatter, com.sun.org.apache.xerces.internal.util.SymbolTable, .SynchronizedSymbolTable, .XMLGrammarPoolImpl, com.sun.org.apache.xerces.internal.xni.XNIException, com.sun.org.apache.xerces.internal.xni.grammars.Grammar, .XMLGrammarDescription, .XMLGrammarPool, com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager, .XMLConfigurationException, .XMLEntityResolver, .XMLInputSource

This configuration provides a generic way of using Xerces's grammar caching facilities. It extends the XIncludeAwareParserConfiguration and thus may validate documents according to XML schemas or DTD's. It also allows the user to preparse a grammar, and to lock the grammar pool implementation such that no more grammars will be added.

Using the com.sun.org.apache.xerces.internal.xni.parser property, an application may instantiate a Xerces SAX or DOM parser with this configuration. When invoked in this manner, the default behaviour will be elicited; to use this configuration's specific facilities, the user will need to reference it directly.

In addition to the features and properties recognized by the base parser configuration, this class recognizes these additional features and properties:

Author
Neil Graham, IBM

Field Summary

Modifier and TypeField and Description
public static final int
protected XMLDTDLoader
protected XMLSchemaLoader
protected static final XMLGrammarPoolImpl
protected static final SynchronizedSymbolTable
protected static final String
Inherited from com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration:
ALLOW_UE_AND_NOTATION_EVENTSfCurrentNSContextfNonXIncludeNSContextfXIncludeEnabledfXIncludeHandlerfXIncludeNSContextNAMESPACE_CONTEXTXINCLUDE_FEATUREXINCLUDE_FIXUP_BASE_URISXINCLUDE_FIXUP_LANGUAGEXINCLUDE_HANDLER

Constructor Summary

AccessConstructor and Description
public
XMLGrammarCachingConfiguration()

Default constructor.

public
XMLGrammarCachingConfiguration(SymbolTable
The symbol table to use.
symbolTable
)

Constructs a parser configuration using the specified symbol table.

public
XMLGrammarCachingConfiguration(SymbolTable
The symbol table to use.
symbolTable
,
XMLGrammarPool
The grammar pool to use.
grammarPool
)

Constructs a parser configuration using the specified symbol table and grammar pool.

public
XMLGrammarCachingConfiguration(SymbolTable
The symbol table to use.
symbolTable
,
XMLGrammarPool
The grammar pool to use.
grammarPool
,
XMLComponentManager
The parent settings.
parentSettings
)

Constructs a parser configuration using the specified symbol table, grammar pool, and parent settings.

Method Summary

Modifier and TypeMethod and Description
public void
public void
pack-priv DTDGrammar
public Grammar

Returns:

The newly created Grammar.
parseGrammar
(String
The type of the grammar to be constructed
type
,
String
The location of the grammar to be constructed. The parser will not expand this URI or make it available to the EntityResolver
uri
)

Parse a grammar from a location identified by an URI.

public Grammar

Returns:

The newly created Grammar.
parseGrammar
(String
The type of the grammar to be constructed
type
,
XMLInputSource
The XMLInputSource containing this grammar's information If a URI is included in the systemId field, the parser will not expand this URI or make it available to the EntityResolver
is
)

Parse a grammar from a location identified by an XMLInputSource.

pack-priv SchemaGrammar
public void
Inherited from com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration:
configurePipelineconfigureXML11PipelinegetFeatureStatesetFeature

Field Detail

BIG_PRIMEback to summary
public static final int BIG_PRIME
fDTDLoaderback to summary
protected XMLDTDLoader fDTDLoader
fSchemaLoaderback to summary
protected XMLSchemaLoader fSchemaLoader
fStaticGrammarPoolback to summary
protected static final XMLGrammarPoolImpl fStaticGrammarPool
fStaticSymbolTableback to summary
protected static final SynchronizedSymbolTable fStaticSymbolTable
SCHEMA_FULL_CHECKINGback to summary
protected static final String SCHEMA_FULL_CHECKING

Constructor Detail

XMLGrammarCachingConfigurationback to summary
public XMLGrammarCachingConfiguration()

Default constructor.

XMLGrammarCachingConfigurationback to summary
public XMLGrammarCachingConfiguration(SymbolTable symbolTable)

Constructs a parser configuration using the specified symbol table.

Parameters
symbolTable:SymbolTable

The symbol table to use.

XMLGrammarCachingConfigurationback to summary
public XMLGrammarCachingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool)

Constructs a parser configuration using the specified symbol table and grammar pool.

Revisit

Grammar pool will be updated when the new validation engine is implemented.

Parameters
symbolTable:SymbolTable

The symbol table to use.

grammarPool:XMLGrammarPool

The grammar pool to use.

XMLGrammarCachingConfigurationback to summary
public XMLGrammarCachingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings)

Constructs a parser configuration using the specified symbol table, grammar pool, and parent settings.

Revisit

Grammar pool will be updated when the new validation engine is implemented.

Parameters
symbolTable:SymbolTable

The symbol table to use.

grammarPool:XMLGrammarPool

The grammar pool to use.

parentSettings:XMLComponentManager

The parent settings.

Method Detail

clearGrammarPoolback to summary
public void clearGrammarPool()
lockGrammarPoolback to summary
public void lockGrammarPool()
parseDTDback to summary
pack-priv DTDGrammar parseDTD(XMLInputSource is) throws IOException
parseGrammarback to summary
public Grammar parseGrammar(String type, String uri) throws XNIException, IOException

Parse a grammar from a location identified by an URI. This method also adds this grammar to the XMLGrammarPool

Parameters
type:String

The type of the grammar to be constructed

uri:String

The location of the grammar to be constructed. The parser will not expand this URI or make it available to the EntityResolver

Returns:Grammar

The newly created Grammar.

Exceptions
XNIException:
thrown on an error in grammar construction
IOException:
thrown if an error is encountered in reading the file
parseGrammarback to summary
public Grammar parseGrammar(String type, XMLInputSource is) throws XNIException, IOException

Parse a grammar from a location identified by an XMLInputSource. This method also adds this grammar to the XMLGrammarPool

Parameters
type:String

The type of the grammar to be constructed

is:XMLInputSource

The XMLInputSource containing this grammar's information If a URI is included in the systemId field, the parser will not expand this URI or make it available to the EntityResolver

Returns:Grammar

The newly created Grammar.

Exceptions
XNIException:
thrown on an error in grammar construction
IOException:
thrown if an error is encountered in reading the file
parseXMLSchemaback to summary
pack-priv SchemaGrammar parseXMLSchema(XMLInputSource is) throws IOException
unlockGrammarPoolback to summary
public void unlockGrammarPool()