public class ElementDecl extends ComponentImpl implements XSElementDecl, Ref.Term
ownerDocument
Constructor and Description |
---|
ElementDecl(PatcherManager reader,
SchemaDocumentImpl owner,
AnnotationImpl _annon,
Locator _loc,
ForeignAttributesImpl fa,
String _tns,
String _name,
boolean _anonymous,
XmlString _defv,
XmlString _fixedv,
boolean _nillable,
boolean _abstract,
Boolean _form,
Ref.Type _type,
Ref.Element _substHead,
int _substDisallowed,
int _substExcluded,
List<IdentityConstraintImpl> idConstraints) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSubstitutable(ElementDecl decl) |
Object |
apply(XSFunction function)
Accepts a functor.
|
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() |
Boolean |
getForm()
Used for javadoc schema generation
|
List<XSIdentityConstraint> |
getIdentityConstraints()
Returns all the
XSIdentityConstraint s in this element decl. |
String |
getName()
Gets the (local) name of the declaration.
|
XSElementDecl |
getSubstAffiliation()
Gets the substitution head of this element, if any.
|
Set<? extends XSElementDecl> |
getSubstitutables()
Returns the element declarations that can substitute
this element.
|
String |
getTargetNamespace()
Target namespace to which this component belongs.
|
XSTerm |
getTerm()
Obtains a reference as a term.
|
XSType |
getType()
Gets the type of this element declaration.
|
boolean |
isAbstract() |
boolean |
isAnonymous()
Deprecated.
|
boolean |
isElementDecl() |
boolean |
isGlobal()
Returns true if this declaration is a global declaration.
|
boolean |
isLocal()
Returns true if this declaration is a local declaration.
|
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.
|
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
public ElementDecl(PatcherManager reader, SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa, String _tns, String _name, boolean _anonymous, XmlString _defv, XmlString _fixedv, boolean _nillable, boolean _abstract, Boolean _form, Ref.Type _type, Ref.Element _substHead, int _substDisallowed, int _substExcluded, 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 List<XSIdentityConstraint> getIdentityConstraints()
XSElementDecl
XSIdentityConstraint
s in this element decl.getIdentityConstraints
in interface XSElementDecl
public 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 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 Object apply(XSTermFunction function)
public <T,P> T apply(XSTermFunctionWithParam<T,P> function, P param)
public Object apply(XSFunction function)
XSComponent
apply
in interface XSComponent
public XSTerm getTerm()
Ref.Term
public String getName()
XSDeclaration
getName
in interface XSDeclaration
public String getTargetNamespace()
XSDeclaration
""
is used to represent the default no namespace.getTargetNamespace
in interface XSDeclaration
public boolean isAnonymous()
isAnonymous
in interface XSDeclaration
public final boolean isGlobal()
XSDeclaration
isGlobal
in interface XSDeclaration
public final boolean isLocal()
XSDeclaration
!isGlobal()
isLocal
in interface XSDeclaration
Copyright © 2021 JBoss by Red Hat. All rights reserved.