org.jbind.xml.schema.cmp
Class ElemDesc

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
      extended byorg.jbind.xml.schema.cmp.Content
          extended byorg.jbind.xml.schema.cmp.ElemDesc
All Implemented Interfaces:
IComponent, IContentDesc, IDataDesc, IDefaultTextContentProvider, IElemDesc, IHasBindingAttributes, IHasLocation, IHasRange, ISourceInfo
Direct Known Subclasses:
ElemRefOrDecl, ElemWildcard

public abstract class ElemDesc
extends Content
implements IElemDesc


Constructor Summary
ElemDesc(ISourceInfo aSourceInfo, java.lang.String aNamespace, java.lang.String aName, IRange aRange)
           
 
Method Summary
 boolean addToParent(IElemGroupDesc aParent)
          Recursively adds this content to the parent group.
 void checkValueConstraints(IAnyTypeData aData)
           
 IAnyTypeData createData(IDataImpl anImpl, IAnyType anOverloadingType)
          Creates a data object.
 IAnyTypeData createEmptyData(IDataImpl anImpl, IAnyType anOverloadingType)
           
 IAnyTypeData createUncheckedData(IDataImpl anImpl, IAnyType anOverloadingType)
           
 IUseState createUseStateProxy(IUseState aParent)
           
protected abstract  void doAddToParentWithNewRange(IRange aRange, IElemGroupDesc aParent)
           
 
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.content.IElemDesc
checkIdentityConstraints, isAbstract, isNillable
 
Methods inherited from interface org.jbind.xml.core.content.IContentDesc
collectElemDescs, createUseState, getDesc, getMaxOccurs, getMinOccurs, getRange, isEmptiable, isUnbounded, replaceSubstitutions
 
Methods inherited from interface org.jbind.xml.core.cmp.IComponent
accept, addSubComponent, getBindings, getGlobalRef, getName, getNamespace, getParentComponent, getSymbolspace, isAnonymous, isReference, 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.base.IHasRange
getRange
 
Methods inherited from interface org.jbind.xml.core.content.IDataDesc
getDefault, getFixed, getType, isActive, isActive
 
Methods inherited from interface org.jbind.xml.core.bridge.IDefaultTextContentProvider
getDefaultTextContent
 

Constructor Detail

ElemDesc

public ElemDesc(ISourceInfo aSourceInfo,
                java.lang.String aNamespace,
                java.lang.String aName,
                IRange aRange)
Method Detail

createData

public final IAnyTypeData createData(IDataImpl anImpl,
                                     IAnyType anOverloadingType)
                              throws XmlException
Description copied from interface: IDataDesc
Creates a data object. Delegates the creation of the data object to either the type of the declaration or to the overloading type.

If an overloading type is specified then it is checked if it is a valid overloading.

If the data implementation has no textual content and the declaration has a default value then the default value is used. If the declaration has a fixed value then the created data object is checked for the fixed value. In addition the created data object is marked as being fixed.

Specified by:
createData in interface IDataDesc
Parameters:
anImpl - (required).
anOverloadingType - (optional).
Returns:
(required).
Throws:
XmlException - Raised if no (locally) valid data object could have been created.

createUncheckedData

public final IAnyTypeData createUncheckedData(IDataImpl anImpl,
                                              IAnyType anOverloadingType)
                                       throws XmlException
Specified by:
createUncheckedData in interface IDataDesc
Throws:
XmlException

createEmptyData

public final IAnyTypeData createEmptyData(IDataImpl anImpl,
                                          IAnyType anOverloadingType)
                                   throws XmlException
Specified by:
createEmptyData in interface IDataDesc
Throws:
XmlException

checkValueConstraints

public final void checkValueConstraints(IAnyTypeData aData)
                                 throws XmlException
Specified by:
checkValueConstraints in interface IDataDesc
Throws:
XmlException

createUseStateProxy

public final IUseState createUseStateProxy(IUseState aParent)
Specified by:
createUseStateProxy in interface IContentDesc

addToParent

public boolean addToParent(IElemGroupDesc aParent)
Description copied from interface: IContentDesc
Recursively adds this content to the parent group. Pointless groups are removed.

Specified by:
addToParent in interface IContentDesc
Parameters:
aParent - (required). The group use to which this content is added.
Returns:
Returns true iff a pointless group was removed.

doAddToParentWithNewRange

protected abstract void doAddToParentWithNewRange(IRange aRange,
                                                  IElemGroupDesc aParent)