public class ElementDecl extends DeclarationImpl implements XSElementDecl, Ref.Term
Modifier and Type | Field and Description |
---|---|
private boolean |
_abstract |
private XmlString |
defaultValue |
private XmlString |
fixedValue |
private java.lang.Boolean |
form |
private java.util.List<XSIdentityConstraint> |
idConstraints |
private boolean |
nillable |
private int |
substDisallowed |
private int |
substExcluded |
private Ref.Element |
substHead |
private java.util.Set<XSElementDecl> |
substitutables
Set that represents element decls that can substitute this element.
|
private java.util.Set<XSElementDecl> |
substitutablesView
Unmodifieable view of
substitutables . |
private Ref.Type |
type |
ownerDocument
Constructor and Description |
---|
ElementDecl(PatcherManager reader,
SchemaDocumentImpl owner,
AnnotationImpl _annon,
org.xml.sax.Locator _loc,
ForeignAttributesImpl fa,
java.lang.String _tns,
java.lang.String _name,
boolean _anonymous,
XmlString _defv,
XmlString _fixedv,
boolean _nillable,
boolean _abstract,
java.lang.Boolean _form,
Ref.Type _type,
Ref.Element _substHead,
int _substDisallowed,
int _substExcluded,
java.util.List<IdentityConstraintImpl> idConstraints) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSubstitutable(ElementDecl decl) |
java.lang.Object |
apply(XSFunction function)
Accepts a functor.
|
java.lang.Object |
apply(XSTermFunction function) |
<T,P> T |
apply(XSTermFunctionWithParam<T,P> function,
P param) |
XSElementDecl |
asElementDecl() |
XSModelGroup |
asModelGroup() |
XSModelGroupDecl |
asModelGroupDecl() |
XSWildcard |
asWildcard() |
boolean |
canBeSubstitutedBy(XSElementDecl e)
Returns true if this element declaration can be validly substituted
by the given declaration.
|
XmlString |
getDefaultValue() |
XmlString |
getFixedValue() |
java.lang.Boolean |
getForm()
Used for javadoc schema generation
|
java.util.List<XSIdentityConstraint> |
getIdentityConstraints()
Returns all the
XSIdentityConstraint s in this element decl. |
XSElementDecl |
getSubstAffiliation()
Gets the substitution head of this element, if any.
|
java.util.Set<? extends XSElementDecl> |
getSubstitutables()
Returns the element declarations that can substitute
this element.
|
XSTerm |
getTerm()
Obtains a reference as a term.
|
XSType |
getType()
Gets the type of this element declaration.
|
boolean |
isAbstract() |
boolean |
isElementDecl() |
boolean |
isModelGroup() |
boolean |
isModelGroupDecl() |
boolean |
isNillable() |
boolean |
isSubstitutionDisallowed(int method)
Checks the diallowed substitution property of the schema component.
|
boolean |
isSubstitutionExcluded(int method)
Checks the substitution excluded property of the schema component.
|
boolean |
isWildcard() |
XSElementDecl[] |
listSubstitutables()
Deprecated.
|
void |
updateSubstitutabilityMap() |
void |
visit(XSTermVisitor visitor) |
void |
visit(XSVisitor visitor)
Accepts a visitor.
|
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle
private XmlString defaultValue
private XmlString fixedValue
private boolean nillable
private boolean _abstract
private Ref.Type type
private Ref.Element substHead
private int substDisallowed
private int substExcluded
private final java.util.List<XSIdentityConstraint> idConstraints
private java.lang.Boolean form
private java.util.Set<XSElementDecl> substitutables
private java.util.Set<XSElementDecl> substitutablesView
substitutables
.public ElementDecl(PatcherManager reader, SchemaDocumentImpl owner, AnnotationImpl _annon, org.xml.sax.Locator _loc, ForeignAttributesImpl fa, java.lang.String _tns, java.lang.String _name, boolean _anonymous, XmlString _defv, XmlString _fixedv, boolean _nillable, boolean _abstract, java.lang.Boolean _form, Ref.Type _type, Ref.Element _substHead, int _substDisallowed, int _substExcluded, java.util.List<IdentityConstraintImpl> idConstraints)
public XmlString getDefaultValue()
getDefaultValue
in interface XSElementDecl
public XmlString getFixedValue()
getFixedValue
in interface XSElementDecl
public boolean isNillable()
isNillable
in interface XSElementDecl
public boolean isAbstract()
isAbstract
in interface XSElementDecl
public XSType getType()
XSElementDecl
getType
in interface XSElementDecl
public XSElementDecl getSubstAffiliation()
XSElementDecl
getSubstAffiliation
in interface XSElementDecl
public boolean isSubstitutionDisallowed(int method)
XSElementDecl
block
attribute
(plus blockDefault
).isSubstitutionDisallowed
in interface XSElementDecl
method
- Possible values are XSType.EXTENSION
,
XSType.RESTRICTION
, or XSType.SUBSTITUTION
public boolean isSubstitutionExcluded(int method)
XSElementDecl
final
attribute
(plus finalDefault
).isSubstitutionExcluded
in interface XSElementDecl
method
- Possible values are XSType.EXTENSION
or
XSType.RESTRICTION
.public java.util.List<XSIdentityConstraint> getIdentityConstraints()
XSElementDecl
XSIdentityConstraint
s in this element decl.getIdentityConstraints
in interface XSElementDecl
public java.lang.Boolean getForm()
XSElementDecl
getForm
in interface XSElementDecl
public XSElementDecl[] listSubstitutables()
XSElementDecl
IOW, this set returns all the element decls that satisfies the "Substitution Group OK" constraint.
listSubstitutables
in interface XSElementDecl
public java.util.Set<? extends XSElementDecl> getSubstitutables()
XSElementDecl
IOW, this set returns all the element decls that satisfies the "Substitution Group OK" constraint.
Note that the above clause does NOT check for abstract elements. So abstract elements may still show up in the returned set.
getSubstitutables
in interface XSElementDecl
protected void addSubstitutable(ElementDecl decl)
public void updateSubstitutabilityMap()
public boolean canBeSubstitutedBy(XSElementDecl e)
XSElementDecl
Just a short cut of getSubstitutables().contain(e);
canBeSubstitutedBy
in interface XSElementDecl
public boolean isWildcard()
isWildcard
in interface XSTerm
public boolean isModelGroupDecl()
isModelGroupDecl
in interface XSTerm
public boolean isModelGroup()
isModelGroup
in interface XSTerm
public boolean isElementDecl()
isElementDecl
in interface XSTerm
public XSWildcard asWildcard()
asWildcard
in interface XSTerm
public XSModelGroupDecl asModelGroupDecl()
asModelGroupDecl
in interface XSTerm
public XSModelGroup asModelGroup()
asModelGroup
in interface XSTerm
public XSElementDecl asElementDecl()
asElementDecl
in interface XSTerm
public void visit(XSVisitor visitor)
XSComponent
visit
in interface XSComponent
public void visit(XSTermVisitor visitor)
public java.lang.Object apply(XSTermFunction function)
public <T,P> T apply(XSTermFunctionWithParam<T,P> function, P param)
public java.lang.Object apply(XSFunction function)
XSComponent
apply
in interface XSComponent