Top Description Inners Fields Constructors Methods
org.apache.xerces.impl.xs

public Class SchemaGrammar

extends Object
implements XSGrammar, XSNamespaceItem
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xs.XSNamespaceItem, org.apache.xerces.xni.grammars.XSGrammar, org.apache.xerces.xni.grammars.Grammar
Known Direct Subclasses
org.apache.xerces.impl.xs.SchemaGrammar.BuiltinSchemaGrammar, org.apache.xerces.impl.xs.SchemaGrammar.Schema4Annotations
Imports
java.lang.ref.SoftReference, java.util.Vector, org.apache.xerces.impl.Constants, org.apache.xerces.impl.dv.SchemaDVFactory, .ValidatedInfo, .XSSimpleType, org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl, org.apache.xerces.impl.xs.identity.IdentityConstraint, org.apache.xerces.impl.xs.util.ObjectListImpl, .SimpleLocator, .StringListImpl, .XSNamedMap4Types, .XSNamedMapImpl, .XSObjectListImpl, org.apache.xerces.parsers.DOMParser, .SAXParser, .XML11Configuration, org.apache.xerces.util.SymbolHash, .SymbolTable, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xni.grammars.XMLGrammarDescription, .XSGrammar, org.apache.xerces.xs.StringList, .XSAnnotation, .XSAttributeDeclaration, .XSAttributeGroupDefinition, .XSConstants, .XSElementDeclaration, .XSIDCDefinition, .XSModel, .XSModelGroupDefinition, .XSNamedMap, .XSNamespaceItem, .XSNotationDeclaration, .XSObjectList, .XSTypeDefinition, .XSWildcard, org.apache.xerces.xs.datatypes.ObjectList, org.xml.sax.SAXException

This class is to hold all schema component declaration that are declared within one namespace. The Grammar class this class extends contains what little commonality there is between XML Schema and DTD grammars. It's useful to distinguish grammar objects from other kinds of object when they exist in pools or caches.
Authors
Sandy Gao, IBM, Elena Litani, IBM
Version
$Id: SchemaGrammar.java 1082533 2011-03-17 15:22:26Z knoaman $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class
public static class
SchemaGrammar.Schema4Annotations

A partial schema for schemas for validating annotations.

private static class

Field Summary

Modifier and TypeField and Description
private static final int
pack-priv SymbolHash
pack-priv XSAnnotationImpl[]
public static final XSSimpleType
public static final XSComplexTypeDecl
private XSComplexTypeDecl[]
private XSNamedMap[]
private ObjectList[]
private int
private SimpleLocator[]
private Vector<E>
private SoftReference<T>
pack-priv boolean
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv SymbolHash
pack-priv XSDDescription
pack-priv Vector<E>
private boolean
private Vector<E>
pack-priv int
private XSGroupDecl[]
private int
private SimpleLocator[]
private SoftReference<T>
private int
private XSElementDecl[]
private SymbolTable
pack-priv String
private static final int
private static final boolean[]
private static final int
private static final int
private static final int
private static final int
private static final short
private static final int
public static final SchemaGrammar.BuiltinSchemaGrammar
private static final SchemaGrammar.BuiltinSchemaGrammar
public static final SchemaGrammar.BuiltinSchemaGrammar

Constructor Summary

AccessConstructor and Description
protected
public
SchemaGrammar(String targetNamespace, XSDDescription
the XMLGrammarDescription corresponding to this objec at the least a systemId should always be known.
grammarDesc
,
SymbolTable
needed for annotation support
symbolTable
)

Default constructor.

public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addComplexTypeDecl(XSComplexTypeDecl decl, SimpleLocator locator)

add one complex type decl: for later constraint checking

public synchronized void
addDocument(Object document, String location)

public void
addGlobalAttributeDecl(XSAttributeDecl decl)

register one global attribute

public void
public void
addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl)

register one global attribute group

public void
public void
addGlobalComplexTypeDecl(XSComplexTypeDecl decl)

register one global complex type

public void
public void
public void
public void
addGlobalElementDeclAll(XSElementDecl decl)

register one global element

public void
addGlobalGroupDecl(XSGroupDecl decl)

register one global group

public void
public void
addGlobalNotationDecl(XSNotationDecl decl)

register one global notation

public void
public void
addGlobalSimpleTypeDecl(XSSimpleType decl)

register one global simple type

public void
public void
addGlobalTypeDecl(XSTypeDefinition decl)

register one global type

public void
public final void
addIDConstraintDecl(XSElementDecl elmDecl, IdentityConstraint decl)

register one identity constraint

public final void
public void
addRedefinedGroupDecl(XSGroupDecl derived, XSGroupDecl base, SimpleLocator locator)

add a group redefined by restriction: for later constraint checking

public XSObjectList
getAnnotations()

Implements org.apache.xerces.xs.XSNamespaceItem.getAnnotations.

[annotations]: a set of annotations if it exists, otherwise an empty XSObjectList.
public XSAttributeDeclaration

Returns:

A top-level attribute declaration or null if such declaration does not exist.
getAttributeDeclaration
(String
The name of the declaration.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getAttributeDeclaration.

Convenience method.
public XSAttributeGroupDefinition

Returns:

A top-level attribute group definition or null if such definition does not exist.
getAttributeGroup
(String
The name of the definition.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getAttributeGroup.

Convenience method.
public synchronized XSNamedMap

Returns:

A list of top-level definition of the specified type in objectType or an empty XSNamedMap if no such definitions exist.
getComponents
(short
The type of the declaration, i.e. ELEMENT_DECLARATION. Note that XSTypeDefinition.SIMPLE_TYPE and XSTypeDefinition.COMPLEX_TYPE can also be used as the objectType to retrieve only complex types or simple types, instead of all types.
objectType
)

Implements org.apache.xerces.xs.XSNamespaceItem.getComponents.

[schema components]: a list of top-level components, i.e. element declarations, attribute declarations, etc.
public synchronized ObjectList
getComponentsExt(short objectType)

public StringList

Returns:

a list of document information item
getDocumentLocations
()

Implements org.apache.xerces.xs.XSNamespaceItem.getDocumentLocations.

[document location]
pack-priv synchronized DOMParser
public XSElementDeclaration

Returns:

A top-level element declaration or null if such declaration does not exist.
getElementDeclaration
(String
The name of the declaration.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getElementDeclaration.

Convenience method.
public final XSAttributeDecl
getGlobalAttributeDecl(String declName)

get one global attribute

public final XSAttributeDecl
getGlobalAttributeDecl(String declName, String location)

public final XSAttributeGroupDecl
getGlobalAttributeGroupDecl(String declName)

get one global attribute group

public final XSAttributeGroupDecl
public final XSElementDecl
getGlobalElementDecl(String declName)

get one global element

public final XSElementDecl
getGlobalElementDecl(String declName, String location)

public final XSGroupDecl
getGlobalGroupDecl(String declName)

get one global group

public final XSGroupDecl
getGlobalGroupDecl(String declName, String location)

public final XSNotationDecl
getGlobalNotationDecl(String declName)

get one global notation

public final XSNotationDecl
getGlobalNotationDecl(String declName, String location)

public final XSTypeDefinition
getGlobalTypeDecl(String declName)

get one global type

public final XSTypeDefinition
getGlobalTypeDecl(String declName, String location)

public XMLGrammarDescription
getGrammarDescription()

Implements org.apache.xerces.xni.grammars.Grammar.getGrammarDescription.

get the XMLGrammarDescription associated with this object
public XSIDCDefinition
getIDCDefinition(String
The name of the definition.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getIDCDefinition.

Convenience method.
public final IdentityConstraint
getIDConstraintDecl(String declName)

get one identity constraint

public final IdentityConstraint
getIDConstraintDecl(String declName, String location)

public Vector<E>
public XSModelGroupDefinition

Returns:

A top-level model group definition definition or null if such definition does not exist.
getModelGroupDefinition
(String
The name of the definition.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getModelGroupDefinition.

Convenience method.
public XSNotationDeclaration

Returns:

A top-level notation declaration or null if such declaration does not exist.
getNotationDeclaration
(String
The name of the declaration.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getNotationDeclaration.

Convenience method.
pack-priv final XSGroupDecl[]
getRedefinedGroupDecls()

get all redefined groups: for later constraint checking

pack-priv final SimpleLocator[]
getRGLocators()

get the error locator of all redefined groups

public static SchemaGrammar
getS4SGrammar(short schemaVersion)

pack-priv synchronized SAXParser
getSAXParser()

Deprecated as a consequence of SAXParser being deprecated.
public String

Returns:

The target namespace of this item.
getSchemaNamespace
()

Implements org.apache.xerces.xs.XSNamespaceItem.getSchemaNamespace.

[schema namespace]
pack-priv final XSElementDecl[]
getSubstitutionGroups()

get all substitution group information: for the 3 constraint checking

public final String
getTargetNamespace()

Returns this grammar's target namespace.

public XSTypeDefinition

Returns:

An XSTypeDefinition or null if such definition does not exist.
getTypeDefinition
(String
The name of the definition.
name
)

Implements org.apache.xerces.xs.XSNamespaceItem.getTypeDefinition.

Convenience method.
pack-priv final XSComplexTypeDecl[]
getUncheckedComplexTypeDecls()

get all complex type decls: for later constraint checking

pack-priv final SimpleLocator[]
getUncheckedCTLocators()

get the error locator of all complex type decls

public final boolean
hasIDConstraints()

get one identity constraint

public boolean
public boolean
public synchronized void
removeDocument(int index)

public synchronized void
pack-priv static final XSComplexTypeDecl[]
resize(XSComplexTypeDecl[] oldArray, int newSize)

pack-priv static final XSGroupDecl[]
resize(XSGroupDecl[] oldArray, int newSize)

pack-priv static final XSElementDecl[]
resize(XSElementDecl[] oldArray, int newSize)

pack-priv static final SimpleLocator[]
resize(SimpleLocator[] oldArray, int newSize)

public void
setImmutable(boolean isImmutable)

public void
setImportedGrammars(Vector<E> importedGrammars)

pack-priv final void
setUncheckedTypeNum(int newSize)

after the first-round checking, some types don't need to be checked against UPA again.

public XSModel

Returns:

an XSModel representing this schema grammar
toXSModel
()

Implements org.apache.xerces.xni.grammars.XSGrammar.toXSModel.

Return an XSModel that represents components in this schema grammar.
public XSModel
toXSModel(XSGrammar[] grammars)

Implements org.apache.xerces.xni.grammars.XSGrammar.toXSModel.

Return an XSModel that represents components in this schema grammar and the grammars in the grammarsparameter, any schema grammars that are imported by them directly or indirectly.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait