public class

XSDHandler

extends Object
java.lang.Object
   ↳ org.apache.xerces.impl.xs.traversers.XSDHandler

Class Overview

The purpose of this class is to co-ordinate the construction of a grammar object corresponding to a schema. To do this, it must be prepared to parse several schema documents (for instance if the schema document originally referred to contains or information items). If any of the schemas imports a schema, other grammars may be constructed as a side-effect.

Summary

Constants
String ALLOW_JAVA_ENCODINGS Feature identifier: allow java encodings
String CONTINUE_AFTER_FATAL_ERROR Feature identifier: continue after fatal error
boolean DEBUG_NODE_POOL
String DISALLOW_DOCTYPE Feature: disallow doctype
String ENTITY_MANAGER Property identifier: entity manager.
String ENTITY_RESOLVER Property identifier: entity resolver.
String ERROR_HANDLER Property identifier: error handler.
String ERROR_REPORTER Property identifier: error reporter.
String GENERATE_SYNTHETIC_ANNOTATIONS Feature: generate synthetic annotations
String HONOUR_ALL_SCHEMALOCATIONS Feature identifier: honour all schemaLocations
String JAXP_SCHEMA_SOURCE Property identifier: JAXP schema source.
String REDEF_IDENTIFIER
String SECURITY_MANAGER Property identifier: security manager.
String STANDARD_URI_CONFORMANT_FEATURE Feature identifier: allow java encodings
String STRING_INTERNING Feature identifier: string interning.
String SYMBOL_TABLE Property identifier: symbol table.
String VALIDATE_ANNOTATIONS Feature identifier: validate annotations.
String VALIDATION Feature identifier: validation.
String XMLGRAMMAR_POOL Property identifier: grammar pool.
String XMLSCHEMA_VALIDATION feature identifier: XML Schema validation
Fields
protected XSDeclarationPool fDeclPool
protected Hashtable fNotationRegistry
Public Constructors
XSDHandler()
XSDHandler(XSGrammarBucket gBucket)
Public Methods
boolean element2Locator(Element e, SimpleLocator l)
Extract location information from an Element node, store such information in the passed-in SimpleLocator object, then return true.
SimpleLocator element2Locator(Element e)
Extract location information from an Element node, and create a new SimpleLocator object from such information.
SchemaGrammar parseSchema(XMLInputSource is, XSDDescription desc, Hashtable locationPairs)
This method initiates the parse of a schema.
void reset(XMLComponentManager componentManager)
void setDeclPool(XSDeclarationPool declPool)
void setGenerateSyntheticAnnotations(boolean state)
Protected Methods
void buildGlobalNameRegistries()
XSDocumentInfo constructTrees(Element schemaRoot, String locationHint, XSDDescription desc)
SchemaGrammar findGrammar(XSDDescription desc)
First try to find a grammar in the bucket, if failed, consult the grammar pool.
Object getGlobalDecl(XSDocumentInfo currSchema, int declType, QName declToTraverse, Element elmNode)
Hashtable getIDRegistry()
Hashtable getIDRegistry_sub()
void resolveKeyRefs()
void storeKeyRef(Element keyrefToStore, XSDocumentInfo schemaDoc, XSElementDecl currElemDecl)
void traverseSchemas(ArrayList annotationInfo)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

protected static final String ALLOW_JAVA_ENCODINGS

Feature identifier: allow java encodings

Constant Value: "http://apache.org/xml/features/allow-java-encodings"

protected static final String CONTINUE_AFTER_FATAL_ERROR

Feature identifier: continue after fatal error

Constant Value: "http://apache.org/xml/features/continue-after-fatal-error"

protected static final boolean DEBUG_NODE_POOL

Constant Value: false

protected static final String DISALLOW_DOCTYPE

Feature: disallow doctype

Constant Value: "http://apache.org/xml/features/disallow-doctype-decl"

protected static final String ENTITY_MANAGER

Property identifier: entity manager.

Constant Value: "http://apache.org/xml/properties/internal/entity-manager"

public static final String ENTITY_RESOLVER

Property identifier: entity resolver.

Constant Value: "http://apache.org/xml/properties/internal/entity-resolver"

protected static final String ERROR_HANDLER

Property identifier: error handler.

Constant Value: "http://apache.org/xml/properties/internal/error-handler"

public static final String ERROR_REPORTER

Property identifier: error reporter.

Constant Value: "http://apache.org/xml/properties/internal/error-reporter"

protected static final String GENERATE_SYNTHETIC_ANNOTATIONS

Feature: generate synthetic annotations

Constant Value: "http://apache.org/xml/features/generate-synthetic-annotations"

protected static final String HONOUR_ALL_SCHEMALOCATIONS

Feature identifier: honour all schemaLocations

Constant Value: "http://apache.org/xml/features/honour-all-schemaLocations"

protected static final String JAXP_SCHEMA_SOURCE

Property identifier: JAXP schema source.

Constant Value: "http://java.sun.com/xml/jaxp/properties/schemaSource"

public static final String REDEF_IDENTIFIER

Constant Value: "_fn3dktizrknc9pi"

protected static final String SECURITY_MANAGER

Property identifier: security manager.

Constant Value: "http://apache.org/xml/properties/security-manager"

protected static final String STANDARD_URI_CONFORMANT_FEATURE

Feature identifier: allow java encodings

Constant Value: "http://apache.org/xml/features/standard-uri-conformant"

protected static final String STRING_INTERNING

Feature identifier: string interning.

Constant Value: "http://xml.org/sax/features/string-interning"

public static final String SYMBOL_TABLE

Property identifier: symbol table.

Constant Value: "http://apache.org/xml/properties/internal/symbol-table"

protected static final String VALIDATE_ANNOTATIONS

Feature identifier: validate annotations.

Constant Value: "http://apache.org/xml/features/validate-annotations"

protected static final String VALIDATION

Feature identifier: validation.

Constant Value: "http://xml.org/sax/features/validation"

public static final String XMLGRAMMAR_POOL

Property identifier: grammar pool.

Constant Value: "http://apache.org/xml/properties/internal/grammar-pool"

protected static final String XMLSCHEMA_VALIDATION

feature identifier: XML Schema validation

Constant Value: "http://apache.org/xml/features/validation/schema"

Fields

protected XSDeclarationPool fDeclPool

protected Hashtable fNotationRegistry

Public Constructors

public XSDHandler ()

public XSDHandler (XSGrammarBucket gBucket)

Public Methods

public boolean element2Locator (Element e, SimpleLocator l)

Extract location information from an Element node, store such information in the passed-in SimpleLocator object, then return true. Returning false means can't extract or store such information.

public SimpleLocator element2Locator (Element e)

Extract location information from an Element node, and create a new SimpleLocator object from such information. Returning null means no information can be retrieved from the element.

public SchemaGrammar parseSchema (XMLInputSource is, XSDDescription desc, Hashtable locationPairs)

This method initiates the parse of a schema. It will likely be called from the Validator and it will make the resulting grammar available; it returns a reference to this object just in case. A reset(XMLComponentManager) must be called before this methods is called.

Returns
  • the SchemaGrammar
Throws
IOException

public void reset (XMLComponentManager componentManager)

public void setDeclPool (XSDeclarationPool declPool)

public void setGenerateSyntheticAnnotations (boolean state)

Protected Methods

protected void buildGlobalNameRegistries ()

protected XSDocumentInfo constructTrees (Element schemaRoot, String locationHint, XSDDescription desc)

protected SchemaGrammar findGrammar (XSDDescription desc)

First try to find a grammar in the bucket, if failed, consult the grammar pool. If a grammar is found in the pool, then add it (and all imported ones) into the bucket.

protected Object getGlobalDecl (XSDocumentInfo currSchema, int declType, QName declToTraverse, Element elmNode)

protected Hashtable getIDRegistry ()

protected Hashtable getIDRegistry_sub ()

protected void resolveKeyRefs ()

protected void storeKeyRef (Element keyrefToStore, XSDocumentInfo schemaDoc, XSElementDecl currElemDecl)

protected void traverseSchemas (ArrayList annotationInfo)