schema2template.model
Interface QNamedPuzzleComponent

All Superinterfaces:
PuzzleComponent, QNamed
All Known Implementing Classes:
PuzzlePiece, PuzzlePieceSet

public interface QNamedPuzzleComponent
extends QNamed, PuzzleComponent

By using this interface you declare that:


Method Summary
 boolean isMandatory(QNamedPuzzleComponent child)
          ELEMENT Definition only: Determine solely by child type and name whether child is mandatory.
 
Methods inherited from interface schema2template.model.QNamed
getLocalName, getNamespace, getQName
 
Methods inherited from interface schema2template.model.PuzzleComponent
canHaveText, getAttributes, getChildElements, getCollection, getDatatypes, getParents, getType, getValues, isSingleton
 

Method Detail

isMandatory

boolean isMandatory(QNamedPuzzleComponent child)
ELEMENT Definition only: Determine solely by child type and name whether child is mandatory.

Here's why we're not using the child Definition object(s) for this: An element often has a mandatory attribute, but two (or more) different content definitions for this attribute. This is done by defining this attribute twice and creating a CHOICE between both Definitions. If you'd ask whether one of these definitions is mandatory, you'd always get false as answer as you have the choice between the two definitions. Mostly this is not the answer you're looking for.

Contract: If 'this' is a Collection, mandatory means mandatory for one member of 'this'.

Parameters:
child - The child Definition(s) of type ELEMENT or ATTRIBUTE
Returns:
true if child is a defined child of this and if it's mandatory. False otherwise.


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.