Package schema2template.model
Interface PuzzleComponent
-
- All Known Subinterfaces:
QNamedPuzzleComponent
- All Known Implementing Classes:
PuzzlePiece
,PuzzlePieceSet
public interface PuzzleComponent
The first purpose of this interface is to provide a kind of "piece of a puzzle" representing the key definitions of a schema and their relationship:- Element PuzzlePiece
- Attribute PuzzlePiece
- Attribute Value PuzzlePiece
- Attribute Datatype PuzzlePiece
The second purpose of this interface is to hide the differences between one definition and a Collection of definitions. By this you will be able to use single definitions and collections of definitions as method parameters. The method getCollection() is a helper method for this.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canHaveText()
Determines whether this PuzzleComponent allows a text node as child.PuzzlePieceSet
getAttributes()
ELEMENT PuzzlePiece only: Get all attribute DefinitionsPuzzlePieceSet
getChildElements()
ELEMENT PuzzlePiece only: Get all child element DefinitionsCollection<PuzzlePiece>
getCollection()
Method to treat NamedDefined as a Collection of PuzzlePiecePuzzlePieceSet
getDatatypes()
ATTRIBUTE PuzzlePiece only: Get all datatype DefinitionsPuzzlePieceSet
getParents()
Get all parent DefinitionsMSVExpressionType
getType()
Get type of PuzzlePiece [ELEMENT, ATTRIBUTE, VALUE, DATA]PuzzlePieceSet
getValues()
ATTRIBUTE PuzzlePiece only: Get all value Definitionsboolean
isSingleton(PuzzleComponent child)
Determines whether the child PuzzlePiece(s) is/are singleton(s)
-
-
-
Method Detail
-
getChildElements
PuzzlePieceSet getChildElements()
ELEMENT PuzzlePiece only: Get all child element Definitions- Returns:
- The child Definitions of this PuzzleComponent
-
getAttributes
PuzzlePieceSet getAttributes()
ELEMENT PuzzlePiece only: Get all attribute Definitions- Returns:
- The attribute Definitions of this PuzzleComponent
-
getDatatypes
PuzzlePieceSet getDatatypes()
ATTRIBUTE PuzzlePiece only: Get all datatype Definitions- Returns:
- The datatype Definitions of this PuzzleComponent
-
getValues
PuzzlePieceSet getValues()
ATTRIBUTE PuzzlePiece only: Get all value Definitions- Returns:
- The constant value Definitions of this PuzzleComponent
-
getParents
PuzzlePieceSet getParents()
Get all parent Definitions- Returns:
- The parent Definitions of this PuzzleComponent
-
getType
MSVExpressionType getType()
Get type of PuzzlePiece [ELEMENT, ATTRIBUTE, VALUE, DATA]- Returns:
- The type of this PuzzleComponent
-
canHaveText
boolean canHaveText()
Determines whether this PuzzleComponent allows a text node as child.- Returns:
- True if a text node is allowed, false otherwise
-
isSingleton
boolean isSingleton(PuzzleComponent child)
Determines whether the child PuzzlePiece(s) is/are singleton(s)Convention: If child is a collection this method returns false if one child element is no singleton. If this is a collection this method returns false if child is no singleton for one element of this.
- Parameters:
child
- PuzzleComponent child- Returns:
- True if child is defined as Singleton, falso otherwise.
-
getCollection
Collection<PuzzlePiece> getCollection()
Method to treat NamedDefined as a Collection of PuzzlePiece- Returns:
- Collection of PuzzlePiece objects
-
-