public class SchemaGrammar
extends java.lang.Object
implements org.apache.xerces.xni.grammars.XSGrammar, org.apache.xerces.xs.XSNamespaceItem
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.
addComplexTypeDecl
public void addComplexTypeDecl(XSComplexTypeDecl decl,
SimpleLocator locator)
add one complex type decl: for later constraint checking
addDocument
public void addDocument(Object document,
String location)
addGlobalAttributeDecl
public void addGlobalAttributeDecl(XSAttributeDecl decl)
register one global attribute
addGlobalAttributeGroupDecl
public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl)
register one global attribute group
addGlobalElementDecl
public void addGlobalElementDecl(XSElementDecl decl)
register one global element
addGlobalGroupDecl
public void addGlobalGroupDecl(XSGroupDecl decl)
register one global group
addGlobalNotationDecl
public void addGlobalNotationDecl(XSNotationDecl decl)
register one global notation
addGlobalTypeDecl
public void addGlobalTypeDecl(org.apache.xerces.xs.XSTypeDefinition decl)
register one global type
addRedefinedGroupDecl
public void addRedefinedGroupDecl(XSGroupDecl derived,
XSGroupDecl base,
SimpleLocator locator)
add a group redefined by restriction: for later constraint checking
getAnnotations
public org.apache.xerces.xs.XSObjectList getAnnotations()
- getAnnotations in interface org.apache.xerces.xs.XSNamespaceItem
org.apache.xerces.xs.XSNamespaceItem.getAnnotations()
getAttributeDeclaration
public org.apache.xerces.xs.XSAttributeDeclaration getAttributeDeclaration(String name)
Convenience method. Returns a top-level attribute declaration.
- getAttributeDeclaration in interface org.apache.xerces.xs.XSNamespaceItem
name
- The name of the declaration.
- A top-level attribute declaration or null if such declaration
does not exist.
getAttributeGroup
public org.apache.xerces.xs.XSAttributeGroupDefinition getAttributeGroup(String name)
Convenience method. Returns a top-level attribute group definition.
- getAttributeGroup in interface org.apache.xerces.xs.XSNamespaceItem
name
- The name of the definition.
- A top-level attribute group definition or null if such
definition does not exist.
getComponents
public org.apache.xerces.xs.XSNamedMap getComponents(short objectType)
[schema components]: a list of top-level components, i.e. element
declarations, attribute declarations, etc.
- getComponents in interface org.apache.xerces.xs.XSNamespaceItem
objectType
- 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.
- A list of top-level definition of the specified type in
objectType
or an empty XSNamedMap
if no
such definitions exist.
getDocumentLocations
public org.apache.xerces.xs.StringList getDocumentLocations()
[document location]
- getDocumentLocations in interface org.apache.xerces.xs.XSNamespaceItem
- a list of document information item
getElementDeclaration
public org.apache.xerces.xs.XSElementDeclaration getElementDeclaration(String name)
Convenience method. Returns a top-level element declaration.
- getElementDeclaration in interface org.apache.xerces.xs.XSNamespaceItem
name
- The name of the declaration.
- A top-level element declaration or null if such declaration
does not exist.
getGlobalAttributeDecl
public final XSAttributeDecl getGlobalAttributeDecl(String declName)
get one global attribute
getGlobalAttributeGroupDecl
public final XSAttributeGroupDecl getGlobalAttributeGroupDecl(String declName)
get one global attribute group
getGlobalElementDecl
public final XSElementDecl getGlobalElementDecl(String declName)
get one global element
getGlobalGroupDecl
public final XSGroupDecl getGlobalGroupDecl(String declName)
get one global group
getGlobalNotationDecl
public final XSNotationDecl getGlobalNotationDecl(String declName)
get one global notation
getGlobalTypeDecl
public final org.apache.xerces.xs.XSTypeDefinition getGlobalTypeDecl(String declName)
get one global type
getGrammarDescription
public org.apache.xerces.xni.grammars.XMLGrammarDescription getGrammarDescription()
getIDConstraintDecl
public final IdentityConstraint getIDConstraintDecl(String declName)
get one identity constraint
getImportedGrammars
public Vector getImportedGrammars()
getModelGroupDefinition
public org.apache.xerces.xs.XSModelGroupDefinition getModelGroupDefinition(String name)
Convenience method. Returns a top-level model group definition.
- getModelGroupDefinition in interface org.apache.xerces.xs.XSNamespaceItem
name
- The name of the definition.
- A top-level model group definition definition or null if such
definition does not exist.
getNotationDeclaration
public org.apache.xerces.xs.XSNotationDeclaration getNotationDeclaration(String name)
Convenience method. Returns a top-level notation declaration.
- getNotationDeclaration in interface org.apache.xerces.xs.XSNamespaceItem
name
- The name of the declaration.
- A top-level notation declaration or null if such declaration
does not exist.
getSchemaNamespace
public String getSchemaNamespace()
[schema namespace]
- getSchemaNamespace in interface org.apache.xerces.xs.XSNamespaceItem
- The target namespace of this item.
getTargetNamespace
public final String getTargetNamespace()
Returns this grammar's target namespace.
getTypeDefinition
public org.apache.xerces.xs.XSTypeDefinition getTypeDefinition(String name)
Convenience method. Returns a top-level simple or complex type
definition.
- getTypeDefinition in interface org.apache.xerces.xs.XSNamespaceItem
name
- The name of the definition.
- An
XSTypeDefinition
or null if such definition
does not exist.
hasIDConstraints
public final boolean hasIDConstraints()
get one identity constraint
isNamespaceAware
public boolean isNamespaceAware()
setImportedGrammars
public void setImportedGrammars(Vector importedGrammars)
toXSModel
public org.apache.xerces.xs.XSModel toXSModel()
Return an XSModel
that represents components in this schema
grammar.
- an
XSModel
representing this schema grammar
toXSModel
public org.apache.xerces.xs.XSModel toXSModel(org.apache.xerces.xni.grammars.XSGrammar[] grammars)