public class SchemaImpl extends Object implements XSSchema
Modifier and Type | Field and Description |
---|---|
protected SchemaSetImpl |
parent |
Constructor and Description |
---|
SchemaImpl(SchemaSetImpl _parent,
Locator loc,
String tns) |
Modifier and Type | Method and Description |
---|---|
void |
addAttGroupDecl(XSAttGroupDecl newDecl,
boolean overwrite) |
void |
addAttributeDecl(XSAttributeDecl newDecl) |
void |
addComplexType(XSComplexType newDecl,
boolean overwrite) |
void |
addElementDecl(XSElementDecl newDecl) |
void |
addForeignAttributes(ForeignAttributesImpl fa) |
protected void |
addIdentityConstraint(IdentityConstraintImpl c) |
void |
addModelGroupDecl(XSModelGroupDecl newDecl,
boolean overwrite) |
void |
addNotation(XSNotation newDecl) |
void |
addSimpleType(XSSimpleType newDecl,
boolean overwrite) |
Object |
apply(XSFunction function)
Accepts a functor.
|
XSAnnotation |
getAnnotation()
Gets the annotation associated to this component, if any.
|
XSAnnotation |
getAnnotation(boolean createIfNotExist)
Works like
XSComponent.getAnnotation() , but allow a new empty XSAnnotation to be created
if not exist. |
XSAttGroupDecl |
getAttGroupDecl(String name) |
Map<String,XSAttGroupDecl> |
getAttGroupDecls()
Gets all the
XSAttGroupDecl s in this schema. |
XSAttributeDecl |
getAttributeDecl(String name) |
Map<String,XSAttributeDecl> |
getAttributeDecls()
Gets all the
XSAttributeDecl s in this schema
keyed by their local names. |
XSComplexType |
getComplexType(String name) |
Map<String,XSComplexType> |
getComplexTypes()
Gets all the
XSComplexType s in this schema. |
XSElementDecl |
getElementDecl(String name) |
Map<String,XSElementDecl> |
getElementDecls()
Gets all the
XSElementDecl s in this schema. |
String |
getForeignAttribute(String nsUri,
String localName)
Gets the foreign attribute of the given name, or null if not found.
|
List<ForeignAttributes> |
getForeignAttributes()
Gets the foreign attributes on this schema component.
|
XSIdentityConstraint |
getIdentityConstraint(String localName)
Gets the identity constraint of the given name, or null if not found.
|
Map<String,XSIdentityConstraint> |
getIdentityConstraints()
Gets all the
XSIdentityConstraint s in this schema,
keyed by their names. |
Locator |
getLocator()
Gets the locator that indicates the source location where
this component is created from, or null if no information is
available.
|
XSModelGroupDecl |
getModelGroupDecl(String name) |
Map<String,XSModelGroupDecl> |
getModelGroupDecls()
Gets all the
XSModelGroupDecl s in this schema. |
XSNotation |
getNotation(String name) |
Map<String,XSNotation> |
getNotations()
Gets all the
XSNotation s in this schema. |
XSSchema |
getOwnerSchema()
Gets a reference to the
XSSchema object to which this component
belongs. |
SchemaSetImpl |
getRoot()
Gets the root schema set that includes this schema.
|
XSSimpleType |
getSimpleType(String name) |
Map<String,XSSimpleType> |
getSimpleTypes()
Gets all the
XSSimpleType s in this schema. |
SchemaDocument |
getSourceDocument()
Sine an
XSSchema is not necessarily defined in
one schema document (for example one schema can span across
many documents through <xs:include>s .),
so this method always returns null. |
String |
getTargetNamespace()
Gets the target namespace of the schema.
|
XSType |
getType(String name) |
Map<String,XSType> |
getTypes()
Gets all the
XSType s in this schema (union of
XSSchema.getSimpleTypes() and XSSchema.getComplexTypes() |
Iterator<XSAttGroupDecl> |
iterateAttGroupDecls() |
Iterator<XSAttributeDecl> |
iterateAttributeDecls() |
Iterator<XSComplexType> |
iterateComplexTypes() |
Iterator<XSElementDecl> |
iterateElementDecls() |
Iterator<XSModelGroupDecl> |
iterateModelGroupDecls() |
Iterator<XSNotation> |
iterateNotations() |
Iterator<XSSimpleType> |
iterateSimpleTypes() |
Iterator<XSType> |
iterateTypes() |
Collection<XSComponent> |
select(String scd,
NamespaceContext nsContext)
Evaluates a schema component designator against this schema component
and returns the resulting schema components.
|
XSComponent |
selectSingle(String scd,
NamespaceContext nsContext)
Evaluates a schema component designator against this schema component
and returns the first resulting schema component.
|
void |
setAnnotation(XSAnnotation a) |
void |
visit(XSVisitor visitor)
Accepts a visitor.
|
protected final SchemaSetImpl parent
public SchemaImpl(SchemaSetImpl _parent, Locator loc, String tns)
public SchemaDocument getSourceDocument()
XSSchema
XSSchema
is not necessarily defined in
one schema document (for example one schema can span across
many documents through <xs:include>s
.),
so this method always returns null.getSourceDocument
in interface XSComponent
getSourceDocument
in interface XSSchema
XSContentType
. This method also
returns null for XSSchema
.
For all other user-defined
components this method returns non-null, even if they are local.public SchemaSetImpl getRoot()
XSSchema
getRoot
in interface XSComponent
getRoot
in interface XSSchema
public String getTargetNamespace()
XSSchema
getTargetNamespace
in interface XSSchema
public XSSchema getOwnerSchema()
XSComponent
XSSchema
object to which this component
belongs.
In case of XSEmpty
component, this method
returns null since there is no owner component.
getOwnerSchema
in interface XSComponent
public void setAnnotation(XSAnnotation a)
public XSAnnotation getAnnotation()
XSComponent
getAnnotation
in interface XSComponent
public XSAnnotation getAnnotation(boolean createIfNotExist)
XSComponent
XSComponent.getAnnotation()
, but allow a new empty XSAnnotation
to be created
if not exist.getAnnotation
in interface XSComponent
createIfNotExist
- true to create a new XSAnnotation
if it doesn't exist already.
false to make this method behavel like XSComponent.getAnnotation()
.createIfNotExist==false
and annotation didn't exist.
Otherwise non-null.public Locator getLocator()
XSComponent
getLocator
in interface XSComponent
public void addAttributeDecl(XSAttributeDecl newDecl)
public Map<String,XSAttributeDecl> getAttributeDecls()
XSSchema
XSAttributeDecl
s in this schema
keyed by their local names.getAttributeDecls
in interface XSSchema
public XSAttributeDecl getAttributeDecl(String name)
getAttributeDecl
in interface XSSchema
public Iterator<XSAttributeDecl> iterateAttributeDecls()
iterateAttributeDecls
in interface XSSchema
public void addElementDecl(XSElementDecl newDecl)
public Map<String,XSElementDecl> getElementDecls()
XSSchema
XSElementDecl
s in this schema.getElementDecls
in interface XSSchema
public XSElementDecl getElementDecl(String name)
getElementDecl
in interface XSSchema
public Iterator<XSElementDecl> iterateElementDecls()
iterateElementDecls
in interface XSSchema
public void addAttGroupDecl(XSAttGroupDecl newDecl, boolean overwrite)
public Map<String,XSAttGroupDecl> getAttGroupDecls()
XSSchema
XSAttGroupDecl
s in this schema.getAttGroupDecls
in interface XSSchema
public XSAttGroupDecl getAttGroupDecl(String name)
getAttGroupDecl
in interface XSSchema
public Iterator<XSAttGroupDecl> iterateAttGroupDecls()
iterateAttGroupDecls
in interface XSSchema
public void addNotation(XSNotation newDecl)
public Map<String,XSNotation> getNotations()
XSSchema
XSNotation
s in this schema.getNotations
in interface XSSchema
public XSNotation getNotation(String name)
getNotation
in interface XSSchema
public Iterator<XSNotation> iterateNotations()
iterateNotations
in interface XSSchema
public void addModelGroupDecl(XSModelGroupDecl newDecl, boolean overwrite)
public Map<String,XSModelGroupDecl> getModelGroupDecls()
XSSchema
XSModelGroupDecl
s in this schema.getModelGroupDecls
in interface XSSchema
public XSModelGroupDecl getModelGroupDecl(String name)
getModelGroupDecl
in interface XSSchema
public Iterator<XSModelGroupDecl> iterateModelGroupDecls()
iterateModelGroupDecls
in interface XSSchema
protected void addIdentityConstraint(IdentityConstraintImpl c)
public Map<String,XSIdentityConstraint> getIdentityConstraints()
XSSchema
XSIdentityConstraint
s in this schema,
keyed by their names.getIdentityConstraints
in interface XSSchema
public XSIdentityConstraint getIdentityConstraint(String localName)
XSSchema
getIdentityConstraint
in interface XSSchema
public void addSimpleType(XSSimpleType newDecl, boolean overwrite)
public Map<String,XSSimpleType> getSimpleTypes()
XSSchema
XSSimpleType
s in this schema.getSimpleTypes
in interface XSSchema
public XSSimpleType getSimpleType(String name)
getSimpleType
in interface XSSchema
public Iterator<XSSimpleType> iterateSimpleTypes()
iterateSimpleTypes
in interface XSSchema
public void addComplexType(XSComplexType newDecl, boolean overwrite)
public Map<String,XSComplexType> getComplexTypes()
XSSchema
XSComplexType
s in this schema.getComplexTypes
in interface XSSchema
public XSComplexType getComplexType(String name)
getComplexType
in interface XSSchema
public Iterator<XSComplexType> iterateComplexTypes()
iterateComplexTypes
in interface XSSchema
public Map<String,XSType> getTypes()
XSSchema
XSType
s in this schema (union of
XSSchema.getSimpleTypes()
and XSSchema.getComplexTypes()
public Iterator<XSType> iterateTypes()
iterateTypes
in interface XSSchema
public void visit(XSVisitor visitor)
XSComponent
visit
in interface XSComponent
public Object apply(XSFunction function)
XSComponent
apply
in interface XSComponent
public void addForeignAttributes(ForeignAttributesImpl fa)
public List<ForeignAttributes> getForeignAttributes()
XSComponent
In general, a schema component may match multiple elements in a schema document, and those elements can individually carry foreign attributes.
This method returns a list of ForeignAttributes
, where
each ForeignAttributes
object represent foreign attributes
on one element.
getForeignAttributes
in interface XSComponent
public String getForeignAttribute(String nsUri, String localName)
XSComponent
If multiple occurences of the same attribute is found, this method returns the first one.
getForeignAttribute
in interface XSComponent
XSComponent.getForeignAttributes()
public Collection<XSComponent> select(String scd, NamespaceContext nsContext)
XSComponent
select
in interface XSComponent
scd
- Schema component designator. See SCD
for more details.nsContext
- The namespace context in which SCD is evaluated. Cannot be null.public XSComponent selectSingle(String scd, NamespaceContext nsContext)
XSComponent
selectSingle
in interface XSComponent
scd
- Schema component designator. See SCD
for more details.nsContext
- The namespace context in which SCD is evaluated. Cannot be null.Copyright © 2021 JBoss by Red Hat. All rights reserved.