forked from jfeliu007/goplantuml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassDiagram.puml
65 lines (54 loc) · 2.58 KB
/
ClassDiagram.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@startuml
namespace parser {
class Function << (S,Aquamarine) >> {
+ Name string
+ Parameters []*Field
+ ReturnValues []string
+ PackageName string
+ FullNameReturnValues []string
+ SignturesAreEqual(function *Function) bool
}
class Field << (S,Aquamarine) >> {
+ Name string
+ Type string
+ FullType string
}
class LineStringBuilder << (S,Aquamarine) >> {
+ WriteLineWithDepth(depth int, str string)
}
class ClassParser << (S,Aquamarine) >> {
- structure <font color=blue>map</font>[string]<font color=blue>map</font>[string]*Struct
- currentPackageName string
- allInterfaces <font color=blue>map</font>[string]<font color=blue>struct</font>{}
- allStructs <font color=blue>map</font>[string]<font color=blue>struct</font>{}
- allImports <font color=blue>map</font>[string]string
- parsePackage(node ast.Node)
- parseImports(impt *ast.ImportSpec)
- parseDirectory(directoryPath string) error
- parseFileDeclarations(node ast.Decl)
- renderStructures(pack string, structures <font color=blue>map</font>[string]*Struct, str *LineStringBuilder)
- renderStructure(structure *Struct, pack string, name string, str *LineStringBuilder, composition *LineStringBuilder, extends *LineStringBuilder)
- renderCompositions(structure *Struct, name string, composition *LineStringBuilder)
- renderExtends(structure *Struct, name string, extends *LineStringBuilder)
- renderStructMethods(structure *Struct, privateMethods *LineStringBuilder, publicMethods *LineStringBuilder)
- renderStructFields(structure *Struct, privateFields *LineStringBuilder, publicFields *LineStringBuilder)
- getOrCreateStruct(name string) *Struct
- getStruct(structName string) *Struct
+ Render() string
}
class Struct << (S,Aquamarine) >> {
+ PackageName string
+ Functions []*Function
+ Fields []*Field
+ Type string
+ Composition <font color=blue>map</font>[string]<font color=blue>struct</font>{}
+ Extends <font color=blue>map</font>[string]<font color=blue>struct</font>{}
+ ImplementsInterface(inter *Struct) bool
+ AddToComposition(fType string)
+ AddToExtends(fType string)
+ AddField(field *ast.Field, aliases <font color=blue>map</font>[string]string)
+ AddMethod(method *ast.Field, aliases <font color=blue>map</font>[string]string)
}
}
strings.Builder *-- parser.LineStringBuilder
@enduml