|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.check.types.xmifacade.Model
Implements ModelFacade using model information of a xmi file. The actual Model object can be in one of two modes. In the first mode, called "not rough", the Model has flattened generalization relationships and dissolved associations. In the second mode, called "rough", the Model's generalizations relationships are not flattened and the associations are not dissolved. This mode enables the user of the Model to query the object oriented information from a more structural point of view. Additional notes: An attribute overrides an inherited attribute, if and and only if it has the same name. Ordinary attributes and attributes generated by association partner role names are handled equally. If an ambiguity is caused by this behaviour, the attribute name is marked to be ambiguious for this class, and cannot be used for OCL any more (see OCL spec 5.4.1). This ambiguity is inherited to all classes, which do not override this attribute name. However, overriding such an ambiguious attribute in a subclass makes this attribute available for the subclass and its subclasses again. Overriding attributes is considered to be unnormal, and issues a warning to standard out. An operation overrides an inherited operation, if and only if it has the same signature. The signature consist of the name and a vector of parameter types. Note, that parameter types must be exactly equal. Matching by inheritance is not enough. Overriding an operation with a different return type is considered to be unnormal, and issues a warning to standard out. If you dont like the warnings, edit ModelClass.flatten for your needs.
flatten()
Field Summary | |
static Any |
AMBIGOUS
Indicates, that a ModelAttribute is ambiguiuos, thus cannot be used in OCL. |
private HashSet |
associations
Set of associations in the model. |
private HashMap |
classifiers
Maps classifier names to ModelClass objects. |
private String |
description
A description of the source of this model. |
private boolean |
roughMode
Flag for the distinction of rough and ordinary models. |
Constructor Summary | |
Model(String description)
|
Method Summary | |
Set |
associations()
|
Map |
classifiers()
|
void |
determineAllSupertypes()
This methode will be called instead of flatten if the model is rough. |
void |
flatten()
Flattens all classes in model. |
Any |
getClassifier(String name)
|
Set |
getDirectClassSubtypes(ModelClass mc)
This methode determines all direct subtypes of a given class in the model. |
boolean |
isRough()
|
void |
printData(PrintStream o)
Useful for debugging. |
void |
putAssociation(ModelAssociation association)
|
void |
putClassifier(ModelClass modelclass)
|
void |
setRoughMode(boolean roughMode)
|
static String |
strip(String x)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private HashMap classifiers
ModelClass
private String description
private boolean roughMode
private HashSet associations
public static final Any AMBIGOUS
ModelAttribute
Constructor Detail |
public Model(String description)
Method Detail |
public void flatten()
public void printData(PrintStream o)
public void putClassifier(ModelClass modelclass)
public static String strip(String x)
public Any getClassifier(String name)
getClassifier
in interface ModelFacade
name
- the name of an application type (not the name of a predefined
type, like "Integer"), possibly a "::"-separated
path namepublic String toString()
public void setRoughMode(boolean roughMode)
roughMode
- true if the model is flattend and dissolved, false otherwisepublic boolean isRough()
public void putAssociation(ModelAssociation association) throws IllegalStateException
association
- an association
IllegalStateException
- if the model is not in rough modepublic Map classifiers()
public Set associations() throws IllegalStateException
IllegalStateException
- if the model is not in rough modepublic void determineAllSupertypes() throws IllegalStateException
IllegalStateException
- if the model is not in rough modepublic Set getDirectClassSubtypes(ModelClass mc) throws IllegalArgumentException
mc
- the class
IllegalArgumentException
- if the class is not contained within this model
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |