org.apache.xerces.impl.xs.traversers

Class XSDHandler

public class XSDHandler extends Object

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.

Version: $Id: XSDHandler.java,v 1.92 2005/06/24 17:56:41 mrglavas Exp $

Author: Neil Graham, IBM Pavani Mukthipudi, Sun Microsystems

UNKNOWN:

Field Summary
protected static StringALLOW_JAVA_ENCODINGS
Feature identifier: allow java encodings
protected static StringCONTINUE_AFTER_FATAL_ERROR
Feature identifier: continue after fatal error
protected static booleanDEBUG_NODE_POOL
protected static StringDISALLOW_DOCTYPE
Feature: disallow doctype
protected static StringENTITY_MANAGER
Property identifier: entity manager.
static StringENTITY_RESOLVER
Property identifier: entity resolver.
protected static StringERROR_HANDLER
Property identifier: error handler.
static StringERROR_REPORTER
Property identifier: error reporter.
protected XSDeclarationPoolfDeclPool
protected HashtablefNotationRegistry
protected static StringGENERATE_SYNTHETIC_ANNOTATIONS
Feature: generate synthetic annotations
protected static StringHONOUR_ALL_SCHEMALOCATIONS
Feature identifier: honour all schemaLocations
protected static StringJAXP_SCHEMA_SOURCE
Property identifier: JAXP schema source.
static StringREDEF_IDENTIFIER
protected static StringSECURITY_MANAGER
Property identifier: security manager.
protected static StringSTANDARD_URI_CONFORMANT_FEATURE
Feature identifier: allow java encodings
protected static StringSTRING_INTERNING
Feature identifier: string interning.
static StringSYMBOL_TABLE
Property identifier: symbol table.
protected static StringVALIDATE_ANNOTATIONS
Feature identifier: validate annotations.
protected static StringVALIDATION
Feature identifier: validation.
static StringXMLGRAMMAR_POOL
Property identifier: grammar pool.
protected static StringXMLSCHEMA_VALIDATION
feature identifier: XML Schema validation
Constructor Summary
XSDHandler()
XSDHandler(XSGrammarBucket gBucket)
Method Summary
protected voidbuildGlobalNameRegistries()
protected XSDocumentInfoconstructTrees(Element schemaRoot, String locationHint, XSDDescription desc)
SimpleLocatorelement2Locator(Element e)
Extract location information from an Element node, and create a new SimpleLocator object from such information.
booleanelement2Locator(Element e, SimpleLocator l)
Extract location information from an Element node, store such information in the passed-in SimpleLocator object, then return true.
protected SchemaGrammarfindGrammar(XSDDescription desc)
First try to find a grammar in the bucket, if failed, consult the grammar pool.
protected ObjectgetGlobalDecl(XSDocumentInfo currSchema, int declType, QName declToTraverse, Element elmNode)
protected HashtablegetIDRegistry()
protected HashtablegetIDRegistry_sub()
SchemaGrammarparseSchema(XMLInputSource is, XSDDescription desc, Hashtable locationPairs)
This method initiates the parse of a schema.
voidreset(XMLComponentManager componentManager)
protected voidresolveKeyRefs()
voidsetDeclPool(XSDeclarationPool declPool)
voidsetGenerateSyntheticAnnotations(boolean state)
protected voidstoreKeyRef(Element keyrefToStore, XSDocumentInfo schemaDoc, XSElementDecl currElemDecl)
protected voidtraverseSchemas(ArrayList annotationInfo)

Field Detail

ALLOW_JAVA_ENCODINGS

protected static final String ALLOW_JAVA_ENCODINGS
Feature identifier: allow java encodings

CONTINUE_AFTER_FATAL_ERROR

protected static final String CONTINUE_AFTER_FATAL_ERROR
Feature identifier: continue after fatal error

DEBUG_NODE_POOL

protected static final boolean DEBUG_NODE_POOL

DISALLOW_DOCTYPE

protected static final String DISALLOW_DOCTYPE
Feature: disallow doctype

ENTITY_MANAGER

protected static final String ENTITY_MANAGER
Property identifier: entity manager.

ENTITY_RESOLVER

public static final String ENTITY_RESOLVER
Property identifier: entity resolver.

ERROR_HANDLER

protected static final String ERROR_HANDLER
Property identifier: error handler.

ERROR_REPORTER

public static final String ERROR_REPORTER
Property identifier: error reporter.

fDeclPool

protected XSDeclarationPool fDeclPool

fNotationRegistry

protected Hashtable fNotationRegistry

GENERATE_SYNTHETIC_ANNOTATIONS

protected static final String GENERATE_SYNTHETIC_ANNOTATIONS
Feature: generate synthetic annotations

HONOUR_ALL_SCHEMALOCATIONS

protected static final String HONOUR_ALL_SCHEMALOCATIONS
Feature identifier: honour all schemaLocations

JAXP_SCHEMA_SOURCE

protected static final String JAXP_SCHEMA_SOURCE
Property identifier: JAXP schema source.

REDEF_IDENTIFIER

public static final String REDEF_IDENTIFIER

SECURITY_MANAGER

protected static final String SECURITY_MANAGER
Property identifier: security manager.

STANDARD_URI_CONFORMANT_FEATURE

protected static final String STANDARD_URI_CONFORMANT_FEATURE
Feature identifier: allow java encodings

STRING_INTERNING

protected static final String STRING_INTERNING
Feature identifier: string interning.

SYMBOL_TABLE

public static final String SYMBOL_TABLE
Property identifier: symbol table.

VALIDATE_ANNOTATIONS

protected static final String VALIDATE_ANNOTATIONS
Feature identifier: validate annotations.

VALIDATION

protected static final String VALIDATION
Feature identifier: validation.

XMLGRAMMAR_POOL

public static final String XMLGRAMMAR_POOL
Property identifier: grammar pool.

XMLSCHEMA_VALIDATION

protected static final String XMLSCHEMA_VALIDATION
feature identifier: XML Schema validation

Constructor Detail

XSDHandler

public XSDHandler()

XSDHandler

public XSDHandler(XSGrammarBucket gBucket)

Method Detail

buildGlobalNameRegistries

protected void buildGlobalNameRegistries()

constructTrees

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

element2Locator

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.

element2Locator

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.

findGrammar

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.

getGlobalDecl

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

getIDRegistry

protected Hashtable getIDRegistry()

getIDRegistry_sub

protected Hashtable getIDRegistry_sub()

parseSchema

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.

Parameters: is desc locationPairs

Returns:

Throws: IOException

reset

public void reset(XMLComponentManager componentManager)

resolveKeyRefs

protected void resolveKeyRefs()

setDeclPool

public void setDeclPool(XSDeclarationPool declPool)

setGenerateSyntheticAnnotations

public void setGenerateSyntheticAnnotations(boolean state)

Parameters: state

storeKeyRef

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

traverseSchemas

protected void traverseSchemas(ArrayList annotationInfo)
Copyright © 1999-2005 Apache XML Project. All Rights Reserved.