286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 2001-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * This class is to hold all schema component declaration that are declared 286N/A * within one namespace. 286N/A * The Grammar class this class extends contains what little 286N/A * commonality there is between XML Schema and DTD grammars. It's 286N/A * useful to distinguish grammar objects from other kinds of object 286N/A * when they exist in pools or caches. 286N/A * @author Sandy Gao, IBM 286N/A * @author Elena Litani, IBM 286N/A // the target namespace of grammar 286N/A // global decls: map from decl name to decl object 286N/A // extended global decls: map from schema location + decl name to decl object 286N/A // key is location,name 286N/A // A global map of all global element declarations - used for substitution group computation 286N/A // (handy when sharing components by reference, since we might end up with duplicate components 286N/A // that are not added to either of the global element declarations above) 286N/A // the XMLGrammarDescription member 286N/A // annotations associated with the "root" schema of this targetNamespace 286N/A // number of annotations declared 286N/A // symbol table for constructing parsers (annotation support) 286N/A // parsers for annotation support 286N/A // is this grammar immutable? (fully constructed and not changeable) 286N/A // needed to make BuiltinSchemaGrammar work. 286N/A * @param targetNamespace 286N/A * @param grammarDesc the XMLGrammarDescription corresponding to this objec 286N/A * at the least a systemId should always be known. 286N/A * @param symbolTable needed for annotation support 286N/A // REVISIT: do we know the numbers of the following global decls 286N/A // when creating this grammar? If so, we can pass the numbers in, 286N/A // and use that number to initialize the following hashtables. 286N/A // All global elements table 286N/A // if we are parsing S4S, put built-in types in first 286N/A // they might get overwritten by the types from S4S, but that's 286N/A // considered what the application wants to do. 286N/A }
// <init>(String, XSDDescription) 286N/A // Clone an existing schema grammar 286N/A //fGrammarDescription.fContextType |= XSDDescription.CONTEXT_COLLISION; // REVISIT 286N/A // All global elements table 286N/A // Annotations associated with the "root" schema of this targetNamespace 286N/A // All substitution group information declared in this namespace 286N/A // Array to store complex type decls for constraint checking 286N/A // Groups being redefined by restriction 286N/A // List of imported grammars 286N/A }
// <init>(String, XSDDescription) 286N/A // number of built-in XSTypes we need to create for base and full 286N/A // this class makes sure the static, built-in schema grammars 286N/A * Special constructor to create the grammars for the schema namespaces 286N/A // no global decls other than types 286N/A // no extended global decls 286N/A // all global element decls table 286N/A // get all built-in types 286N/A // assign the built-in schema grammar as the XSNamespaceItem 286N/A // for each of the built-in simple type definitions. 286N/A // no global decls other than attributes 286N/A // no extended global decls 286N/A // no all global element decls 286N/A // 4 attributes, so initialize the size as 4*2 = 8 286N/A // xsi:noNamespaceSchemaLocation 286N/A // return the XMLGrammarDescription corresponding to this 286N/A }
// getGrammarDescription(): XMLGrammarDescription 286N/A // override these methods solely so that these 286N/A // objects cannot be modified once they're created. 286N/A * <p>A partial schema for schemas for validating annotations.</p> 286N/A * @author Michael Glavassevich, IBM 286N/A * Special constructor to create a schema 286N/A * capable of validating annotations. 286N/A // no global decls other than types and 286N/A // element declarations for <annotation>, <documentation> and <appinfo>. 286N/A // no extended global decls 286N/A // all global element declarations 286N/A // get all built-in types 286N/A // create element declarations for <annotation>, <documentation> and <appinfo> 286N/A // add global element declarations 286N/A // create complex type declarations for <annotation>, <documentation> and <appinfo> 286N/A // set the types on their element declarations 286N/A // create attribute groups for <annotation>, <documentation> and <appinfo> 286N/A // fill in attribute groups 286N/A // create and fill attribute uses for <annotation>, <documentation> and <appinfo> 286N/A // create lax attribute wildcard for <annotation>, <documentation> and <appinfo> 286N/A // add attribute uses and wildcards to attribute groups for <annotation>, <documentation> and <appinfo> 286N/A // create particles for <annotation> 286N/A // create wildcard particle for <documentation> and <appinfo> 286N/A // return the XMLGrammarDescription corresponding to this 286N/A }
// getGrammarDescription(): XMLGrammarDescription 286N/A // override these methods solely so that these 286N/A // objects cannot be modified once they're created. 286N/A // private helper methods 286N/A // return the XMLGrammarDescription corresponding to this 286N/A }
// getGrammarDescription(): XMLGrammarDescription 286N/A }
// isNamespaceAware():boolean 286N/A * Returns this grammar's target namespace. 286N/A }
// getTargetNamespace():String 286N/A * register one global attribute 286N/A * register one global attribute group 286N/A * register one global element 286N/A // if there is a substitution group affiliation, store in an array, 286N/A // for further constraint checking: UPA, PD, EDC 286N/A * register one global group 286N/A * register one global notation 286N/A * register one global type 286N/A * register one global complex type 286N/A * register one global simple type 286N/A * register one identity constraint 286N/A * get one global attribute 286N/A * get one global attribute group 286N/A * get one global element 286N/A * get one global notation 286N/A * get one identity constraint 286N/A * get one identity constraint 286N/A // array to store complex type decls 286N/A // an array to store groups being redefined by restriction 286N/A // even-numbered elements are the derived groups, odd-numbered ones their bases 286N/A // a flag to indicate whether we have checked the 3 constraints on this 286N/A * add one complex type decl: for later constraint checking 286N/A * add a group redefined by restriction: for later constraint checking 286N/A // double array size each time. 286N/A * get all complex type decls: for later constraint checking 286N/A * get the error locator of all complex type decls 286N/A * get all redefined groups: for later constraint checking 286N/A * get the error locator of all redefined groups 286N/A * after the first-round checking, some types don't need to be checked 286N/A * against UPA again. here we trim the array to the proper size. 286N/A // used to store all substitution group information declared in 286N/A * get all substitution group information: for the 3 constraint checking 286N/A // anyType and anySimpleType: because there are so many places where 286N/A // we need direct access to these two types 286N/A // the wildcard used in anyType (content and attribute) 286N/A // the spec will change strict to skip for anyType 286N/A // the particle for the content wildcard 286N/A // the model group of a sequence of the above particle 286N/A // the content of anyType: particle of the above model group 286N/A // also ignore this call. 286N/A }
// class BuiltinAttrDecl 286N/A // the grammars to hold components of the schema namespace 286N/A // the grammars to hold components of the schema-instance namespace 286N/A // XSNamespaceItem methods 286N/A // the max index / the max value of XSObject type 286N/A false,
// attribute use 286N/A true,
// attribute group 286N/A false,
// multi value facet 286N/A // store a certain kind of components from all namespaces 286N/A // store the documents and their locations contributing to this namespace 286N/A // REVISIT: use StringList and XSObjectList for there fields. 286N/A * @return The target namespace of this item. 286N/A // REVISIT: when schema handles XML 1.1, will need to 286N/A // revisit this (and the practice of not prepending an XML decl to the annotation string 286N/A // note that this should never produce errors or require 286N/A // entity resolution, so just a barebones configuration with 286N/A // a couple of feature set will do fine 286N/A // REVISIT: when schema handles XML 1.1, will need to 286N/A // revisit this (and the practice of not prepending an XML decl to the annotation string 286N/A // note that this should never produce errors or require 286N/A // entity resolution, so just a barebones configuration with 286N/A // a couple of feature set will do fine 286N/A * [schema components]: a list of top-level components, i.e. element 286N/A * declarations, attribute declarations, etc. 286N/A * @param objectType The type of the declaration, i.e. 286N/A * <code>ELEMENT_DECLARATION</code>. Note that 286N/A * <code>XSTypeDefinition.SIMPLE_TYPE</code> and 286N/A * <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the 286N/A * <code>objectType</code> to retrieve only complex types or simple 286N/A * types, instead of all types. 286N/A * @return A list of top-level definition of the specified type in 286N/A * <code>objectType</code> or an empty <code>XSNamedMap</code> if no 286N/A * such definitions exist. 286N/A // get the hashtable for this type of components 286N/A // which take specific types out of the hash table 286N/A // get the hashtable for this type of components 286N/A * Convenience method. Returns a top-level simple or complex type 286N/A * @param name The name of the definition. 286N/A * @return An <code>XSTypeDefinition</code> or null if such definition 286N/A * Convenience method. Returns a top-level attribute declaration. 286N/A * @param name The name of the declaration. 286N/A * @return A top-level attribute declaration or null if such declaration 286N/A * Convenience method. Returns a top-level element declaration. 286N/A * @param name The name of the declaration. 286N/A * @return A top-level element declaration or null if such declaration 286N/A * Convenience method. Returns a top-level attribute group definition. 286N/A * @param name The name of the definition. 286N/A * @return A top-level attribute group definition or null if such 286N/A * definition does not exist. 286N/A * Convenience method. Returns a top-level model group definition. 286N/A * @param name The name of the definition. 286N/A * @return A top-level model group definition definition or null if such 286N/A * definition does not exist. 286N/A * Convenience method. Returns a top-level notation declaration. 286N/A * @param name The name of the declaration. 286N/A * @return A top-level notation declaration or null if such declaration 286N/A * @return a list of document information item 286N/A * Return an <code>XSModel</code> that represents components in this schema 286N/A * @return an <code>XSModel</code> representing this schema grammar 286N/A * @see org.apache.xerces.xs.XSNamespaceItem#getAnnotations() 286N/A}
// class SchemaGrammar