|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xerces.impl.xs.SchemaGrammar
public class SchemaGrammar
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.
Nested Class Summary | |
---|---|
static class |
SchemaGrammar.BuiltinSchemaGrammar
|
static class |
SchemaGrammar.Schema4Annotations
A partial schema for schemas for validating annotations. |
Field Summary | |
---|---|
static XSSimpleType |
fAnySimpleType
|
static XSComplexTypeDecl |
fAnyType
|
static SchemaGrammar.Schema4Annotations |
SG_Schema4Annotations
|
static SchemaGrammar.BuiltinSchemaGrammar |
SG_SchemaNS
|
static SchemaGrammar.BuiltinSchemaGrammar |
SG_XSI
|
Constructor Summary | |
---|---|
SchemaGrammar(java.lang.String targetNamespace,
XSDDescription grammarDesc,
SymbolTable symbolTable)
Default constructor. |
Method Summary | |
---|---|
void |
addAnnotation(XSAnnotationImpl annotation)
|
void |
addComplexTypeDecl(XSComplexTypeDecl decl,
SimpleLocator locator)
add one complex type decl: for later constraint checking |
void |
addDocument(java.lang.Object document,
java.lang.String location)
|
void |
addGlobalAttributeDecl(XSAttributeDecl decl)
register one global attribute |
void |
addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl)
register one global attribute group |
void |
addGlobalElementDecl(XSElementDecl decl)
register one global element |
void |
addGlobalGroupDecl(XSGroupDecl decl)
register one global group |
void |
addGlobalNotationDecl(XSNotationDecl decl)
register one global notation |
void |
addGlobalTypeDecl(XSTypeDefinition decl)
register one global type |
void |
addIDConstraintDecl(XSElementDecl elmDecl,
IdentityConstraint decl)
register one identity constraint |
void |
addRedefinedGroupDecl(XSGroupDecl derived,
XSGroupDecl base,
SimpleLocator locator)
add a group redefined by restriction: for later constraint checking |
XSObjectList |
getAnnotations()
[annotations]: a set of annotations if it exists, otherwise an empty XSObjectList . |
XSAttributeDeclaration |
getAttributeDeclaration(java.lang.String name)
Convenience method. |
XSAttributeGroupDefinition |
getAttributeGroup(java.lang.String name)
Convenience method. |
XSNamedMap |
getComponents(short objectType)
[schema components]: a list of top-level components, i.e. |
StringList |
getDocumentLocations()
[document location] |
XSElementDeclaration |
getElementDeclaration(java.lang.String name)
Convenience method. |
XSAttributeDecl |
getGlobalAttributeDecl(java.lang.String declName)
get one global attribute |
XSAttributeGroupDecl |
getGlobalAttributeGroupDecl(java.lang.String declName)
get one global attribute group |
XSElementDecl |
getGlobalElementDecl(java.lang.String declName)
get one global element |
XSGroupDecl |
getGlobalGroupDecl(java.lang.String declName)
get one global group |
XSNotationDecl |
getGlobalNotationDecl(java.lang.String declName)
get one global notation |
XSTypeDefinition |
getGlobalTypeDecl(java.lang.String declName)
get one global type |
XMLGrammarDescription |
getGrammarDescription()
get the XMLGrammarDescription associated with this
object |
IdentityConstraint |
getIDConstraintDecl(java.lang.String declName)
get one identity constraint |
java.util.Vector |
getImportedGrammars()
|
XSModelGroupDefinition |
getModelGroupDefinition(java.lang.String name)
Convenience method. |
XSNotationDeclaration |
getNotationDeclaration(java.lang.String name)
Convenience method. |
java.lang.String |
getSchemaNamespace()
[schema namespace] |
java.lang.String |
getTargetNamespace()
Returns this grammar's target namespace. |
XSTypeDefinition |
getTypeDefinition(java.lang.String name)
Convenience method. |
boolean |
hasIDConstraints()
get one identity constraint |
boolean |
isNamespaceAware()
|
void |
setImportedGrammars(java.util.Vector importedGrammars)
|
XSModel |
toXSModel()
Return an XSModel that represents components in this schema
grammar. |
XSModel |
toXSModel(XSGrammar[] grammars)
Return an XSModel that represents components in this schema
grammar and the grammars in the grammars parameter,
any schema grammars that are imported by them directly or indirectly. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final XSComplexTypeDecl fAnyType
public static final SchemaGrammar.BuiltinSchemaGrammar SG_SchemaNS
public static final SchemaGrammar.Schema4Annotations SG_Schema4Annotations
public static final XSSimpleType fAnySimpleType
public static final SchemaGrammar.BuiltinSchemaGrammar SG_XSI
Constructor Detail |
---|
public SchemaGrammar(java.lang.String targetNamespace, XSDDescription grammarDesc, SymbolTable symbolTable)
targetNamespace
- grammarDesc
- the XMLGrammarDescription corresponding to this objec
at the least a systemId should always be known.symbolTable
- needed for annotation supportMethod Detail |
---|
public XMLGrammarDescription getGrammarDescription()
Grammar
XMLGrammarDescription
associated with this
object
getGrammarDescription
in interface Grammar
public boolean isNamespaceAware()
public void setImportedGrammars(java.util.Vector importedGrammars)
public java.util.Vector getImportedGrammars()
public final java.lang.String getTargetNamespace()
public void addGlobalAttributeDecl(XSAttributeDecl decl)
public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl)
public void addGlobalElementDecl(XSElementDecl decl)
public void addGlobalGroupDecl(XSGroupDecl decl)
public void addGlobalNotationDecl(XSNotationDecl decl)
public void addGlobalTypeDecl(XSTypeDefinition decl)
public final void addIDConstraintDecl(XSElementDecl elmDecl, IdentityConstraint decl)
public final XSAttributeDecl getGlobalAttributeDecl(java.lang.String declName)
public final XSAttributeGroupDecl getGlobalAttributeGroupDecl(java.lang.String declName)
public final XSElementDecl getGlobalElementDecl(java.lang.String declName)
public final XSGroupDecl getGlobalGroupDecl(java.lang.String declName)
public final XSNotationDecl getGlobalNotationDecl(java.lang.String declName)
public final XSTypeDefinition getGlobalTypeDecl(java.lang.String declName)
public final IdentityConstraint getIDConstraintDecl(java.lang.String declName)
public final boolean hasIDConstraints()
public void addComplexTypeDecl(XSComplexTypeDecl decl, SimpleLocator locator)
public void addRedefinedGroupDecl(XSGroupDecl derived, XSGroupDecl base, SimpleLocator locator)
public void addDocument(java.lang.Object document, java.lang.String location)
public java.lang.String getSchemaNamespace()
getSchemaNamespace
in interface XSNamespaceItem
public XSNamedMap getComponents(short objectType)
getComponents
in interface 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.
objectType
or an empty XSNamedMap
if no
such definitions exist.public XSTypeDefinition getTypeDefinition(java.lang.String name)
getTypeDefinition
in interface XSNamespaceItem
name
- The name of the definition.
XSTypeDefinition
or null if such definition
does not exist.public XSAttributeDeclaration getAttributeDeclaration(java.lang.String name)
getAttributeDeclaration
in interface XSNamespaceItem
name
- The name of the declaration.
public XSElementDeclaration getElementDeclaration(java.lang.String name)
getElementDeclaration
in interface XSNamespaceItem
name
- The name of the declaration.
public XSAttributeGroupDefinition getAttributeGroup(java.lang.String name)
getAttributeGroup
in interface XSNamespaceItem
name
- The name of the definition.
public XSModelGroupDefinition getModelGroupDefinition(java.lang.String name)
getModelGroupDefinition
in interface XSNamespaceItem
name
- The name of the definition.
public XSNotationDeclaration getNotationDeclaration(java.lang.String name)
getNotationDeclaration
in interface XSNamespaceItem
name
- The name of the declaration.
public StringList getDocumentLocations()
getDocumentLocations
in interface XSNamespaceItem
public XSModel toXSModel()
XSModel
that represents components in this schema
grammar.
toXSModel
in interface XSGrammar
XSModel
representing this schema grammarpublic XSModel toXSModel(XSGrammar[] grammars)
XSGrammar
XSModel
that represents components in this schema
grammar and the grammars in the grammars
parameter,
any schema grammars that are imported by them directly or indirectly.
toXSModel
in interface XSGrammar
XSModel
representing these schema grammarspublic XSObjectList getAnnotations()
XSNamespaceItem
XSObjectList
.
getAnnotations
in interface XSNamespaceItem
XSNamespaceItem.getAnnotations()
public void addAnnotation(XSAnnotationImpl annotation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |