Class XSDHandler
- java.lang.Object
-
- org.apache.xerces.impl.xs.traversers.XSDHandler
-
public class XSDHandler extends java.lang.ObjectThe 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 containsor information items). If any of the schemas imports a schema, other grammars may be constructed as a side-effect. INTERNAL:
- Usage of this class is not supported. It may be altered or removed at any time.
- Version:
- $Id: XSDHandler.java 1868534 2019-10-17 05:36:40Z mukulg $
- Author:
- Neil Graham, IBM, Pavani Mukthipudi, Sun Microsystems
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringALLOW_JAVA_ENCODINGSFeature identifier: allow java encodingsprotected static java.lang.StringCONTINUE_AFTER_FATAL_ERRORFeature identifier: continue after fatal errorprotected static booleanDEBUG_NODE_POOLprotected static java.lang.StringDISALLOW_DOCTYPEFeature: disallow doctypeprotected static java.lang.StringENTITY_MANAGERProperty identifier: entity manager.static java.lang.StringENTITY_RESOLVERProperty identifier: entity resolver.protected static java.lang.StringERROR_HANDLERProperty identifier: error handler.static java.lang.StringERROR_REPORTERProperty identifier: error reporter.protected XSDeclarationPoolfDeclPoolprotected java.util.HashtablefNotationRegistryprotected static java.lang.StringGENERATE_SYNTHETIC_ANNOTATIONSFeature: generate synthetic annotationsprotected static java.lang.StringHONOUR_ALL_SCHEMALOCATIONSFeature identifier: honour all schemaLocationsprotected static java.lang.StringJAXP_SCHEMA_SOURCEProperty identifier: JAXP schema source.protected static java.lang.StringLOCALEProperty identifier: locale.protected static java.lang.StringNAMESPACE_GROWTHFeature identifier: namespace growthstatic java.lang.StringREDEF_IDENTIFIERprotected static java.lang.StringSECURITY_MANAGERProperty identifier: security manager.protected static java.lang.StringSTANDARD_URI_CONFORMANT_FEATUREFeature identifier: allow java encodingsprotected static java.lang.StringSTRING_INTERNINGFeature identifier: string interning.static java.lang.StringSYMBOL_TABLEProperty identifier: symbol table.protected static java.lang.StringTOLERATE_DUPLICATESFeature identifier: tolerate duplicatesprotected static java.lang.StringVALIDATE_ANNOTATIONSFeature identifier: validate annotations.protected static java.lang.StringVALIDATIONFeature identifier: validation.static java.lang.StringXMLGRAMMAR_POOLProperty identifier: grammar pool.protected static java.lang.StringXMLSCHEMA_VALIDATIONfeature identifier: XML Schema validation
-
Constructor Summary
Constructors Constructor Description XSDHandler()XSDHandler(XSGrammarBucket gBucket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildGlobalNameRegistries()protected org.apache.xerces.impl.xs.traversers.XSDocumentInfoconstructTrees(org.w3c.dom.Element schemaRoot, java.lang.String locationHint, XSDDescription desc, boolean nsCollision)SimpleLocatorelement2Locator(org.w3c.dom.Element e)Extract location information from an Element node, and create a new SimpleLocator object from such information.booleanelement2Locator(org.w3c.dom.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, boolean ignoreConflict)First try to find a grammar in the bucket, if failed, consult the grammar pool.protected java.lang.ObjectgetGlobalDecl(java.lang.String declKey, int declType)protected java.lang.ObjectgetGlobalDecl(org.apache.xerces.impl.xs.traversers.XSDocumentInfo currSchema, int declType, org.apache.xerces.xni.QName declToTraverse, org.w3c.dom.Element elmNode)protected java.lang.ObjectgetGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, java.lang.String localpart)protected java.lang.ObjectgetGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, java.lang.String localpart, java.lang.String schemaLoc)protected java.util.HashtablegetIDRegistry()protected java.util.HashtablegetIDRegistry_sub()SchemaGrammarparseSchema(org.apache.xerces.xni.parser.XMLInputSource is, XSDDescription desc, java.util.Hashtable locationPairs)This method initiates the parse of a schema.voidreset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)protected voidresolveKeyRefs()java.lang.StringschemaDocument2SystemId(org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)voidsetDeclPool(XSDeclarationPool declPool)voidsetDVFactory(SchemaDVFactory dvFactory)voidsetGenerateSyntheticAnnotations(boolean state)protected voidstoreKeyRef(org.w3c.dom.Element keyrefToStore, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc, XSElementDecl currElemDecl)protected java.lang.ObjecttraverseGlobalDecl(int declType, org.w3c.dom.Element decl, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc, SchemaGrammar grammar)protected voidtraverseSchemas(java.util.ArrayList annotationInfo)
-
-
-
Field Detail
-
VALIDATION
protected static final java.lang.String VALIDATION
Feature identifier: validation.- See Also:
- Constant Field Values
-
XMLSCHEMA_VALIDATION
protected static final java.lang.String XMLSCHEMA_VALIDATION
feature identifier: XML Schema validation- See Also:
- Constant Field Values
-
ALLOW_JAVA_ENCODINGS
protected static final java.lang.String ALLOW_JAVA_ENCODINGS
Feature identifier: allow java encodings- See Also:
- Constant Field Values
-
CONTINUE_AFTER_FATAL_ERROR
protected static final java.lang.String CONTINUE_AFTER_FATAL_ERROR
Feature identifier: continue after fatal error- See Also:
- Constant Field Values
-
STANDARD_URI_CONFORMANT_FEATURE
protected static final java.lang.String STANDARD_URI_CONFORMANT_FEATURE
Feature identifier: allow java encodings- See Also:
- Constant Field Values
-
DISALLOW_DOCTYPE
protected static final java.lang.String DISALLOW_DOCTYPE
Feature: disallow doctype- See Also:
- Constant Field Values
-
GENERATE_SYNTHETIC_ANNOTATIONS
protected static final java.lang.String GENERATE_SYNTHETIC_ANNOTATIONS
Feature: generate synthetic annotations- See Also:
- Constant Field Values
-
VALIDATE_ANNOTATIONS
protected static final java.lang.String VALIDATE_ANNOTATIONS
Feature identifier: validate annotations.- See Also:
- Constant Field Values
-
HONOUR_ALL_SCHEMALOCATIONS
protected static final java.lang.String HONOUR_ALL_SCHEMALOCATIONS
Feature identifier: honour all schemaLocations- See Also:
- Constant Field Values
-
NAMESPACE_GROWTH
protected static final java.lang.String NAMESPACE_GROWTH
Feature identifier: namespace growth- See Also:
- Constant Field Values
-
TOLERATE_DUPLICATES
protected static final java.lang.String TOLERATE_DUPLICATES
Feature identifier: tolerate duplicates- See Also:
- Constant Field Values
-
STRING_INTERNING
protected static final java.lang.String STRING_INTERNING
Feature identifier: string interning.- See Also:
- Constant Field Values
-
ERROR_HANDLER
protected static final java.lang.String ERROR_HANDLER
Property identifier: error handler.- See Also:
- Constant Field Values
-
JAXP_SCHEMA_SOURCE
protected static final java.lang.String JAXP_SCHEMA_SOURCE
Property identifier: JAXP schema source.- See Also:
- Constant Field Values
-
ENTITY_RESOLVER
public static final java.lang.String ENTITY_RESOLVER
Property identifier: entity resolver.- See Also:
- Constant Field Values
-
ENTITY_MANAGER
protected static final java.lang.String ENTITY_MANAGER
Property identifier: entity manager.- See Also:
- Constant Field Values
-
ERROR_REPORTER
public static final java.lang.String ERROR_REPORTER
Property identifier: error reporter.- See Also:
- Constant Field Values
-
XMLGRAMMAR_POOL
public static final java.lang.String XMLGRAMMAR_POOL
Property identifier: grammar pool.- See Also:
- Constant Field Values
-
SYMBOL_TABLE
public static final java.lang.String SYMBOL_TABLE
Property identifier: symbol table.- See Also:
- Constant Field Values
-
SECURITY_MANAGER
protected static final java.lang.String SECURITY_MANAGER
Property identifier: security manager.- See Also:
- Constant Field Values
-
LOCALE
protected static final java.lang.String LOCALE
Property identifier: locale.- See Also:
- Constant Field Values
-
DEBUG_NODE_POOL
protected static final boolean DEBUG_NODE_POOL
- See Also:
- Constant Field Values
-
REDEF_IDENTIFIER
public static final java.lang.String REDEF_IDENTIFIER
- See Also:
- Constant Field Values
-
fNotationRegistry
protected java.util.Hashtable fNotationRegistry
-
fDeclPool
protected XSDeclarationPool fDeclPool
-
-
Constructor Detail
-
XSDHandler
public XSDHandler()
-
XSDHandler
public XSDHandler(XSGrammarBucket gBucket)
-
-
Method Detail
-
parseSchema
public SchemaGrammar parseSchema(org.apache.xerces.xni.parser.XMLInputSource is, XSDDescription desc, java.util.Hashtable locationPairs) throws java.io.IOException
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:
- the SchemaGrammar
- Throws:
java.io.IOException
-
findGrammar
protected SchemaGrammar findGrammar(XSDDescription desc, boolean ignoreConflict)
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.
-
constructTrees
protected org.apache.xerces.impl.xs.traversers.XSDocumentInfo constructTrees(org.w3c.dom.Element schemaRoot, java.lang.String locationHint, XSDDescription desc, boolean nsCollision)
-
buildGlobalNameRegistries
protected void buildGlobalNameRegistries()
-
traverseSchemas
protected void traverseSchemas(java.util.ArrayList annotationInfo)
-
getGlobalDecl
protected java.lang.Object getGlobalDecl(org.apache.xerces.impl.xs.traversers.XSDocumentInfo currSchema, int declType, org.apache.xerces.xni.QName declToTraverse, org.w3c.dom.Element elmNode)
-
getGlobalDecl
protected java.lang.Object getGlobalDecl(java.lang.String declKey, int declType)
-
getGlobalDeclFromGrammar
protected java.lang.Object getGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, java.lang.String localpart)
-
getGlobalDeclFromGrammar
protected java.lang.Object getGlobalDeclFromGrammar(SchemaGrammar sGrammar, int declType, java.lang.String localpart, java.lang.String schemaLoc)
-
traverseGlobalDecl
protected java.lang.Object traverseGlobalDecl(int declType, org.w3c.dom.Element decl, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc, SchemaGrammar grammar)
-
schemaDocument2SystemId
public java.lang.String schemaDocument2SystemId(org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc)
-
resolveKeyRefs
protected void resolveKeyRefs()
-
getIDRegistry
protected java.util.Hashtable getIDRegistry()
-
getIDRegistry_sub
protected java.util.Hashtable getIDRegistry_sub()
-
storeKeyRef
protected void storeKeyRef(org.w3c.dom.Element keyrefToStore, org.apache.xerces.impl.xs.traversers.XSDocumentInfo schemaDoc, XSElementDecl currElemDecl)
-
setDeclPool
public void setDeclPool(XSDeclarationPool declPool)
-
setDVFactory
public void setDVFactory(SchemaDVFactory dvFactory)
-
reset
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
-
element2Locator
public SimpleLocator element2Locator(org.w3c.dom.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(org.w3c.dom.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.
-
setGenerateSyntheticAnnotations
public void setGenerateSyntheticAnnotations(boolean state)
- Parameters:
state-
-
-