forked from jfeliu007/goplantuml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassDiagram.puml
129 lines (112 loc) · 5.23 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@startuml
title Parser Class Diagram
namespace parser {
class Alias << (S,Aquamarine) >> {
+ Name string
+ PackageName string
+ AliasOf string
}
class AliasSlice << (S,Aquamarine) >> {
+ Len() int
+ Less(i int, j int) bool
+ Swap(i int, j int)
}
class ClassDiagramOptions << (S,Aquamarine) >> {
+ FileSystem afero.Fs
+ Directories []string
+ IgnoredDirectories []string
+ RenderingOptions <font color=blue>map</font>[RenderingOption]<font color=blue>interface</font>{}
+ Recursive bool
}
class ClassParser << (S,Aquamarine) >> {
- renderingOptions *RenderingOptions
- 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
- allAliases <font color=blue>map</font>[string]*Alias
- allRenamedStructs <font color=blue>map</font>[string]<font color=blue>map</font>[string]string
- parsePackage(node ast.Node)
- parseImports(impt *ast.ImportSpec)
- parseDirectory(directoryPath string) error
- parseFileDeclarations(node ast.Decl)
- handleFuncDecl(decl *ast.FuncDecl)
- handleGenDecl(decl *ast.GenDecl)
- processSpec(spec ast.Spec)
- renderStructures(pack string, structures <font color=blue>map</font>[string]*Struct, str *LineStringBuilder)
- renderAliases(str *LineStringBuilder)
- renderStructure(structure *Struct, pack string, name string, str *LineStringBuilder, composition *LineStringBuilder, extends *LineStringBuilder, aggregations *LineStringBuilder)
- renderCompositions(structure *Struct, name string, composition *LineStringBuilder)
- renderAggregations(structure *Struct, name string, aggregations *LineStringBuilder)
- updatePrivateAggregations(structure *Struct, aggregationsMap <font color=blue>map</font>[string]<font color=blue>struct</font>{})
- renderAggregationMap(aggregationMap <font color=blue>map</font>[string]<font color=blue>struct</font>{}, structure *Struct, aggregations *LineStringBuilder, name string)
- getPackageName(t string, st *Struct) string
- 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
+ SetRenderingOptions(ro <font color=blue>map</font>[RenderingOption]<font color=blue>interface</font>{}) error
}
class Field << (S,Aquamarine) >> {
+ Name string
+ Type string
+ FullType string
}
class Function << (S,Aquamarine) >> {
+ Name string
+ Parameters []*Field
+ ReturnValues []string
+ PackageName string
+ FullNameReturnValues []string
+ SignturesAreEqual(function *Function) bool
}
class LineStringBuilder << (S,Aquamarine) >> {
+ WriteLineWithDepth(depth int, str string)
}
class RenderingOptions << (S,Aquamarine) >> {
+ Title string
+ Notes string
+ Aggregations bool
+ Fields bool
+ Methods bool
+ Compositions bool
+ Implementations bool
+ Aliases bool
+ ConnectionLabels bool
+ AggregatePrivateMembers bool
+ PrivateMembers bool
}
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>{}
+ Aggregations <font color=blue>map</font>[string]<font color=blue>struct</font>{}
+ PrivateAggregations <font color=blue>map</font>[string]<font color=blue>struct</font>{}
- addToPrivateAggregation(fType string)
+ ImplementsInterface(inter *Struct) bool
+ AddToComposition(fType string)
+ AddToExtends(fType string)
+ AddToAggregation(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)
}
class parser.AliasSlice << (T, #FF7700) >> {
}
class parser.RenderingOption << (T, #FF7700) >> {
}
}
"strings.Builder" *-- "extends""parser.LineStringBuilder"
"parser.ClassDiagramOptions""uses" o-- "afero.Fs"
"parser.ClassDiagramOptions""uses" o-- "parser.RenderingOption"
"parser.Function""uses" o-- "parser.Field"
"parser.Struct""uses" o-- "parser.Field"
"parser.Struct""uses" o-- "parser.Function"
"__builtin__.int" #.. "alias of""parser.RenderingOption"
"parser.[]Alias" #.. "alias of""parser.AliasSlice"
@enduml