diff --git a/doc/ceg-infer.xml b/doc/ceg-infer.xml new file mode 100644 index 0000000..01bfc34 --- /dev/null +++ b/doc/ceg-infer.xml @@ -0,0 +1,49 @@ + + + + +
+ +import java.util.List; +import java.util.Map; +import java.util.ArrayList; +import java.util.Arrays; + +/** + * @opt inferrel + * @opt collpackages java.util.* + * @opt inferdep + * @opt hide java.* + * @hidden + */ +class UMLOptions {} + +class Person { + House[] houses; + List dogs; + + public Room getFavouriteRoom(House house) {} +} + +/** + * @opt inferreltype composed + */ +class House { + Map nameRoomMap; +} + +class Room {} + +class Dog { + Person owner; +} + + + +UML diagram with relationship inference +
+ +

In this diagram we enabled both relationship and dependency inference.
+To make sure Person.dogs and Person.friends are interpreted as one to many relationship +the collpackage option has to be specified. + diff --git a/doc/index.xml b/doc/index.xml index 83133fd..03edd9d 100644 --- a/doc/index.xml +++ b/doc/index.xml @@ -8,6 +8,7 @@ Class Diagram Optionscd-opt Class Diagram Example: Generalisation Relationshipsceg-gen Class Diagram Example: Advanced Relationshipsceg-adv +Class Diagram Example: Relationships Inferenceceg-infer Class Diagram Example: Schemaceg-schema Class Diagram Example: Element Visibilityceg-ev Class Diagram Example: Association Typesceg-at diff --git a/doc/infer.java b/doc/infer.java new file mode 100644 index 0000000..8d9a34c --- /dev/null +++ b/doc/infer.java @@ -0,0 +1,38 @@ +/* + * Relationship inference + * $Id$ + */ + +import java.util.List; +import java.util.Map; +import java.util.ArrayList; +import java.util.Arrays; + +/** + * @opt inferrel + * @opt collpackages java.util.* + * @opt inferdep + * @opt hide java.* + * @hidden + */ +class UMLOptions {} + +class Person { + House[] houses; + List dogs; + + public Room getFavouriteRoom(House house) {} +} + +/** + * @opt inferreltype composed + */ +class House { + Map nameRoomMap; +} + +class Room {} + +class Dog { + Person owner; +} diff --git a/doc/infer.png b/doc/infer.png new file mode 100644 index 0000000..487ab55 Binary files /dev/null and b/doc/infer.png differ diff --git a/doc/ver.xml b/doc/ver.xml index 4145c0c..8aa9514 100644 --- a/doc/ver.xml +++ b/doc/ver.xml @@ -7,10 +7,14 @@