I translate a JSON formatted diagram into something else depending on the Builder instance given.
- Give a Strategy translator instance for specifying the algorithm for translating the diagram.
- Give a Builder for specifying the output format.
JSON Format
We expect the following fields:
classes
: An Array of classes information. Each class should have:
attrs
An array of strings representing all attributes names
methods
An array of strings representing all attributes names
name
A string which represent the name of the class.
- links : An array of links information. Each link should have:
classes
: An array of strings with the name of the classes involved on the relationship.
multiplicity
: An array of strings with the multiplicity on each class side.
name
: A string with the name of the link.
type
: A string with the type name of the link. Could be: "association", "generalization".
Example
2 {"attrs":[], "methods":[], "name": "Person"},
3 {"attrs":[], "methods":[], "name": "Cellphones"}],
5 {"classes": ["Person", "Cellphones"],
6 "multiplicity": ["1..1", "1..*"],
7 "name": "hasCellphone",