org.jbind.xml.core.content
Interface IDataDesc

All Superinterfaces:
IDefaultTextContentProvider
All Known Subinterfaces:
IAttrDecl, IAttrDesc, IAttrRef, IAttrRefOrDecl, IAttrWildcard, IDataRefOrDecl, IElemDecl, IElemDesc, IElemRef, IElemRefOrDecl, IElemWildcard, IPartWildcard
All Known Implementing Classes:
AttrDecl, AttrDesc, AttrRef, AttrRefOrDecl, AttrWildcard, ElemDecl, ElemDesc, ElemRef, ElemRefOrDecl, ElemWildcard

public interface IDataDesc
extends IDefaultTextContentProvider

Description of an element or attribute. Part descriptions can either be attribute/element declarations, references to attribute/element declarations, or wildcard attributes/elements.

Part descriptions are used to create data objects, i.e. instantiate the the appropriate data classes, given a data implementation. The delegate the instantiation to their type and supply fixed/default values.


Method Summary
 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)
           
 ISimpleData getDefault()
          Gets the default value.
 ISimpleData getFixed()
          Gets the fixed value.
 IAnyType getType()
          Gets the data type.
 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.
 
Methods inherited from interface org.jbind.xml.core.bridge.IDefaultTextContentProvider
getDefaultTextContent
 

Method Detail

createData

public IAnyTypeData createData(IDataImpl anImpl,
                               IAnyType anOverloadingType)
                        throws XmlException
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.

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

createUncheckedData

public IAnyTypeData createUncheckedData(IDataImpl anImpl,
                                        IAnyType anOverloadingType)
                                 throws XmlException
Throws:
XmlException

createEmptyData

public IAnyTypeData createEmptyData(IDataImpl anImpl,
                                    IAnyType anOverloadingType)
                             throws XmlException
Throws:
XmlException

getType

public IAnyType getType()
Gets the data type.

Returns:
(required).

getDefault

public ISimpleData getDefault()
Gets the default value. If a fixed value is specified then it is also returned as the default value.

Returns:
(optional).

getFixed

public ISimpleData getFixed()
Gets the fixed value. If a fixed value is specified then it is also returned as the default value.

Returns:
(optional).

isActive

public boolean isActive(BlockType aBlockType)
Checks if the specified block type is active for the declaration.

Parameters:
aBlockType - (required).
Returns:
Returns true iff the specified block type is active.

isActive

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

Returns:
Returns true iff the specified block type is active.

checkValueConstraints

public void checkValueConstraints(IAnyTypeData aData)
                           throws XmlException
Throws:
XmlException