org.jbind.xml.schema.cmp
Class ElemDecl

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
      extended byorg.jbind.xml.schema.cmp.Content
          extended byorg.jbind.xml.schema.cmp.ElemDesc
              extended byorg.jbind.xml.schema.cmp.ElemRefOrDecl
                  extended byorg.jbind.xml.schema.cmp.ElemDecl
All Implemented Interfaces:
IComponent, IContentDesc, IDataDesc, IDataRefOrDecl, IDefaultTextContentProvider, IElemDecl, IElemDesc, IElemRefOrDecl, IHasBindingAttributes, IHasLocation, IHasRange, ISourceInfo

public class ElemDecl
extends ElemRefOrDecl
implements IElemDecl


Field Summary
 
Fields inherited from class org.jbind.xml.schema.cmp.ElemRefOrDecl
myDefault, myDefaultTextContent, myFixed
 
Constructor Summary
ElemDecl(ISourceInfo aSourceInfo, java.lang.String aNamespace, java.lang.String aName, IRange aRange, java.util.Set aFinalTypes, java.util.Set aBlockTypes, boolean anIsAbstract, boolean anIsNillable)
           
 
Method Summary
 void accept(IComponentVisitor aVisitor)
          Accepts a visitor.
 void addSubstitute(IElemDecl aDecl)
          Adds a declaration that can substitute this declaration.
 void addValueConstraints(java.lang.String aDefault, java.lang.String aFixed, IConstraintViolations aViolations)
           
 java.lang.String getDesc()
          Gets a description that is output if the content was not matched when an instance is read in.
 IElemRefOrDecl getSubstitute(java.lang.String aNamespace, java.lang.String aName)
          Gets an element declaration that can be substituted for this element declaration.
 IElemDecl getSubstitutionGroup()
           
 IAnyType getType()
          Gets the data type.
 boolean isAbstract()
           
 boolean isActive(BlockType aBlockType)
          Checks if the specified block type is active for the declaration.
 boolean isActive(FinalType aFinalType)
          Checks if the specified final type is active for the declaration.
 boolean isNillable()
           
 boolean isReference()
          Checks if this component is defined as a reference to another component.
 java.util.Iterator iterSubstitutes()
          Iterates the possible substitutes for this declaration.
 void setSubstitutionGroup(IElemDecl aContent)
           
 void setType(IAnyType aType)
           
 
Methods inherited from class org.jbind.xml.schema.cmp.ElemRefOrDecl
add, checkIdentityConstraints, collectElemDescs, createUseState, doAddToParentWithNewRange, getDefault, getDefaultTextContent, getFixed, getRange, getSymbolspace, iterIdentityConstraints, replaceSubstitutions, validate
 
Methods inherited from class org.jbind.xml.schema.cmp.ElemDesc
addToParent, checkValueConstraints, createData, createEmptyData, createUncheckedData, createUseStateProxy
 
Methods inherited from class org.jbind.xml.schema.cmp.Content
getMaxOccurs, getMinOccurs, getRange, isEmptiable, isUnbounded
 
Methods inherited from class org.jbind.xml.schema.cmp.Component
addSubComponent, getAnnotation, getBindingAttribute, getBindings, getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getGlobalRef, getLocalBindingAttribute, getLocalStringBindingAttribute, getLocation, getName, getNamespace, getParentComponent, getPrefixToNamespaceMapping, getStringBindingAttribute, isAnonymous, isTopLevelComponent, setBindings, setParentComponent, visitSubComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbind.xml.core.cmp.IComponent
addSubComponent, getBindings, getGlobalRef, getName, getNamespace, getParentComponent, getSymbolspace, isAnonymous, isTopLevelComponent, setBindings, setParentComponent, validate
 
Methods inherited from interface org.jbind.xml.core.cmp.ISourceInfo
getAnnotation, getPrefixToNamespaceMapping
 
Methods inherited from interface org.jbind.xml.base.IHasLocation
getLocation
 
Methods inherited from interface org.jbind.xml.base.IHasBindingAttributes
getBindingAttribute, getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getLocalBindingAttribute, getLocalStringBindingAttribute, getStringBindingAttribute
 
Methods inherited from interface org.jbind.xml.core.content.IDataDesc
checkValueConstraints, createData, createEmptyData, createUncheckedData, getDefault, getFixed
 
Methods inherited from interface org.jbind.xml.core.bridge.IDefaultTextContentProvider
getDefaultTextContent
 
Methods inherited from interface org.jbind.xml.core.content.IElemDesc
checkIdentityConstraints
 
Methods inherited from interface org.jbind.xml.core.content.IContentDesc
addToParent, collectElemDescs, createUseState, createUseStateProxy, getMaxOccurs, getMinOccurs, getRange, isEmptiable, isUnbounded, replaceSubstitutions
 
Methods inherited from interface org.jbind.xml.base.IHasRange
getRange
 

Constructor Detail

ElemDecl

public ElemDecl(ISourceInfo aSourceInfo,
                java.lang.String aNamespace,
                java.lang.String aName,
                IRange aRange,
                java.util.Set aFinalTypes,
                java.util.Set aBlockTypes,
                boolean anIsAbstract,
                boolean anIsNillable)
Method Detail

accept

public void accept(IComponentVisitor aVisitor)
            throws XmlException
Description copied from interface: IComponent
Accepts a visitor. The implementation calls the corresponding visitXXXStart and vistXXXEnd methods of the visitor (e.g. visitComplexTypeStart and visitComplexTypeEnd).

Specified by:
accept in interface IComponent
Parameters:
aVisitor - (required).
Throws:
XmlException

getDesc

public java.lang.String getDesc()
Description copied from interface: IContentDesc
Gets a description that is output if the content was not matched when an instance is read in.

Specified by:
getDesc in interface IContentDesc
Returns:
(required).

getType

public IAnyType getType()
Description copied from interface: IDataDesc
Gets the data type.

Specified by:
getType in interface IDataDesc
Returns:
(required).

setType

public void setType(IAnyType aType)

getSubstitutionGroup

public IElemDecl getSubstitutionGroup()
Specified by:
getSubstitutionGroup in interface IElemRefOrDecl

setSubstitutionGroup

public void setSubstitutionGroup(IElemDecl aContent)
Specified by:
setSubstitutionGroup in interface IElemDecl

isNillable

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

isAbstract

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

addSubstitute

public void addSubstitute(IElemDecl aDecl)
Description copied from interface: IElemDecl
Adds a declaration that can substitute this declaration. If the added declaration has a minOccurs or a maxOccurs that is different from 1 then a new IElemRef is created with its minOccurs and maxOccurs equal to one.

Specified by:
addSubstitute in interface IElemDecl
Parameters:
aDecl - (required). The substituting declaration.

getSubstitute

public IElemRefOrDecl getSubstitute(java.lang.String aNamespace,
                                    java.lang.String aName)
Description copied from interface: IElemRefOrDecl
Gets an element declaration that can be substituted for this element declaration.

Specified by:
getSubstitute in interface IElemRefOrDecl
Parameters:
aNamespace - (required). The namespace of the substituting declaration.
aName - (required). The name of the substituting declaration.
Returns:
(optional).

iterSubstitutes

public java.util.Iterator iterSubstitutes()
Description copied from interface: IElemRefOrDecl
Iterates the possible substitutes for this declaration.

Specified by:
iterSubstitutes in interface IElemRefOrDecl
Returns:
(required). An iterator of IElemRefOrDecl.

isActive

public boolean isActive(FinalType aFinalType)
Description copied from interface: IDataDesc
Checks if the specified final type is active for the declaration. Controls whether the declaration can be the head of a substitution group.

Specified by:
isActive in interface IDataDesc
Returns:
Returns true iff the specified block type is active.

isActive

public boolean isActive(BlockType aBlockType)
Description copied from interface: IDataDesc
Checks if the specified block type is active for the declaration.

Specified by:
isActive in interface IDataDesc
Parameters:
aBlockType - (required).
Returns:
Returns true iff the specified block type is active.

addValueConstraints

public void addValueConstraints(java.lang.String aDefault,
                                java.lang.String aFixed,
                                IConstraintViolations aViolations)
Specified by:
addValueConstraints in interface IDataRefOrDecl

isReference

public boolean isReference()
Description copied from interface: IComponent
Checks if this component is defined as a reference to another component.

Specified by:
isReference in interface IComponent
Returns:
Returns true iff this component is a reference to another component.