public class AstModel extends AstConcreteClafer
The Clafer model. Also acts as the implicit "root" Clafer which nests above the top most Clafers.
For example:
abstract Feature
Cost -> integer
Database : Feature
Although the model is written syntactically like above, its
representation internally is more like:
#root#
abstract Feature
Cost -> integer
Database : Feature
#root# is represented by this class.
claferClafer| Modifier and Type | Method and Description |
|---|---|
AstAbstractClafer |
addAbstract(String name)
Add a new abstract Clafer to the model.
|
AstModel |
extending(AstAbstractClafer superClafer)
Set the supertype of this Clafer.
|
List<AstAbstractClafer> |
getAbstracts()
Returns all the abstract Clafers
|
AstAbstractClafer |
getTypeHierarchyRoot()
Returns the type every non-primitive type extends from.
|
AstModel |
refTo(AstClafer targetType)
Set this Clafer's reference to target type.
|
AstModel |
refToUnique(AstClafer targetType)
Set this Clafer's reference to target type along with a uniqueness
constraint.
|
AstConcreteClafer |
withCard(Card card)
Set this Clafer's cardinality.
|
AstModel |
withGroupCard(Card groupCard)
Set this Clafer's group cardinality.
|
getCard, getParent, hasParent, withCard, withCard, withGroupCard, withGroupCardaddChild, addConstraint, equals, getChildren, getConstraints, getGroupCard, getName, getRef, getSuperClafer, hasChildren, hasConstraints, hashCode, hasRef, hasSuperClafer, toStringpublic AstAbstractClafer getTypeHierarchyRoot()
public List<AstAbstractClafer> getAbstracts()
public AstAbstractClafer addAbstract(String name)
name - the name of the abtract Claferpublic AstModel extending(AstAbstractClafer superClafer)
AstConcreteClaferextending in class AstConcreteClafersuperClafer - the supertypepublic AstModel refTo(AstClafer targetType)
AstConcreteClaferrefTo in class AstConcreteClafertargetType - the type to refer topublic AstModel refToUnique(AstClafer targetType)
AstConcreteClaferrefToUnique in class AstConcreteClafertargetType - the type to refer topublic AstConcreteClafer withCard(Card card)
AstConcreteClaferwithCard in class AstConcreteClafercard - the cardinalitypublic AstModel withGroupCard(Card groupCard)
AstConcreteClaferwithGroupCard in class AstConcreteClafergroupCard - the group cardinalityCopyright © 2013. All Rights Reserved.