Class ElementDecl
java.lang.Object
com.sun.xml.xsom.impl.ComponentImpl
com.sun.xml.xsom.impl.DeclarationImpl
com.sun.xml.xsom.impl.ElementDecl
- All Implemented Interfaces:
Ref.Term, XSComponent, XSDeclaration, XSElementDecl, XSTerm
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate XmlStringprivate XmlStringprivate Booleanprivate final List<XSIdentityConstraint> private booleanprivate intprivate intprivate Ref.Elementprivate Set<XSElementDecl> Set that represents element decls that can substitute this element.private Set<XSElementDecl> Unmodifieable view ofsubstitutables.private Ref.TypeFields inherited from class ComponentImpl
ownerDocument -
Constructor Summary
ConstructorsConstructorDescriptionElementDecl(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 voidaddSubstitutable(ElementDecl decl) apply(XSFunction function) Accepts a functor.apply(XSTermFunction function) <T,P> T apply(XSTermFunctionWithParam<T, P> function, P param) booleanReturns true if this element declaration can be validly substituted by the given declaration.getForm()Used for javadoc schema generationReturns all theXSIdentityConstraints in this element decl.Gets the substitution head of this element, if any.Set<? extends XSElementDecl> Returns the element declarations that can substitute this element.getTerm()Obtains a reference as a term.getType()Gets the type of this element declaration.booleanbooleanbooleanbooleanbooleanbooleanisSubstitutionDisallowed(int method) Checks the diallowed substitution property of the schema component.booleanisSubstitutionExcluded(int method) Checks the substitution excluded property of the schema component.booleanDeprecated.voidvoidvisit(XSTermVisitor visitor) voidAccepts a visitor.Methods inherited from class DeclarationImpl
getName, getTargetNamespace, isAnonymous, isGlobal, isLocalMethods inherited from class ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingleMethods inherited from interface XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Field Details
-
defaultValue
-
fixedValue
-
nillable
private boolean nillable -
_abstract
private boolean _abstract -
type
-
substHead
-
substDisallowed
private int substDisallowed -
substExcluded
private int substExcluded -
idConstraints
-
form
-
substitutables
Set that represents element decls that can substitute this element. -
substitutablesView
Unmodifieable view ofsubstitutables.
-
-
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:
getDefaultValuein interfaceXSElementDecl
-
getFixedValue
- Specified by:
getFixedValuein interfaceXSElementDecl
-
isNillable
public boolean isNillable()- Specified by:
isNillablein interfaceXSElementDecl
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstractin interfaceXSElementDecl
-
getType
Description copied from interface:XSElementDeclGets the type of this element declaration.- Specified by:
getTypein interfaceXSElementDecl- Returns:
- always non-null.
-
getSubstAffiliation
Description copied from interface:XSElementDeclGets the substitution head of this element, if any. Otherwise null.- Specified by:
getSubstAffiliationin interfaceXSElementDecl
-
isSubstitutionDisallowed
public boolean isSubstitutionDisallowed(int method) Description copied from interface:XSElementDeclChecks the diallowed substitution property of the schema component. IOW, this checks the value of theblockattribute (plusblockDefault).- Specified by:
isSubstitutionDisallowedin interfaceXSElementDecl- Parameters:
method- Possible values areXSType.EXTENSION,XSType.RESTRICTION, orXSType.SUBSTITUTION
-
isSubstitutionExcluded
public boolean isSubstitutionExcluded(int method) Description copied from interface:XSElementDeclChecks the substitution excluded property of the schema component. IOW, this checks the value of thefinalattribute (plusfinalDefault).- Specified by:
isSubstitutionExcludedin interfaceXSElementDecl- Parameters:
method- Possible values areXSType.EXTENSIONorXSType.RESTRICTION.
-
getIdentityConstraints
Description copied from interface:XSElementDeclReturns all theXSIdentityConstraints in this element decl.- Specified by:
getIdentityConstraintsin interfaceXSElementDecl- Returns:
- never null, but can be empty.
-
getForm
Description copied from interface:XSElementDeclUsed for javadoc schema generation- Specified by:
getFormin 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:XSElementDeclReturns 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:
listSubstitutablesin interfaceXSElementDecl- Returns:
- nun-null valid array. The return value always contains this element decl itself.
-
getSubstitutables
Description copied from interface:XSElementDeclReturns 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:
getSubstitutablesin 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:XSElementDeclReturns true if this element declaration can be validly substituted by the given declaration.Just a short cut of getSubstitutables().contain(e);
- Specified by:
canBeSubstitutedByin interfaceXSElementDecl
-
isWildcard
public boolean isWildcard()- Specified by:
isWildcardin interfaceXSTerm
-
isModelGroupDecl
public boolean isModelGroupDecl()- Specified by:
isModelGroupDeclin interfaceXSTerm
-
isModelGroup
public boolean isModelGroup()- Specified by:
isModelGroupin interfaceXSTerm
-
isElementDecl
public boolean isElementDecl()- Specified by:
isElementDeclin interfaceXSTerm
-
asWildcard
- Specified by:
asWildcardin interfaceXSTerm
-
asModelGroupDecl
- Specified by:
asModelGroupDeclin interfaceXSTerm
-
asModelGroup
- Specified by:
asModelGroupin interfaceXSTerm
-
asElementDecl
- Specified by:
asElementDeclin interfaceXSTerm
-
visit
Description copied from interface:XSComponentAccepts a visitor.- Specified by:
visitin interfaceXSComponent
-
visit
-
apply
-
apply
-
apply
Description copied from interface:XSComponentAccepts a functor.- Specified by:
applyin interfaceXSComponent
-
getTerm
-