public class SchemaGrammar extends Object implements XSGrammar, XSNamespaceItem
Modifier and Type | Class and Description |
---|---|
static class |
SchemaGrammar.BuiltinSchemaGrammar |
static class |
SchemaGrammar.Schema4Annotations
A partial schema for schemas for validating annotations.
|
Modifier and Type | Field and Description |
---|---|
static XSSimpleType |
fAnySimpleType |
static XSComplexTypeDecl |
fAnyType |
static SchemaGrammar.BuiltinSchemaGrammar |
SG_SchemaNS |
static SchemaGrammar.BuiltinSchemaGrammar |
SG_XSI |
Modifier | Constructor and Description |
---|---|
protected |
SchemaGrammar() |
|
SchemaGrammar(SchemaGrammar grammar) |
|
SchemaGrammar(String targetNamespace,
XSDDescription grammarDesc,
SymbolTable symbolTable)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(XSAnnotationImpl annotation) |
void |
addComplexTypeDecl(XSComplexTypeDecl decl,
SimpleLocator locator)
add one complex type decl: for later constraint checking
|
void |
addDocument(Object document,
String location) |
void |
addGlobalAttributeDecl(XSAttributeDecl decl)
register one global attribute
|
void |
addGlobalAttributeDecl(XSAttributeDecl decl,
String location) |
void |
addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl)
register one global attribute group
|
void |
addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl,
String location) |
void |
addGlobalComplexTypeDecl(XSComplexTypeDecl decl)
register one global complex type
|
void |
addGlobalComplexTypeDecl(XSComplexTypeDecl decl,
String location) |
void |
addGlobalElementDecl(XSElementDecl decl) |
void |
addGlobalElementDecl(XSElementDecl decl,
String location) |
void |
addGlobalElementDeclAll(XSElementDecl decl)
register one global element
|
void |
addGlobalGroupDecl(XSGroupDecl decl)
register one global group
|
void |
addGlobalGroupDecl(XSGroupDecl decl,
String location) |
void |
addGlobalNotationDecl(XSNotationDecl decl)
register one global notation
|
void |
addGlobalNotationDecl(XSNotationDecl decl,
String location) |
void |
addGlobalSimpleTypeDecl(XSSimpleType decl)
register one global simple type
|
void |
addGlobalSimpleTypeDecl(XSSimpleType decl,
String location) |
void |
addGlobalTypeDecl(XSTypeDefinition decl)
register one global type
|
void |
addGlobalTypeDecl(XSTypeDefinition decl,
String location) |
void |
addIDConstraintDecl(XSElementDecl elmDecl,
IdentityConstraint decl)
register one identity constraint
|
void |
addIDConstraintDecl(XSElementDecl elmDecl,
IdentityConstraint decl,
String location) |
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(String name)
Convenience method.
|
XSAttributeGroupDefinition |
getAttributeGroup(String name)
Convenience method.
|
XSNamedMap |
getComponents(short objectType)
[schema components]: a list of top-level components, i.e.
|
ObjectList |
getComponentsExt(short objectType) |
StringList |
getDocumentLocations()
[document location]
|
XSElementDeclaration |
getElementDeclaration(String name)
Convenience method.
|
XSAttributeDecl |
getGlobalAttributeDecl(String declName)
get one global attribute
|
XSAttributeDecl |
getGlobalAttributeDecl(String declName,
String location) |
XSAttributeGroupDecl |
getGlobalAttributeGroupDecl(String declName)
get one global attribute group
|
XSAttributeGroupDecl |
getGlobalAttributeGroupDecl(String declName,
String location) |
XSElementDecl |
getGlobalElementDecl(String declName)
get one global element
|
XSElementDecl |
getGlobalElementDecl(String declName,
String location) |
XSGroupDecl |
getGlobalGroupDecl(String declName)
get one global group
|
XSGroupDecl |
getGlobalGroupDecl(String declName,
String location) |
XSNotationDecl |
getGlobalNotationDecl(String declName)
get one global notation
|
XSNotationDecl |
getGlobalNotationDecl(String declName,
String location) |
XSTypeDefinition |
getGlobalTypeDecl(String declName)
get one global type
|
XSTypeDefinition |
getGlobalTypeDecl(String declName,
String location) |
XMLGrammarDescription |
getGrammarDescription()
get the
XMLGrammarDescription associated with this
object |
XSIDCDefinition |
getIDCDefinition(String name)
Convenience method.
|
IdentityConstraint |
getIDConstraintDecl(String declName)
get one identity constraint
|
IdentityConstraint |
getIDConstraintDecl(String declName,
String location) |
Vector |
getImportedGrammars() |
XSModelGroupDefinition |
getModelGroupDefinition(String name)
Convenience method.
|
XSNotationDeclaration |
getNotationDeclaration(String name)
Convenience method.
|
static SchemaGrammar |
getS4SGrammar(short schemaVersion) |
String |
getSchemaNamespace()
[schema namespace]
|
String |
getTargetNamespace()
Returns this grammar's target namespace.
|
XSTypeDefinition |
getTypeDefinition(String name)
Convenience method.
|
boolean |
hasIDConstraints()
get one identity constraint
|
boolean |
isImmutable() |
boolean |
isNamespaceAware() |
void |
removeDocument(int index) |
void |
resetComponents() |
void |
setImmutable(boolean isImmutable) |
void |
setImportedGrammars(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. |
public static final XSComplexTypeDecl fAnyType
public static final SchemaGrammar.BuiltinSchemaGrammar SG_SchemaNS
public static final XSSimpleType fAnySimpleType
public static final SchemaGrammar.BuiltinSchemaGrammar SG_XSI
protected SchemaGrammar()
public SchemaGrammar(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 supportpublic SchemaGrammar(SchemaGrammar grammar)
public XMLGrammarDescription getGrammarDescription()
Grammar
XMLGrammarDescription
associated with this
objectgetGrammarDescription
in interface Grammar
public boolean isNamespaceAware()
public void setImportedGrammars(Vector importedGrammars)
public Vector getImportedGrammars()
public final String getTargetNamespace()
public void addGlobalAttributeDecl(XSAttributeDecl decl)
public void addGlobalAttributeDecl(XSAttributeDecl decl, String location)
public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl)
public void addGlobalAttributeGroupDecl(XSAttributeGroupDecl decl, String location)
public void addGlobalElementDeclAll(XSElementDecl decl)
public void addGlobalElementDecl(XSElementDecl decl)
public void addGlobalElementDecl(XSElementDecl decl, String location)
public void addGlobalGroupDecl(XSGroupDecl decl)
public void addGlobalGroupDecl(XSGroupDecl decl, String location)
public void addGlobalNotationDecl(XSNotationDecl decl)
public void addGlobalNotationDecl(XSNotationDecl decl, String location)
public void addGlobalTypeDecl(XSTypeDefinition decl)
public void addGlobalTypeDecl(XSTypeDefinition decl, String location)
public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl)
public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl, String location)
public void addGlobalSimpleTypeDecl(XSSimpleType decl)
public void addGlobalSimpleTypeDecl(XSSimpleType decl, String location)
public final void addIDConstraintDecl(XSElementDecl elmDecl, IdentityConstraint decl)
public final void addIDConstraintDecl(XSElementDecl elmDecl, IdentityConstraint decl, String location)
public final XSAttributeDecl getGlobalAttributeDecl(String declName)
public final XSAttributeDecl getGlobalAttributeDecl(String declName, String location)
public final XSAttributeGroupDecl getGlobalAttributeGroupDecl(String declName)
public final XSAttributeGroupDecl getGlobalAttributeGroupDecl(String declName, String location)
public final XSElementDecl getGlobalElementDecl(String declName)
public final XSElementDecl getGlobalElementDecl(String declName, String location)
public final XSGroupDecl getGlobalGroupDecl(String declName)
public final XSGroupDecl getGlobalGroupDecl(String declName, String location)
public final XSNotationDecl getGlobalNotationDecl(String declName)
public final XSNotationDecl getGlobalNotationDecl(String declName, String location)
public final XSTypeDefinition getGlobalTypeDecl(String declName)
public final XSTypeDefinition getGlobalTypeDecl(String declName, String location)
public final IdentityConstraint getIDConstraintDecl(String declName)
public final IdentityConstraint getIDConstraintDecl(String declName, String location)
public final boolean hasIDConstraints()
public void addComplexTypeDecl(XSComplexTypeDecl decl, SimpleLocator locator)
public void addRedefinedGroupDecl(XSGroupDecl derived, XSGroupDecl base, SimpleLocator locator)
public static SchemaGrammar getS4SGrammar(short schemaVersion)
public void removeDocument(int index)
public 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 ObjectList getComponentsExt(short objectType)
public void resetComponents()
public XSTypeDefinition getTypeDefinition(String name)
getTypeDefinition
in interface XSNamespaceItem
name
- The name of the definition.XSTypeDefinition
or null if such definition
does not exist.public XSAttributeDeclaration getAttributeDeclaration(String name)
getAttributeDeclaration
in interface XSNamespaceItem
name
- The name of the declaration.public XSElementDeclaration getElementDeclaration(String name)
getElementDeclaration
in interface XSNamespaceItem
name
- The name of the declaration.public XSAttributeGroupDefinition getAttributeGroup(String name)
getAttributeGroup
in interface XSNamespaceItem
name
- The name of the definition.public XSModelGroupDefinition getModelGroupDefinition(String name)
getModelGroupDefinition
in interface XSNamespaceItem
name
- The name of the definition.public XSNotationDeclaration getNotationDeclaration(String name)
getNotationDeclaration
in interface XSNamespaceItem
name
- The name of the declaration.public XSIDCDefinition getIDCDefinition(String name)
XSNamespaceItem
getIDCDefinition
in interface XSNamespaceItem
name
- The name of the definition.null
if such
a declaration does not exist.public StringList getDocumentLocations()
getDocumentLocations
in interface XSNamespaceItem
public XSModel toXSModel()
XSModel
that represents components in this schema
grammar.public 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.public XSObjectList getAnnotations()
XSNamespaceItem
XSObjectList
.getAnnotations
in interface XSNamespaceItem
XSNamespaceItem.getAnnotations()
public void addAnnotation(XSAnnotationImpl annotation)
public void setImmutable(boolean isImmutable)
public boolean isImmutable()
Copyright © 2016 JBoss by Red Hat. All rights reserved.