Top Description Inners Fields Constructors Methods
org.apache.xerces.jaxp.validation

public final Class XMLSchemaFactory

extends SchemaFactory
Class Inheritance
Imports
java.io.IOException, .InputStream, .Reader, javax.xml.XMLConstants, javax.xml.stream.XMLEventReader, javax.xml.transform.Source, javax.xml.transform.dom.DOMSource, javax.xml.transform.sax.SAXSource, javax.xml.transform.stax.StAXSource, javax.xml.transform.stream.StreamSource, javax.xml.validation.Schema, .SchemaFactory, org.apache.xerces.impl.Constants, org.apache.xerces.impl.xs.XMLSchemaLoader, org.apache.xerces.util.DOMEntityResolverWrapper, .DOMInputSource, .ErrorHandlerWrapper, .SAXInputSource, .SAXMessageFormatter, .SecurityManager, .StAXInputSource, .XMLGrammarPoolImpl, org.apache.xerces.xni.XNIException, org.apache.xerces.xni.grammars.Grammar, .XMLGrammarDescription, .XMLGrammarPool, org.apache.xerces.xni.parser.XMLConfigurationException, .XMLInputSource, org.w3c.dom.Node, org.w3c.dom.ls.LSResourceResolver, org.xml.sax.ErrorHandler, .InputSource, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .SAXParseException

SchemaFactory for XML Schema.
Author
Kohsuke Kawaguchi ([email protected])
Version
$Id: XMLSchemaFactory.java 1400688 2012-10-21 17:59:34Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
XMLSchemaFactory.XMLGrammarPoolImplExtension

Extension of XMLGrammarPoolImpl which exposes the number of grammars stored in the grammar pool.

pack-priv static class
XMLSchemaFactory.XMLGrammarPoolWrapper

A grammar pool which wraps another.

Field Summary

Modifier and TypeField and Description
private final DOMEntityResolverWrapper
fDOMEntityResolverWrapper

The DOMEntityResolverWrapper

private ErrorHandler
fErrorHandler

User-specified ErrorHandler; can be null.

private final ErrorHandlerWrapper
fErrorHandlerWrapper

The ErrorHandlerWrapper

private LSResourceResolver
fLSResourceResolver

The LSResrouceResolver

private SecurityManager
fSecurityManager

The SecurityManager.

private boolean
fUseGrammarPoolOnly

Whether or not to allow new schemas to be added to the grammar pool

private final XMLSchemaFactory.XMLGrammarPoolWrapper
fXMLGrammarPoolWrapper

The container for the real grammar pool.

private final XMLSchemaLoader
fXMLSchemaLoader

The XMLSchemaLoader

private static final String
JAXP_SOURCE_FEATURE_PREFIX

JAXP Source feature prefix.

private static final String
SCHEMA_FULL_CHECKING

Feature identifier: schema full checking.

private static final String
SECURITY_MANAGER

Property identifier: SecurityManager.

private static final String
USE_GRAMMAR_POOL_ONLY

Feature identifier: use grammar pool only.

private static final String
XMLGRAMMAR_POOL

Property identifier: grammar pool.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ErrorHandler
public boolean
getFeature(String
The feature name, which is a non-null fully-qualified URI.
name
)

Overrides javax.xml.validation.SchemaFactory.getFeature.

Look up the value of a feature flag.
public Object
getProperty(String
The property name, which is a non-null fully-qualified URI.
name
)

Overrides javax.xml.validation.SchemaFactory.getProperty.

Look up the value of a property.
public LSResourceResolver
public boolean

Returns:

true if SchemaFactory supports schemaLanguage, else false.
isSchemaLanguageSupported
(String
Specifies the schema language which the returned SchemaFactory will understand. schemaLanguage must specify a valid schema language.
schemaLanguage
)

Implements abstract javax.xml.validation.SchemaFactory.isSchemaLanguageSupported.

Is specified schema supported by this SchemaFactory?

public Schema
newSchema(Source[]
inputs to be parsed. SchemaFactory is required to recognize javax.xml.transform.sax.SAXSource, StreamSource, javax.xml.transform.stax.StAXSource, and javax.xml.transform.dom.DOMSource. Input schemas must be XML documents or XML elements and must not be null. For backwards compatibility, the results of passing anything other than a document or element are implementation-dependent. Implementations must either recognize and process the input or thrown an IllegalArgumentException.
schemas
)

Implements abstract javax.xml.validation.SchemaFactory.newSchema.

Parses the specified source(s) as a schema and returns it as a schema.
public Schema
newSchema()

Implements abstract javax.xml.validation.SchemaFactory.newSchema.

Creates a special Schema object.
public Schema
private void
public void
setErrorHandler(ErrorHandler
A new error handler to be set. This parameter can be null.
errorHandler
)

Implements abstract javax.xml.validation.SchemaFactory.setErrorHandler.

Sets the ErrorHandler to receive errors encountered during the newSchema method invocation.
public void
setFeature(String
The feature name, which is a non-null fully-qualified URI.
name
,
boolean
The requested value of the feature (true or false).
value
)

Overrides javax.xml.validation.SchemaFactory.setFeature.

Set a feature for this SchemaFactory, Schemas created by this factory, and by extension, Validators and ValidatorHandlers created by those Schemas.
public void
setProperty(String
The property name, which is a non-null fully-qualified URI.
name
,
Object
The requested value for the property.
object
)

Overrides javax.xml.validation.SchemaFactory.setProperty.

Set the value of a property.
public void
setResourceResolver(LSResourceResolver
A new resource resolver to be set. This parameter can be null.
resourceResolver
)

Implements abstract javax.xml.validation.SchemaFactory.setResourceResolver.

Sets the LSResourceResolver to customize resource resolution when parsing schemas.
Inherited from javax.xml.validation.SchemaFactory:
newDefaultInstancenewInstancenewInstancenewSchemanewSchemanewSchema

Field Detail

fDOMEntityResolverWrapperback to summary
private final DOMEntityResolverWrapper fDOMEntityResolverWrapper

The DOMEntityResolverWrapper

fErrorHandlerback to summary
private ErrorHandler fErrorHandler

User-specified ErrorHandler; can be null.

fErrorHandlerWrapperback to summary
private final ErrorHandlerWrapper fErrorHandlerWrapper

The ErrorHandlerWrapper

fLSResourceResolverback to summary
private LSResourceResolver fLSResourceResolver

The LSResrouceResolver

fSecurityManagerback to summary
private SecurityManager fSecurityManager

The SecurityManager.

fUseGrammarPoolOnlyback to summary
private boolean fUseGrammarPoolOnly

Whether or not to allow new schemas to be added to the grammar pool

fXMLGrammarPoolWrapperback to summary
private final XMLSchemaFactory.XMLGrammarPoolWrapper fXMLGrammarPoolWrapper

The container for the real grammar pool.

fXMLSchemaLoaderback to summary
private final XMLSchemaLoader fXMLSchemaLoader

The XMLSchemaLoader

JAXP_SOURCE_FEATURE_PREFIXback to summary
private static final String JAXP_SOURCE_FEATURE_PREFIX

JAXP Source feature prefix.

SCHEMA_FULL_CHECKINGback to summary
private static final String SCHEMA_FULL_CHECKING

Feature identifier: schema full checking.

SECURITY_MANAGERback to summary
private static final String SECURITY_MANAGER

Property identifier: SecurityManager.

USE_GRAMMAR_POOL_ONLYback to summary
private static final String USE_GRAMMAR_POOL_ONLY

Feature identifier: use grammar pool only.

XMLGRAMMAR_POOLback to summary
private static final String XMLGRAMMAR_POOL

Property identifier: grammar pool.

Constructor Detail

XMLSchemaFactoryback to summary
public XMLSchemaFactory()

Method Detail

getErrorHandlerback to summary
public ErrorHandler getErrorHandler()

Implements abstract javax.xml.validation.SchemaFactory.getErrorHandler.

Doc from javax.xml.validation.SchemaFactory.getErrorHandler.

Gets the current ErrorHandler set to this SchemaFactory.

Returns:ErrorHandler

This method returns the object that was last set through the setErrorHandler(ErrorHandler) method, or null if that method has never been called since this SchemaFactory has created.

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

Overrides javax.xml.validation.SchemaFactory.getFeature.

Doc from javax.xml.validation.SchemaFactory.getFeature.

Look up the value of a feature flag.

The feature name is any fully-qualified URI. It is possible for a SchemaFactory to recognize a feature name but temporarily be unable to return its value.

Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.

Parameters
name:String

The feature name, which is a non-null fully-qualified URI.

Returns:boolean

The current value of the feature (true or false).

Exceptions
SAXNotRecognizedException:
If the feature value can't be assigned or retrieved.
SAXNotSupportedException:
When the SchemaFactory recognizes the feature name but cannot determine its value at this time.
getPropertyback to summary
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides javax.xml.validation.SchemaFactory.getProperty.

Doc from javax.xml.validation.SchemaFactory.getProperty.

Look up the value of a property.

The property name is any fully-qualified URI. It is possible for a SchemaFactory to recognize a property name but temporarily be unable to return its value.

SchemaFactorys are not required to recognize any specific property names.

Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.

Parameters
name:String

The property name, which is a non-null fully-qualified URI.

Returns:Object

The current value of the property.

Exceptions
SAXNotRecognizedException:
If the property value can't be assigned or retrieved.
SAXNotSupportedException:
When the XMLReader recognizes the property name but cannot determine its value at this time.
getResourceResolverback to summary
public LSResourceResolver getResourceResolver()

Implements abstract javax.xml.validation.SchemaFactory.getResourceResolver.

Doc from javax.xml.validation.SchemaFactory.getResourceResolver.

Gets the current LSResourceResolver set to this SchemaFactory.

Returns:LSResourceResolver

This method returns the object that was last set through the setResourceResolver(LSResourceResolver) method, or null if that method has never been called since this SchemaFactory has created.

isSchemaLanguageSupportedback to summary
public boolean isSchemaLanguageSupported(String schemaLanguage)

Implements abstract javax.xml.validation.SchemaFactory.isSchemaLanguageSupported.

Is specified schema supported by this SchemaFactory?

Parameters
schemaLanguage:String

Specifies the schema language which the returned SchemaFactory will understand. schemaLanguage must specify a valid schema language.

Returns:boolean

true if SchemaFactory supports schemaLanguage, else false.

Exceptions
NullPointerException:
If schemaLanguage is null.
IllegalArgumentException:
If schemaLanguage.length() == 0 or schemaLanguage does not specify a valid schema language.
newSchemaback to summary
public Schema newSchema(Source[] schemas) throws SAXException

Implements abstract javax.xml.validation.SchemaFactory.newSchema.

Doc from javax.xml.validation.SchemaFactory.newSchema.

Parses the specified source(s) as a schema and returns it as a schema.

The callee will read all the Sources and combine them into a single schema. The exact semantics of the combination depends on the schema language that this SchemaFactory object is created for.

When an ErrorHandler is set, the callee will report all the errors found in sources to the handler. If the handler throws an exception, it will abort the schema compilation and the same exception will be thrown from this method. Also, after an error is reported to a handler, the callee is allowed to abort the further processing by throwing it. If an error handler is not set, the callee will throw the first error it finds in the sources.

W3C XML Schema 1.0

The resulting schema contains components from the specified sources. The same result would be achieved if all these sources were imported, using appropriate values for schemaLocation and namespace, into a single schema document with a different targetNamespace and no components of its own, if the import elements were given in the same order as the sources. Section 4.2.3 of the XML Schema recommendation describes the options processors have in this regard. While a processor should be consistent in its treatment of JAXP schema sources and XML Schema imports, the behaviour between JAXP-compliant parsers may vary; in particular, parsers may choose to ignore all but the first <import> for a given namespace, regardless of information provided in schemaLocation.

If the parsed set of schemas includes error(s) as specified in the section 5.1 of the XML Schema spec, then the error must be reported to the ErrorHandler.

RELAX NG

For RELAX NG, this method must throw UnsupportedOperationException if schemas.length!=1.

Parameters
schemas:Source[]

inputs to be parsed. SchemaFactory is required to recognize javax.xml.transform.sax.SAXSource, StreamSource, javax.xml.transform.stax.StAXSource, and javax.xml.transform.dom.DOMSource. Input schemas must be XML documents or XML elements and must not be null. For backwards compatibility, the results of passing anything other than a document or element are implementation-dependent. Implementations must either recognize and process the input or thrown an IllegalArgumentException.

Returns:Schema

Always return a non-null valid Schema object. Note that when an error has been reported, there is no guarantee that the returned Schema object is meaningful.

Exceptions
SAXException:
If an error is found during processing the specified inputs. When an ErrorHandler is set, errors are reported to there first. See setErrorHandler(ErrorHandler).
newSchemaback to summary
public Schema newSchema() throws SAXException

Implements abstract javax.xml.validation.SchemaFactory.newSchema.

Doc from javax.xml.validation.SchemaFactory.newSchema.

Creates a special Schema object.

The exact semantics of the returned Schema object depend on the schema language for which this SchemaFactory is created.

Also, implementations are allowed to use implementation-specific property/feature to alter the semantics of this method.

Implementors and developers should pay particular attention to how the features set on this SchemaFactory are processed by this special Schema. In some cases, for example, when the SchemaFactory and the class actually loading the schema come from different implementations, it may not be possible for SchemaFactory features to be inherited automatically. Developers should make sure that features, such as secure processing, are explicitly set in both places.

W3C XML Schema 1.0

For XML Schema, this method creates a Schema object that performs validation by using location hints specified in documents.

The returned Schema object assumes that if documents refer to the same URL in the schema location hints, they will always resolve to the same schema document. This asusmption allows implementations to reuse parsed results of schema documents so that multiple validations against the same schema will run faster.

Note that the use of schema location hints introduces a vulnerability to denial-of-service attacks.

RELAX NG

RELAX NG does not support this operation.

Returns:Schema

Always return non-null valid Schema object.

Exceptions
SAXException:
If this operation is supported but failed for some reason.
newSchemaback to summary
public Schema newSchema(XMLGrammarPool pool) throws SAXException
propagateFeaturesback to summary
private void propagateFeatures(AbstractXMLSchema schema)
setErrorHandlerback to summary
public void setErrorHandler(ErrorHandler errorHandler)

Implements abstract javax.xml.validation.SchemaFactory.setErrorHandler.

Doc from javax.xml.validation.SchemaFactory.setErrorHandler.

Sets the ErrorHandler to receive errors encountered during the newSchema method invocation.

Error handler can be used to customize the error handling process during schema parsing. When an ErrorHandler is set, errors found during the parsing of schemas will be first sent to the ErrorHandler.

The error handler can abort the parsing of a schema immediately by throwing SAXException from the handler. Or for example it can print an error to the screen and try to continue the processing by returning normally from the ErrorHandler

If any Throwable (or instances of its derived classes) is thrown from an ErrorHandler, the caller of the newSchema method will be thrown the same Throwable object.

SchemaFactory is not allowed to throw SAXException without first reporting it to ErrorHandler.

Applications can call this method even during a Schema is being parsed.

When the ErrorHandler is null, the implementation will behave as if the following ErrorHandler is set:

class DraconianErrorHandler implements ErrorHandler {
    public void fatalError( org.xml.sax.SAXParseException e ) throws SAXException {
        throw e;
    }
    public void error( org.xml.sax.SAXParseException e ) throws SAXException {
        throw e;
    }
    public void warning( org.xml.sax.SAXParseException e ) throws SAXException {
        // noop
    }
}

When a new SchemaFactory object is created, initially this field is set to null. This field will NOT be inherited to Schemas, Validators, or ValidatorHandlers that are created from this SchemaFactory.

Parameters
errorHandler:ErrorHandler

A new error handler to be set. This parameter can be null.

setFeatureback to summary
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides javax.xml.validation.SchemaFactory.setFeature.

Doc from javax.xml.validation.SchemaFactory.setFeature.

Set a feature for this SchemaFactory, Schemas created by this factory, and by extension, Validators and ValidatorHandlers created by those Schemas.

Implementors and developers should pay particular attention to how the special Schema object returned by newSchema() is processed. In some cases, for example, when the SchemaFactory and the class actually loading the schema come from different implementations, it may not be possible for SchemaFactory features to be inherited automatically. Developers should make sure that features, such as secure processing, are explicitly set in both places.

The feature name is any fully-qualified URI. It is possible for a SchemaFactory to expose a feature value but to be unable to change the current value.

All implementations are required to support the javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING feature. When the feature is:

  • true: the implementation will limit XML processing to conform to implementation limits. Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources. If XML processing is limited for security reasons, it will be reported via a call to the registered ErrorHandler#fatalError(SAXParseException exception). See setErrorHandler(ErrorHandler errorHandler).
  • false: the implementation will processing XML according to the XML specifications without regard to possible implementation limits.
Parameters
name:String

The feature name, which is a non-null fully-qualified URI.

value:boolean

The requested value of the feature (true or false).

Exceptions
SAXNotRecognizedException:
If the feature value can't be assigned or retrieved.
SAXNotSupportedException:
When the SchemaFactory recognizes the feature name but cannot set the requested value.
setPropertyback to summary
public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException

Overrides javax.xml.validation.SchemaFactory.setProperty.

Doc from javax.xml.validation.SchemaFactory.setProperty.

Set the value of a property.

The property name is any fully-qualified URI. It is possible for a SchemaFactory to recognize a property name but to be unable to change the current value.

All implementations that implement JAXP 1.5 or newer are required to support the javax.xml.XMLConstants#ACCESS_EXTERNAL_DTD and javax.xml.XMLConstants#ACCESS_EXTERNAL_SCHEMA properties.

Parameters
name:String

The property name, which is a non-null fully-qualified URI.

object:Object

The requested value for the property.

Exceptions
SAXNotRecognizedException:
If the property value can't be assigned or retrieved.
SAXNotSupportedException:
When the SchemaFactory recognizes the property name but cannot set the requested value.
setResourceResolverback to summary
public void setResourceResolver(LSResourceResolver resourceResolver)

Implements abstract javax.xml.validation.SchemaFactory.setResourceResolver.

Doc from javax.xml.validation.SchemaFactory.setResourceResolver.

Sets the LSResourceResolver to customize resource resolution when parsing schemas.

SchemaFactory uses a LSResourceResolver when it needs to locate external resources while parsing schemas, although exactly what constitutes "locating external resources" is up to each schema language. For example, for W3C XML Schema, this includes files <include>d or <import>ed, and DTD referenced from schema files, etc.

Applications can call this method even during a Schema is being parsed.

When the LSResourceResolver is null, the implementation will behave as if the following LSResourceResolver is set:

class DumbDOMResourceResolver implements LSResourceResolver {
    public org.w3c.dom.ls.LSInput resolveResource(
        String publicId, String systemId, String baseURI) {

        return null; // always return null
    }
}

If a LSResourceResolver throws a RuntimeException (or instances of its derived classes), then the SchemaFactory will abort the parsing and the caller of the newSchema method will receive the same RuntimeException.

When a new SchemaFactory object is created, initially this field is set to null. This field will NOT be inherited to Schemas, Validators, or ValidatorHandlers that are created from this SchemaFactory.

Parameters
resourceResolver:LSResourceResolver

A new resource resolver to be set. This parameter can be null.

org.apache.xerces.jaxp.validation back to summary

pack-priv Class XMLSchemaFactory.XMLGrammarPoolImplExtension

extends XMLGrammarPoolImpl
Class Inheritance

Extension of XMLGrammarPoolImpl which exposes the number of grammars stored in the grammar pool.

Field Summary

Inherited from org.apache.xerces.util.XMLGrammarPoolImpl:
fGrammarCountfGrammarsfPoolIsLockedTABLE_SIZE

Constructor Summary

AccessConstructor and Description
public
XMLGrammarPoolImplExtension()

Constructs a grammar pool with a default number of buckets.

public
XMLGrammarPoolImplExtension(int initialCapacity)

Constructs a grammar pool with a specified number of buckets.

Method Summary

Modifier and TypeMethod and Description
pack-priv int
getGrammarCount()

Returns the number of grammars contained in this pool.

Inherited from org.apache.xerces.util.XMLGrammarPoolImpl:
cacheGrammarsclearcontainsGrammarequalsgetGrammarhashCodelockPoolputGrammarremoveGrammarretrieveGrammarretrieveInitialGrammarSetunlockPool

Constructor Detail

XMLGrammarPoolImplExtensionback to summary
public XMLGrammarPoolImplExtension()

Constructs a grammar pool with a default number of buckets.

XMLGrammarPoolImplExtensionback to summary
public XMLGrammarPoolImplExtension(int initialCapacity)

Constructs a grammar pool with a specified number of buckets.

Method Detail

getGrammarCountback to summary
pack-priv int getGrammarCount()

Returns the number of grammars contained in this pool.

org.apache.xerces.jaxp.validation back to summary

pack-priv Class XMLSchemaFactory.XMLGrammarPoolWrapper

extends Object
implements XMLGrammarPool
Class Inheritance
  • java.lang.Object
  • org.apache.xerces.jaxp.validation.XMLSchemaFactory.XMLGrammarPoolWrapper
All Implemented Interfaces
org.apache.xerces.xni.grammars.XMLGrammarPool

A grammar pool which wraps another.

Field Summary

Modifier and TypeField and Description
private XMLGrammarPool

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cacheGrammars(String
the type of the grammars being returned;
grammarType
,
Grammar[]
an array containing the set of grammars being returned; order is not significant.
grammars
)

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.cacheGrammars.

return the final set of grammars that the validator ended up with.

public void
clear()

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.clear.

Removes all grammars from the pool.
pack-priv XMLGrammarPool
public void
lockPool()

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.lockPool.

Causes the XMLGrammarPool not to store any grammars when the cacheGrammars(String, Grammar[[]) method is called.
public Grammar
retrieveGrammar(XMLGrammarDescription
The description of the Grammar being requested.
desc
)

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.retrieveGrammar.

This method requests that the application retrieve a grammar corresponding to the given GrammarIdentifier from its cache.

public Grammar[]
retrieveInitialGrammarSet(String
the type of the grammar, from the org.apache.xerces.xni.grammars.Grammar interface.
grammarType
)

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.retrieveInitialGrammarSet.

retrieve the initial known set of grammars.

pack-priv void
public void
unlockPool()

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.unlockPool.

Allows the XMLGrammarPool to store grammars when its cacheGrammars(String, Grammar[]) method is called.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fGrammarPoolback to summary
private XMLGrammarPool fGrammarPool

Constructor Detail

XMLGrammarPoolWrapperback to summary
pack-priv XMLGrammarPoolWrapper()

Method Detail

cacheGrammarsback to summary
public void cacheGrammars(String grammarType, Grammar[] grammars)

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.cacheGrammars.

Doc from org.apache.xerces.xni.grammars.XMLGrammarPool.cacheGrammars.

return the final set of grammars that the validator ended up with. This method is called after the validation finishes. The application may then choose to cache some of the returned grammars.

Parameters
grammarType:String

the type of the grammars being returned;

grammars:Grammar[]

an array containing the set of grammars being returned; order is not significant.

clearback to summary
public void clear()

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.clear.

Doc from org.apache.xerces.xni.grammars.XMLGrammarPool.clear.

Removes all grammars from the pool.

getGrammarPoolback to summary
pack-priv XMLGrammarPool getGrammarPool()
lockPoolback to summary
public void lockPool()

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.lockPool.

Doc from org.apache.xerces.xni.grammars.XMLGrammarPool.lockPool.

Causes the XMLGrammarPool not to store any grammars when the cacheGrammars(String, Grammar[[]) method is called.

retrieveGrammarback to summary
public Grammar retrieveGrammar(XMLGrammarDescription desc)

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.retrieveGrammar.

Doc from org.apache.xerces.xni.grammars.XMLGrammarPool.retrieveGrammar.

This method requests that the application retrieve a grammar corresponding to the given GrammarIdentifier from its cache. If it cannot do so it must return null; the parser will then call the EntityResolver. An application must not call its EntityResolver itself from this method; this may result in infinite recursions.

Parameters
desc:XMLGrammarDescription

The description of the Grammar being requested.

Returns:Grammar

the Grammar corresponding to this description or null if no such Grammar is known.

retrieveInitialGrammarSetback to summary
public Grammar[] retrieveInitialGrammarSet(String grammarType)

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.retrieveInitialGrammarSet.

Doc from org.apache.xerces.xni.grammars.XMLGrammarPool.retrieveInitialGrammarSet.

retrieve the initial known set of grammars. this method is called by a validator before the validation starts. the application can provide an initial set of grammars available to the current validation attempt.

Parameters
grammarType:String

the type of the grammar, from the org.apache.xerces.xni.grammars.Grammar interface.

Returns:Grammar[]

the set of grammars the validator may put in its "bucket"

setGrammarPoolback to summary
pack-priv void setGrammarPool(XMLGrammarPool grammarPool)
unlockPoolback to summary
public void unlockPool()

Implements org.apache.xerces.xni.grammars.XMLGrammarPool.unlockPool.

Doc from org.apache.xerces.xni.grammars.XMLGrammarPool.unlockPool.

Allows the XMLGrammarPool to store grammars when its cacheGrammars(String, Grammar[]) method is called. This is the default state of the object.