Package com.sun.xml.xsom.impl
Class ElementDecl
java.lang.Object
com.sun.xml.xsom.impl.ComponentImpl
com.sun.xml.xsom.impl.ElementDecl
- All Implemented Interfaces:
Ref.Term
,XSComponent
,XSDeclaration
,XSElementDecl
,XSTerm
-
Field Summary
Fields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocument
-
Constructor Summary
ConstructorDescriptionElementDecl
(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) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSubstitutable
(ElementDecl decl) apply
(XSFunction function) Accepts a functor.apply
(XSTermFunction function) <T,
P> T apply
(XSTermFunctionWithParam<T, P> function, P param) boolean
Returns true if this element declaration can be validly substituted by the given declaration.getForm()
Used for javadoc schema generationReturns all theXSIdentityConstraint
s in this element decl.getName()
Gets the (local) name of the declaration.Gets the substitution head of this element, if any.Set<? extends XSElementDecl>
Returns the element declarations that can substitute this element.Target namespace to which this component belongs.getTerm()
Obtains a reference as a term.getType()
Gets the type of this element declaration.boolean
boolean
Deprecated.boolean
final boolean
isGlobal()
Returns true if this declaration is a global declaration.final boolean
isLocal()
Returns true if this declaration is a local declaration.boolean
boolean
boolean
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
Deprecated.void
void
visit
(XSTermVisitor visitor) void
Accepts a visitor.Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sun.xml.xsom.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle
Methods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Constructor Details
-
ElementDecl
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)
-
-
Method Details
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceXSElementDecl
-
getFixedValue
- Specified by:
getFixedValue
in interfaceXSElementDecl
-
isNillable
public boolean isNillable()- Specified by:
isNillable
in interfaceXSElementDecl
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in interfaceXSElementDecl
-
getType
Description copied from interface:XSElementDecl
Gets the type of this element declaration.- Specified by:
getType
in interfaceXSElementDecl
- Returns:
- always non-null.
-
getSubstAffiliation
Description copied from interface:XSElementDecl
Gets the substitution head of this element, if any. Otherwise null.- Specified by:
getSubstAffiliation
in interfaceXSElementDecl
-
isSubstitutionDisallowed
public boolean isSubstitutionDisallowed(int method) Description copied from interface:XSElementDecl
Checks the diallowed substitution property of the schema component. IOW, this checks the value of theblock
attribute (plusblockDefault
).- Specified by:
isSubstitutionDisallowed
in interfaceXSElementDecl
- Parameters:
method
- Possible values areXSType.EXTENSION
,XSType.RESTRICTION
, orXSType.SUBSTITUTION
-
isSubstitutionExcluded
public boolean isSubstitutionExcluded(int method) Description copied from interface:XSElementDecl
Checks the substitution excluded property of the schema component. IOW, this checks the value of thefinal
attribute (plusfinalDefault
).- Specified by:
isSubstitutionExcluded
in interfaceXSElementDecl
- Parameters:
method
- Possible values areXSType.EXTENSION
orXSType.RESTRICTION
.
-
getIdentityConstraints
Description copied from interface:XSElementDecl
Returns all theXSIdentityConstraint
s in this element decl.- Specified by:
getIdentityConstraints
in interfaceXSElementDecl
- Returns:
- never null, but can be empty.
-
getForm
Description copied from interface:XSElementDecl
Used for javadoc schema generation- Specified by:
getForm
in interfaceXSElementDecl
- Returns:
- null if form attribute not present, true if form attribute present and set to qualified, false if form attribute present and set to unqualified.
-
listSubstitutables
Deprecated.Description copied from interface:XSElementDecl
Returns the element declarations that can substitute this element.IOW, this set returns all the element decls that satisfies the "Substitution Group OK" constraint.
- Specified by:
listSubstitutables
in interfaceXSElementDecl
- Returns:
- nun-null valid array. The return value always contains this element decl itself.
-
getSubstitutables
Description copied from interface:XSElementDecl
Returns the element declarations that can substitute this element.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.
- Specified by:
getSubstitutables
in interfaceXSElementDecl
- Returns:
- nun-null unmodifiable list. The returned list always contains this element decl itself.
-
addSubstitutable
-
updateSubstitutabilityMap
public void updateSubstitutabilityMap() -
canBeSubstitutedBy
Description copied from interface:XSElementDecl
Returns true if this element declaration can be validly substituted by the given declaration.Just a short cut of
getSubstitutables().contain(e);
- Specified by:
canBeSubstitutedBy
in interfaceXSElementDecl
-
isWildcard
public boolean isWildcard()- Specified by:
isWildcard
in interfaceXSTerm
-
isModelGroupDecl
public boolean isModelGroupDecl()- Specified by:
isModelGroupDecl
in interfaceXSTerm
-
isModelGroup
public boolean isModelGroup()- Specified by:
isModelGroup
in interfaceXSTerm
-
isElementDecl
public boolean isElementDecl()- Specified by:
isElementDecl
in interfaceXSTerm
-
asWildcard
- Specified by:
asWildcard
in interfaceXSTerm
-
asModelGroupDecl
- Specified by:
asModelGroupDecl
in interfaceXSTerm
-
asModelGroup
- Specified by:
asModelGroup
in interfaceXSTerm
-
asElementDecl
- Specified by:
asElementDecl
in interfaceXSTerm
-
visit
Description copied from interface:XSComponent
Accepts a visitor.- Specified by:
visit
in interfaceXSComponent
-
visit
-
apply
-
apply
-
apply
Description copied from interface:XSComponent
Accepts a functor.- Specified by:
apply
in interfaceXSComponent
-
getTerm
Description copied from interface:Ref.Term
Obtains a reference as a term. -
getName
Description copied from interface:XSDeclaration
Gets the (local) name of the declaration.- Specified by:
getName
in interfaceXSDeclaration
- Returns:
- null if this component is anonymous.
-
getTargetNamespace
Description copied from interface:XSDeclaration
Target namespace to which this component belongs.""
is used to represent the default no namespace.- Specified by:
getTargetNamespace
in interfaceXSDeclaration
-
isAnonymous
public boolean isAnonymous()Deprecated.- Specified by:
isAnonymous
in interfaceXSDeclaration
-
isGlobal
public final boolean isGlobal()Description copied from interface:XSDeclaration
Returns true if this declaration is a global declaration. Global declarations are those declaration that can be enumerated through the schema object.- Specified by:
isGlobal
in interfaceXSDeclaration
-
isLocal
public final boolean isLocal()Description copied from interface:XSDeclaration
Returns true if this declaration is a local declaration. Equivalent of!isGlobal()
- Specified by:
isLocal
in interfaceXSDeclaration
-