XSOM 20110809-redhat-3

com.sun.xml.xsom.impl
Class ElementDecl

java.lang.Object
  extended by com.sun.xml.xsom.impl.ComponentImpl
      extended by com.sun.xml.xsom.impl.ElementDecl
All Implemented Interfaces:
Ref.Term, XSComponent, XSDeclaration, XSElementDecl, XSTerm

public class ElementDecl
extends ComponentImpl
implements XSElementDecl, Ref.Term


Field Summary
 
Fields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocument
 
Constructor Summary
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 Summary
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 XSIdentityConstraints 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.
 
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.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
 
Methods inherited from interface com.sun.xml.xsom.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle
 

Constructor Detail

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 Detail

getDefaultValue

public XmlString getDefaultValue()
Specified by:
getDefaultValue in interface XSElementDecl

getFixedValue

public XmlString getFixedValue()
Specified by:
getFixedValue in interface XSElementDecl

isNillable

public boolean isNillable()
Specified by:
isNillable in interface XSElementDecl

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface XSElementDecl

getType

public XSType getType()
Description copied from interface: XSElementDecl
Gets the type of this element declaration.

Specified by:
getType in interface XSElementDecl
Returns:
always non-null.

getSubstAffiliation

public XSElementDecl getSubstAffiliation()
Description copied from interface: XSElementDecl
Gets the substitution head of this element, if any. Otherwise null.

Specified by:
getSubstAffiliation in interface XSElementDecl

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 the block attribute (plus blockDefault).

Specified by:
isSubstitutionDisallowed in interface XSElementDecl
Parameters:
method - Possible values are XSType.EXTENSION, XSType.RESTRICTION, or XSType.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 the final attribute (plus finalDefault).

Specified by:
isSubstitutionExcluded in interface XSElementDecl
Parameters:
method - Possible values are XSType.EXTENSION or XSType.RESTRICTION.

getIdentityConstraints

public List<XSIdentityConstraint> getIdentityConstraints()
Description copied from interface: XSElementDecl
Returns all the XSIdentityConstraints in this element decl.

Specified by:
getIdentityConstraints in interface XSElementDecl
Returns:
never null, but can be empty.

getForm

public Boolean getForm()
Description copied from interface: XSElementDecl
Used for javadoc schema generation

Specified by:
getForm in interface XSElementDecl
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

public XSElementDecl[] 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 interface XSElementDecl
Returns:
nun-null valid array. The return value always contains this element decl itself.

getSubstitutables

public Set<? extends XSElementDecl> 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 interface XSElementDecl
Returns:
nun-null unmodifiable list. The returned list always contains this element decl itself.

addSubstitutable

protected void addSubstitutable(ElementDecl decl)

updateSubstitutabilityMap

public void updateSubstitutabilityMap()

canBeSubstitutedBy

public boolean canBeSubstitutedBy(XSElementDecl e)
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 interface XSElementDecl

isWildcard

public boolean isWildcard()
Specified by:
isWildcard in interface XSTerm

isModelGroupDecl

public boolean isModelGroupDecl()
Specified by:
isModelGroupDecl in interface XSTerm

isModelGroup

public boolean isModelGroup()
Specified by:
isModelGroup in interface XSTerm

isElementDecl

public boolean isElementDecl()
Specified by:
isElementDecl in interface XSTerm

asWildcard

public XSWildcard asWildcard()
Specified by:
asWildcard in interface XSTerm

asModelGroupDecl

public XSModelGroupDecl asModelGroupDecl()
Specified by:
asModelGroupDecl in interface XSTerm

asModelGroup

public XSModelGroup asModelGroup()
Specified by:
asModelGroup in interface XSTerm

asElementDecl

public XSElementDecl asElementDecl()
Specified by:
asElementDecl in interface XSTerm

visit

public void visit(XSVisitor visitor)
Description copied from interface: XSComponent
Accepts a visitor.

Specified by:
visit in interface XSComponent

visit

public void visit(XSTermVisitor visitor)
Specified by:
visit in interface XSTerm

apply

public Object apply(XSTermFunction function)
Specified by:
apply in interface XSTerm

apply

public <T,P> T apply(XSTermFunctionWithParam<T,P> function,
                     P param)
Specified by:
apply in interface XSTerm

apply

public Object apply(XSFunction function)
Description copied from interface: XSComponent
Accepts a functor.

Specified by:
apply in interface XSComponent

getTerm

public XSTerm getTerm()
Description copied from interface: Ref.Term
Obtains a reference as a term.

Specified by:
getTerm in interface Ref.Term

getName

public String getName()
Description copied from interface: XSDeclaration
Gets the (local) name of the declaration.

Specified by:
getName in interface XSDeclaration
Returns:
null if this component is anonymous.

getTargetNamespace

public String 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 interface XSDeclaration

isAnonymous

public boolean isAnonymous()
Deprecated. 

Specified by:
isAnonymous in interface XSDeclaration

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 interface XSDeclaration

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 interface XSDeclaration

XSOM 20110809-redhat-3

Copyright © 2012 Oracle. All Rights Reserved.