ts2famix 2.0.0 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +29 -60
  3. package/dist/analyze.js +1 -1
  4. package/dist/analyze_functions/process_functions.js +49 -43
  5. package/dist/famix_functions/EntityDictionary.js +309 -182
  6. package/dist/famix_functions/helpers_creation.js +36 -5
  7. package/dist/fqn.js +76 -114
  8. package/dist/lib/famix/famix_JSON_exporter.js +55 -0
  9. package/dist/lib/famix/famix_base_element.js +18 -0
  10. package/dist/lib/famix/famix_repository.js +224 -0
  11. package/dist/lib/famix/{src/index.js → index.js} +1 -1
  12. package/dist/lib/famix/model/famix/access.js +40 -0
  13. package/dist/lib/famix/model/famix/accessor.js +17 -0
  14. package/dist/lib/famix/model/famix/alias.js +33 -0
  15. package/dist/lib/famix/model/famix/arrow_function.js +17 -0
  16. package/dist/lib/famix/model/famix/behavioral_entity.js +79 -0
  17. package/dist/lib/famix/model/famix/class.js +71 -0
  18. package/dist/lib/famix/model/famix/comment.js +39 -0
  19. package/dist/lib/famix/model/famix/concretisation.js +31 -0
  20. package/dist/lib/famix/model/famix/container_entity.js +126 -0
  21. package/dist/lib/famix/model/famix/decorator.js +32 -0
  22. package/dist/lib/famix/model/famix/entity.js +17 -0
  23. package/dist/lib/famix/model/famix/enum.js +31 -0
  24. package/dist/lib/famix/model/famix/enum_value.js +25 -0
  25. package/dist/lib/famix/model/famix/function.js +17 -0
  26. package/dist/lib/famix/model/famix/import_clause.js +41 -0
  27. package/dist/lib/famix/{src/model → model}/famix/index.js +6 -10
  28. package/dist/lib/famix/model/famix/indexed_file_anchor.js +38 -0
  29. package/dist/lib/famix/model/famix/inheritance.js +33 -0
  30. package/dist/lib/famix/model/famix/interface.js +64 -0
  31. package/dist/lib/famix/model/famix/invocation.js +54 -0
  32. package/dist/lib/famix/model/famix/method.js +67 -0
  33. package/dist/lib/famix/model/famix/module.js +60 -0
  34. package/dist/lib/famix/model/famix/named_entity.js +78 -0
  35. package/dist/lib/famix/model/famix/parameter.js +25 -0
  36. package/dist/lib/famix/model/famix/parameter_concretisation.js +44 -0
  37. package/dist/lib/famix/model/famix/parameter_type.js +45 -0
  38. package/dist/lib/famix/model/famix/parametric_arrow_function.js +31 -0
  39. package/dist/lib/famix/model/famix/parametric_class.js +44 -0
  40. package/dist/lib/famix/model/famix/parametric_function.js +31 -0
  41. package/dist/lib/famix/model/famix/parametric_interface.js +44 -0
  42. package/dist/lib/famix/model/famix/parametric_method.js +31 -0
  43. package/dist/lib/famix/model/famix/primitive_type.js +17 -0
  44. package/dist/lib/famix/model/famix/property.js +73 -0
  45. package/dist/lib/famix/model/famix/reference.js +33 -0
  46. package/dist/lib/famix/model/famix/scoping_entity.js +36 -0
  47. package/dist/lib/famix/model/famix/script_entity.js +29 -0
  48. package/dist/lib/famix/model/famix/source_anchor.js +27 -0
  49. package/dist/lib/famix/model/famix/source_language.js +35 -0
  50. package/dist/lib/famix/model/famix/sourced_entity.js +60 -0
  51. package/dist/lib/famix/model/famix/structural_entity.js +39 -0
  52. package/dist/lib/famix/model/famix/type.js +73 -0
  53. package/dist/lib/famix/model/famix/variable.js +24 -0
  54. package/dist/lib/ts-complex/cyclomatic-service.js +2 -2
  55. package/dist/refactorer/refactor-getter-setter.js +142 -0
  56. package/dist/ts2famix-cli-wrapper.js +29 -3
  57. package/dist/ts2famix-cli.js +1 -1
  58. package/doc-uml/famix-typescript-model.puml +390 -341
  59. package/doc-uml/famix-typescript-model.svg +1 -1
  60. package/package.json +26 -9
  61. package/src/analyze.ts +2 -2
  62. package/src/analyze_functions/process_functions.ts +49 -44
  63. package/src/famix_functions/EntityDictionary.ts +345 -216
  64. package/src/famix_functions/helpers_creation.ts +36 -4
  65. package/src/fqn.ts +76 -125
  66. package/src/lib/famix/famix_JSON_exporter.ts +56 -0
  67. package/src/lib/famix/famix_base_element.ts +22 -0
  68. package/src/lib/famix/famix_repository.ts +243 -0
  69. package/src/lib/famix/model/famix/access.ts +50 -0
  70. package/src/lib/famix/model/famix/alias.ts +39 -0
  71. package/src/lib/famix/model/famix/behavioral_entity.ts +97 -0
  72. package/src/lib/famix/model/famix/class.ts +85 -0
  73. package/src/lib/famix/model/famix/comment.ts +47 -0
  74. package/src/lib/famix/model/famix/concretisation.ts +40 -0
  75. package/src/lib/famix/model/famix/container_entity.ts +160 -0
  76. package/src/lib/famix/model/famix/decorator.ts +37 -0
  77. package/src/lib/famix/model/famix/enum.ts +30 -0
  78. package/src/lib/famix/model/famix/enum_value.ts +28 -0
  79. package/src/lib/famix/model/famix/import_clause.ts +51 -0
  80. package/src/lib/famix/{src/model → model}/famix/index.ts +2 -4
  81. package/src/lib/famix/model/famix/indexed_file_anchor.ts +46 -0
  82. package/src/lib/famix/model/famix/inheritance.ts +40 -0
  83. package/src/lib/famix/model/famix/interface.ts +75 -0
  84. package/src/lib/famix/model/famix/invocation.ts +65 -0
  85. package/src/lib/famix/model/famix/method.ts +89 -0
  86. package/src/lib/famix/model/famix/module.ts +71 -0
  87. package/src/lib/famix/model/famix/named_entity.ts +95 -0
  88. package/src/lib/famix/{src/model → model}/famix/parameter.ts +11 -12
  89. package/src/lib/famix/model/famix/parameter_concretisation.ts +51 -0
  90. package/src/lib/famix/model/famix/parameter_type.ts +58 -0
  91. package/src/lib/famix/model/famix/parametric_arrow_function.ts +32 -0
  92. package/src/lib/famix/model/famix/parametric_class.ts +49 -0
  93. package/src/lib/famix/model/famix/parametric_function.ts +32 -0
  94. package/src/lib/famix/model/famix/parametric_interface.ts +49 -0
  95. package/src/lib/famix/model/famix/parametric_method.ts +32 -0
  96. package/src/lib/famix/model/famix/primitive_type.ts +15 -0
  97. package/src/lib/famix/model/famix/property.ts +94 -0
  98. package/src/lib/famix/model/famix/reference.ts +40 -0
  99. package/src/lib/famix/model/famix/scoping_entity.ts +35 -0
  100. package/src/lib/famix/model/famix/script_entity.ts +34 -0
  101. package/src/lib/famix/model/famix/source_anchor.ts +30 -0
  102. package/src/lib/famix/model/famix/source_language.ts +35 -0
  103. package/src/lib/famix/model/famix/sourced_entity.ts +70 -0
  104. package/src/lib/famix/model/famix/structural_entity.ts +43 -0
  105. package/src/lib/famix/model/famix/type.ts +87 -0
  106. package/src/lib/famix/model/famix/variable.ts +27 -0
  107. package/src/lib/famix/package.json +1 -1
  108. package/src/lib/ts-complex/cyclomatic-service.ts +10 -10
  109. package/src/refactorer/refactor-getter-setter.ts +140 -0
  110. package/src/ts2famix-cli-wrapper.ts +6 -2
  111. package/src/ts2famix-cli.ts +1 -1
  112. package/tsconfig.check-tests.json +14 -0
  113. package/tsconfig.json +70 -68
  114. package/dist/famix2puml.js +0 -126
  115. package/dist/lib/famix/src/famix_JSON_exporter.js +0 -55
  116. package/dist/lib/famix/src/famix_base_element.js +0 -18
  117. package/dist/lib/famix/src/famix_repository.js +0 -223
  118. package/dist/lib/famix/src/model/famix/access.js +0 -40
  119. package/dist/lib/famix/src/model/famix/accessor.js +0 -17
  120. package/dist/lib/famix/src/model/famix/alias.js +0 -33
  121. package/dist/lib/famix/src/model/famix/arrowFunction.js +0 -17
  122. package/dist/lib/famix/src/model/famix/behavioral_entity.js +0 -79
  123. package/dist/lib/famix/src/model/famix/class.js +0 -71
  124. package/dist/lib/famix/src/model/famix/comment.js +0 -39
  125. package/dist/lib/famix/src/model/famix/concretisation.js +0 -31
  126. package/dist/lib/famix/src/model/famix/container_entity.js +0 -126
  127. package/dist/lib/famix/src/model/famix/decorator.js +0 -32
  128. package/dist/lib/famix/src/model/famix/entity.js +0 -17
  129. package/dist/lib/famix/src/model/famix/enum.js +0 -31
  130. package/dist/lib/famix/src/model/famix/enum_value.js +0 -25
  131. package/dist/lib/famix/src/model/famix/function.js +0 -17
  132. package/dist/lib/famix/src/model/famix/implicit_variable.js +0 -17
  133. package/dist/lib/famix/src/model/famix/import_clause.js +0 -41
  134. package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -52
  135. package/dist/lib/famix/src/model/famix/inheritance.js +0 -33
  136. package/dist/lib/famix/src/model/famix/interface.js +0 -64
  137. package/dist/lib/famix/src/model/famix/invocation.js +0 -54
  138. package/dist/lib/famix/src/model/famix/method.js +0 -67
  139. package/dist/lib/famix/src/model/famix/module.js +0 -84
  140. package/dist/lib/famix/src/model/famix/named_entity.js +0 -78
  141. package/dist/lib/famix/src/model/famix/parameter.js +0 -25
  142. package/dist/lib/famix/src/model/famix/parameterConcretisation.js +0 -44
  143. package/dist/lib/famix/src/model/famix/parameter_type.js +0 -45
  144. package/dist/lib/famix/src/model/famix/parametric_arrow_function.js +0 -31
  145. package/dist/lib/famix/src/model/famix/parametric_class.js +0 -44
  146. package/dist/lib/famix/src/model/famix/parametric_function.js +0 -31
  147. package/dist/lib/famix/src/model/famix/parametric_interface.js +0 -44
  148. package/dist/lib/famix/src/model/famix/parametric_method.js +0 -31
  149. package/dist/lib/famix/src/model/famix/primitive_type.js +0 -17
  150. package/dist/lib/famix/src/model/famix/property.js +0 -126
  151. package/dist/lib/famix/src/model/famix/reference.js +0 -33
  152. package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -37
  153. package/dist/lib/famix/src/model/famix/script_entity.js +0 -29
  154. package/dist/lib/famix/src/model/famix/source_anchor.js +0 -27
  155. package/dist/lib/famix/src/model/famix/source_language.js +0 -35
  156. package/dist/lib/famix/src/model/famix/sourced_entity.js +0 -60
  157. package/dist/lib/famix/src/model/famix/structural_entity.js +0 -39
  158. package/dist/lib/famix/src/model/famix/text_anchor.js +0 -38
  159. package/dist/lib/famix/src/model/famix/type.js +0 -73
  160. package/dist/lib/famix/src/model/famix/variable.js +0 -24
  161. package/jest.config-old.ts +0 -199
  162. package/src/famix2puml.ts +0 -119
  163. package/src/lib/famix/package-lock.json +0 -301
  164. package/src/lib/famix/readme.md +0 -5
  165. package/src/lib/famix/src/famix_JSON_exporter.ts +0 -56
  166. package/src/lib/famix/src/famix_base_element.ts +0 -22
  167. package/src/lib/famix/src/famix_repository.ts +0 -243
  168. package/src/lib/famix/src/model/famix/access.ts +0 -53
  169. package/src/lib/famix/src/model/famix/alias.ts +0 -41
  170. package/src/lib/famix/src/model/famix/behavioral_entity.ts +0 -100
  171. package/src/lib/famix/src/model/famix/class.ts +0 -86
  172. package/src/lib/famix/src/model/famix/comment.ts +0 -50
  173. package/src/lib/famix/src/model/famix/concretisation.ts +0 -42
  174. package/src/lib/famix/src/model/famix/container_entity.ts +0 -165
  175. package/src/lib/famix/src/model/famix/decorator.ts +0 -39
  176. package/src/lib/famix/src/model/famix/enum.ts +0 -31
  177. package/src/lib/famix/src/model/famix/enum_value.ts +0 -29
  178. package/src/lib/famix/src/model/famix/implicit_variable.ts +0 -15
  179. package/src/lib/famix/src/model/famix/import_clause.ts +0 -54
  180. package/src/lib/famix/src/model/famix/indexed_file_anchor.ts +0 -71
  181. package/src/lib/famix/src/model/famix/inheritance.ts +0 -41
  182. package/src/lib/famix/src/model/famix/interface.ts +0 -75
  183. package/src/lib/famix/src/model/famix/invocation.ts +0 -68
  184. package/src/lib/famix/src/model/famix/method.ts +0 -96
  185. package/src/lib/famix/src/model/famix/module.ts +0 -97
  186. package/src/lib/famix/src/model/famix/named_entity.ts +0 -98
  187. package/src/lib/famix/src/model/famix/parameterConcretisation.ts +0 -54
  188. package/src/lib/famix/src/model/famix/parameter_type.ts +0 -60
  189. package/src/lib/famix/src/model/famix/parametric_arrow_function.ts +0 -32
  190. package/src/lib/famix/src/model/famix/parametric_class.ts +0 -49
  191. package/src/lib/famix/src/model/famix/parametric_function.ts +0 -32
  192. package/src/lib/famix/src/model/famix/parametric_interface.ts +0 -49
  193. package/src/lib/famix/src/model/famix/parametric_method.ts +0 -32
  194. package/src/lib/famix/src/model/famix/primitive_type.ts +0 -15
  195. package/src/lib/famix/src/model/famix/property.ts +0 -152
  196. package/src/lib/famix/src/model/famix/reference.ts +0 -42
  197. package/src/lib/famix/src/model/famix/scoping_entity.ts +0 -36
  198. package/src/lib/famix/src/model/famix/script_entity.ts +0 -36
  199. package/src/lib/famix/src/model/famix/source_anchor.ts +0 -31
  200. package/src/lib/famix/src/model/famix/source_language.ts +0 -36
  201. package/src/lib/famix/src/model/famix/sourced_entity.ts +0 -73
  202. package/src/lib/famix/src/model/famix/structural_entity.ts +0 -44
  203. package/src/lib/famix/src/model/famix/text_anchor.ts +0 -49
  204. package/src/lib/famix/src/model/famix/type.ts +0 -89
  205. package/src/lib/famix/src/model/famix/variable.ts +0 -28
  206. package/src/lib/famix/tsconfig.json +0 -27
  207. package/src/lib/famix/tslint.json +0 -15
  208. /package/src/lib/famix/{src/index.ts → index.ts} +0 -0
  209. /package/src/lib/famix/{src/model → model}/famix/accessor.ts +0 -0
  210. /package/src/lib/famix/{src/model/famix/arrowFunction.ts → model/famix/arrow_function.ts} +0 -0
  211. /package/src/lib/famix/{src/model → model}/famix/entity.ts +0 -0
  212. /package/src/lib/famix/{src/model → model}/famix/function.ts +0 -0
@@ -1,97 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { ImportClause } from "./import_clause";
3
- import { ScopingEntity } from "./scoping_entity";
4
- import { ScriptEntity } from "./script_entity";
5
-
6
- export class Module extends ScriptEntity {
7
-
8
-
9
- /**
10
- * Getter $isAmbient
11
- * @return {boolean }
12
- */
13
- public get $isAmbient(): boolean {
14
- return this.isAmbient;
15
- }
16
-
17
- /**
18
- * Setter $isAmbient
19
- * @param {boolean } value
20
- */
21
- public set $isAmbient(value: boolean ) {
22
- this.isAmbient = value;
23
- }
24
-
25
- private isAmbient: boolean = false;
26
-
27
- /**
28
- * Getter $isNamespace
29
- * @return {boolean }
30
- */
31
- public get $isNamespace(): boolean {
32
- return this.isNamespace;
33
- }
34
-
35
- /**
36
- * Setter $isNamespace
37
- * @param {boolean } value
38
- */
39
- public set $isNamespace(value: boolean ) {
40
- this.isNamespace = value;
41
- }
42
- private isNamespace: boolean = false;
43
-
44
- /**
45
- * Getter $isModule
46
- * @return {boolean }
47
- */
48
- public get $isModule(): boolean {
49
- return this.isModule;
50
- }
51
-
52
- /**
53
- * Setter $isModule
54
- * @param {boolean } value
55
- */
56
- public set $isModule(value: boolean ) {
57
- this.isModule = value;
58
- }
59
-
60
- private isModule: boolean = true;
61
-
62
- private parentScope: ScopingEntity;
63
-
64
- public getParentScope(): ScopingEntity {
65
- return this.parentScope;
66
- }
67
-
68
- public setParentScope(parentScope: ScopingEntity): void {
69
- this.parentScope = parentScope;
70
- parentScope.addModule(this);
71
- }
72
-
73
- // incomingImports are in NamedEntity
74
- private outgoingImports: Set<ImportClause> = new Set();
75
-
76
- getOutgoingImports() {
77
- return this.outgoingImports;
78
- }
79
-
80
- addOutgoingImport(importClause: ImportClause) {
81
- if (!this.outgoingImports.has(importClause)) {
82
- this.outgoingImports.add(importClause);
83
- importClause.setImportingEntity(this); // opposite
84
- }
85
- }
86
-
87
- public getJSON(): string {
88
- const json: FamixJSONExporter = new FamixJSONExporter("Module", this);
89
- this.addPropertiesToExporter(json);
90
- return json.getJSON();
91
- }
92
-
93
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
94
- super.addPropertiesToExporter(exporter);
95
- exporter.addProperty("outgoingImports", this.getOutgoingImports());
96
- }
97
- }
@@ -1,98 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { SourcedEntity } from "./sourced_entity";
3
- import { Invocation } from "./invocation";
4
- import { ImportClause } from "./import_clause";
5
- import { Alias } from "./alias";
6
- import { Decorator } from "./decorator";
7
-
8
- export class NamedEntity extends SourcedEntity {
9
-
10
- private fullyQualifiedName: string;
11
-
12
- public getFullyQualifiedName(): string {
13
- return this.fullyQualifiedName;
14
- }
15
-
16
- public setFullyQualifiedName(fullyQualifiedName: string): void {
17
- this.fullyQualifiedName = fullyQualifiedName;
18
- }
19
-
20
- private receivedInvocations: Set<Invocation> = new Set();
21
-
22
- public getReceivedInvocations(): Set<Invocation> {
23
- return this.receivedInvocations;
24
- }
25
-
26
- public addReceivedInvocation(receivedInvocation: Invocation): void {
27
- if (!this.receivedInvocations.has(receivedInvocation)) {
28
- this.receivedInvocations.add(receivedInvocation);
29
- receivedInvocation.setReceiver(this);
30
- }
31
- }
32
-
33
- private incomingImports: Set<ImportClause> = new Set();
34
-
35
- public getIncomingImports(): Set<ImportClause> {
36
- return this.incomingImports;
37
- }
38
-
39
- public addIncomingImport(anImport: ImportClause): void {
40
- if (!this.incomingImports.has(anImport)) {
41
- this.incomingImports.add(anImport);
42
- anImport.setImportedEntity(this); // opposite
43
- }
44
- }
45
-
46
- private name: string;
47
-
48
- public getName(): string {
49
- return this.name;
50
- }
51
-
52
- public setName(name: string): void {
53
- this.name = name;
54
- }
55
-
56
- private aliases: Set<Alias> = new Set();
57
-
58
- public getAliases(): Set<Alias> {
59
- return this.aliases;
60
- }
61
-
62
- public addAlias(alias: Alias): void {
63
- if (!this.aliases.has(alias)) {
64
- this.aliases.add(alias);
65
- alias.setParentEntity(this);
66
- }
67
- }
68
-
69
- private decorators: Set<Decorator> = new Set();
70
-
71
- public getDecorators(): Set<Decorator> {
72
- return this.decorators;
73
- }
74
-
75
- public addDecorator(decorator: Decorator): void {
76
- if (!this.decorators.has(decorator)) {
77
- this.decorators.add(decorator);
78
- decorator.setDecoratedEntity(this);
79
- }
80
- }
81
-
82
-
83
- public getJSON(): string {
84
- const json: FamixJSONExporter = new FamixJSONExporter("NamedEntity", this);
85
- this.addPropertiesToExporter(json);
86
- return json.getJSON();
87
- }
88
-
89
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
90
- super.addPropertiesToExporter(exporter);
91
- // exporter.addProperty("fullyQualifiedName", this.getFullyQualifiedName());
92
- // exporter.addProperty("incomingInvocations", this.getReceivedInvocations());
93
- exporter.addProperty("incomingImports", this.getIncomingImports());
94
- exporter.addProperty("name", this.getName());
95
- // exporter.addProperty("aliases", this.getAliases()); /* since these generate Unknown property messages */
96
- exporter.addProperty("decorators", this.getDecorators());
97
- }
98
- }
@@ -1,54 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Concretisation } from "./concretisation";
3
- import { Entity } from "./entity";
4
- import { ParameterType } from "./parameter_type";
5
- import { PrimitiveType } from "./primitive_type";
6
-
7
- export class ParameterConcretisation extends Entity {
8
-
9
- private genericParameter: ParameterType;
10
-
11
- public getGenericParameter(): ParameterType {
12
- return this.genericParameter;
13
- }
14
-
15
- public setGenericParameter(genericEntity: ParameterType): void {
16
- this.genericParameter = genericEntity;
17
- }
18
-
19
- private concreteParameter: PrimitiveType;
20
-
21
- public getConcreteParameter(): PrimitiveType {
22
- return this.concreteParameter;
23
- }
24
-
25
- public setConcreteParameter(concreteParameter: PrimitiveType): void {
26
- this.concreteParameter = concreteParameter;
27
- }
28
-
29
- private concretisations: Set<Concretisation> = new Set();
30
-
31
- public getConcretisations(): Set<Concretisation> {
32
- return this.concretisations;
33
- }
34
-
35
- public addConcretisation(concretisation: Concretisation): void {
36
- if (!this.concretisations.has(concretisation)) {
37
- this.concretisations.add(concretisation);
38
- }
39
- }
40
-
41
- public getJSON(): string {
42
- const json: FamixJSONExporter = new FamixJSONExporter("ParameterConcretisation", this);
43
- this.addPropertiesToExporter(json);
44
- return json.getJSON();
45
- }
46
-
47
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
48
- super.addPropertiesToExporter(exporter);
49
- exporter.addProperty("genericEntity", this.getGenericParameter());
50
- exporter.addProperty("concreteEntity", this.getConcreteParameter());
51
- exporter.addProperty("concretisations", this.getConcretisations());
52
- }
53
-
54
- }
@@ -1,60 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Type } from "./type";
3
- import { ParametricClass } from "./parametric_class";
4
- import { ParametricInterface } from "./parametric_interface";
5
- import { Method } from "./method";
6
- import { Function as FamixFunction } from "./function";
7
- import { Accessor } from "./accessor";
8
- import { ParametricMethod } from "./parametric_method";
9
- import { ParametricFunction } from "./parametric_function";
10
- import { ArrowFunction } from "./arrowFunction";
11
- import { ParametricArrowFunction } from "./parametric_arrow_function";
12
-
13
- export class ParameterType extends Type {
14
-
15
- private parentGeneric: ParametricClass | ParametricInterface | Method | ParametricMethod | Accessor | FamixFunction | ParametricFunction | ArrowFunction | ParametricArrowFunction;
16
-
17
- public getParentGeneric(): ParametricClass | ParametricInterface | Method | ParametricMethod | Accessor | FamixFunction | ParametricFunction | ArrowFunction | ParametricArrowFunction {
18
- return this.parentGeneric;
19
- }
20
-
21
- public setParentGeneric(parentGeneric: ParametricClass | ParametricInterface | Method | ParametricMethod | Accessor | FamixFunction | ParametricFunction | ArrowFunction | ParametricArrowFunction): void {
22
- this.parentGeneric = parentGeneric;
23
- parentGeneric.addGenericParameter(this);
24
- }
25
-
26
- private baseType: Type;
27
-
28
- public getBaseType(): Type {
29
- return this.baseType;
30
- }
31
-
32
- public setBaseType(baseType: Type): void {
33
- this.baseType = baseType;
34
- }
35
-
36
- private arguments: Set<Type> = new Set();
37
-
38
- public getArguments(): Set<Type> {
39
- return this.arguments;
40
- }
41
-
42
- public addArgument(argument: Type): void {
43
- if (!this.arguments.has(argument)) {
44
- this.arguments.add(argument);
45
- }
46
- }
47
-
48
- public getJSON(): string {
49
- const json: FamixJSONExporter = new FamixJSONExporter("ParameterType", this);
50
- this.addPropertiesToExporter(json);
51
- return json.getJSON();
52
- }
53
-
54
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
55
- super.addPropertiesToExporter(exporter);
56
- exporter.addProperty("parentGeneric", this.getParentGeneric());
57
- exporter.addProperty("baseType", this.getBaseType());
58
- exporter.addProperty("arguments", this.getArguments());
59
- }
60
- }
@@ -1,32 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { ArrowFunction } from "./arrowFunction";
3
- import { Class } from "./class";
4
- import { Interface } from "./interface";
5
- import { PrimitiveType } from "./primitive_type";
6
-
7
- export class ParametricArrowFunction extends ArrowFunction {
8
-
9
- private concreteParameters: Set<PrimitiveType | Class | Interface> = new Set();
10
-
11
- public getConcreteParameters(): Set<PrimitiveType | Class | Interface > {
12
- return this.concreteParameters;
13
- }
14
-
15
- public addConcreteParameter(concreteParameter: PrimitiveType | Class | Interface): void {
16
- if (!this.concreteParameters.has(concreteParameter)) {
17
- this.concreteParameters.add(concreteParameter);
18
- }
19
- }
20
-
21
- public getJSON(): string {
22
- const json: FamixJSONExporter = new FamixJSONExporter("ParametricArrowFunction", this);
23
- this.addPropertiesToExporter(json);
24
- return json.getJSON();
25
- }
26
-
27
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
28
- super.addPropertiesToExporter(exporter);
29
- exporter.addProperty("genericParameters", this.getGenericParameters());
30
- exporter.addProperty("concreteParameters", this.getConcreteParameters());
31
- }
32
- }
@@ -1,49 +0,0 @@
1
- import { Interface } from "./interface";
2
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
3
- import { Class } from "./class";
4
- import { ParameterType } from "./parameter_type";
5
- import { PrimitiveType } from "./primitive_type";
6
-
7
- export class ParametricClass extends Class {
8
-
9
- private genericParameters: Set<ParameterType> = new Set();
10
-
11
- public getGenericParameters(): Set<ParameterType> {
12
- return this.genericParameters;
13
- }
14
-
15
- public addGenericParameter(genericParameter: ParameterType): void {
16
- if (!this.genericParameters.has(genericParameter)) {
17
- this.genericParameters.add(genericParameter);
18
- genericParameter.setParentGeneric(this);
19
- }
20
- }
21
-
22
- clearGenericParameters(): void {
23
- this.genericParameters.clear();
24
- }
25
-
26
- private concreteParameters: Set<PrimitiveType | Class | Interface> = new Set();
27
-
28
- public getConcreteParameters(): Set<PrimitiveType | Class | Interface> {
29
- return this.concreteParameters;
30
- }
31
-
32
- public addConcreteParameter(concreteParameter: PrimitiveType | Class | Interface ): void {
33
- if (!this.concreteParameters.has(concreteParameter)) {
34
- this.concreteParameters.add(concreteParameter);
35
- }
36
- }
37
-
38
- public getJSON(): string {
39
- const json: FamixJSONExporter = new FamixJSONExporter("ParametricClass", this);
40
- this.addPropertiesToExporter(json);
41
- return json.getJSON();
42
- }
43
-
44
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
45
- super.addPropertiesToExporter(exporter);
46
- exporter.addProperty("genericParameters", this.getGenericParameters());
47
- exporter.addProperty("concreteParameters", this.getConcreteParameters());
48
- }
49
- }
@@ -1,32 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Class } from "./class";
3
- import { Function } from "./function";
4
- import { Interface } from "./interface";
5
- import { PrimitiveType } from "./primitive_type";
6
-
7
- export class ParametricFunction extends Function {
8
-
9
- private concreteParameters: Set<PrimitiveType | Class | Interface> = new Set();
10
-
11
- public getConcreteParameters(): Set<PrimitiveType | Class | Interface> {
12
- return this.concreteParameters;
13
- }
14
-
15
- public addConcreteParameter(concreteParameter: PrimitiveType | Class | Interface): void {
16
- if (!this.concreteParameters.has(concreteParameter)) {
17
- this.concreteParameters.add(concreteParameter);
18
- }
19
- }
20
-
21
- public getJSON(): string {
22
- const json: FamixJSONExporter = new FamixJSONExporter("ParametricFunction", this);
23
- this.addPropertiesToExporter(json);
24
- return json.getJSON();
25
- }
26
-
27
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
28
- super.addPropertiesToExporter(exporter);
29
- exporter.addProperty("genericParameters", this.getGenericParameters());
30
- exporter.addProperty("concreteParameters", this.getConcreteParameters());
31
- }
32
- }
@@ -1,49 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Class } from "./class";
3
- import { Interface } from "./interface";
4
- import { ParameterType } from "./parameter_type";
5
- import { PrimitiveType } from "./primitive_type";
6
-
7
- export class ParametricInterface extends Interface {
8
-
9
- private genericParameters: Set<ParameterType> = new Set();
10
-
11
- public getGenericParameters(): Set<ParameterType> {
12
- return this.genericParameters;
13
- }
14
-
15
- public addGenericParameter(genericParameter: ParameterType): void {
16
- if (!this.genericParameters.has(genericParameter)) {
17
- this.genericParameters.add(genericParameter);
18
- genericParameter.setParentGeneric(this);
19
- }
20
- }
21
-
22
- clearGenericParameters(): void {
23
- this.genericParameters.clear();
24
- }
25
-
26
- private concreteParameters: Set<PrimitiveType | Class | Interface> = new Set();
27
-
28
- public getConcreteParameters(): Set<PrimitiveType | Class | Interface> {
29
- return this.concreteParameters;
30
- }
31
-
32
- public addConcreteParameter(concreteParameter: PrimitiveType | Class | Interface): void {
33
- if (!this.concreteParameters.has(concreteParameter)) {
34
- this.concreteParameters.add(concreteParameter);
35
- }
36
- }
37
-
38
- public getJSON(): string {
39
- const json: FamixJSONExporter = new FamixJSONExporter("ParametricInterface", this);
40
- this.addPropertiesToExporter(json);
41
- return json.getJSON();
42
- }
43
-
44
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
45
- super.addPropertiesToExporter(exporter);
46
- exporter.addProperty("genericParameters", this.getGenericParameters());
47
- exporter.addProperty("concreteParameters", this.getConcreteParameters());
48
- }
49
- }
@@ -1,32 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Class } from "./class";
3
- import { Interface } from "./interface";
4
- import { Method } from "./method";
5
- import { PrimitiveType } from "./primitive_type";
6
-
7
- export class ParametricMethod extends Method {
8
-
9
- private concreteParameters: Set<PrimitiveType | Class | Interface> = new Set();
10
-
11
- public getConcreteParameters(): Set<PrimitiveType | Class | Interface> {
12
- return this.concreteParameters;
13
- }
14
-
15
- public addConcreteParameter(concreteParameter: PrimitiveType | Class | Interface): void {
16
- if (!this.concreteParameters.has(concreteParameter)) {
17
- this.concreteParameters.add(concreteParameter);
18
- }
19
- }
20
-
21
- public getJSON(): string {
22
- const json: FamixJSONExporter = new FamixJSONExporter("ParametricMethod", this);
23
- this.addPropertiesToExporter(json);
24
- return json.getJSON();
25
- }
26
-
27
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
28
- super.addPropertiesToExporter(exporter);
29
- exporter.addProperty("genericParameters", this.getGenericParameters());
30
- exporter.addProperty("concreteParameters", this.getConcreteParameters());
31
- }
32
- }
@@ -1,15 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Type } from "./type";
3
-
4
- export class PrimitiveType extends Type {
5
-
6
- public getJSON(): string {
7
- const json: FamixJSONExporter = new FamixJSONExporter("PrimitiveType", this);
8
- this.addPropertiesToExporter(json);
9
- return json.getJSON();
10
- }
11
-
12
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
13
- super.addPropertiesToExporter(exporter);
14
- }
15
- }
@@ -1,152 +0,0 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Class } from "./class";
3
- import { Interface } from "./interface";
4
- import { StructuralEntity } from "./structural_entity";
5
-
6
- export type VisibilityTypes = "public" | "private" | "protected" | "";
7
-
8
- export class Property extends StructuralEntity {
9
-
10
- private isClassSide: boolean = false;
11
-
12
- /**
13
- * Getter $readOnly
14
- * @return {boolean}
15
- */
16
- public get readOnly(): boolean {
17
- return this._readOnly;
18
- }
19
-
20
- /**
21
- * Setter $readOnly
22
- * @param {boolean} value
23
- */
24
- public set readOnly(value: boolean) {
25
- this._readOnly = value;
26
- }
27
- private _readOnly: boolean;
28
-
29
- public getIsClassSide(): boolean {
30
- return this.isClassSide;
31
- }
32
-
33
- public setIsClassSide(isClassSide: boolean): void {
34
- this.isClassSide = isClassSide;
35
- }
36
-
37
- private parentEntity: Class | Interface;
38
-
39
- public getParentEntity(): Class | Interface {
40
- return this.parentEntity;
41
- }
42
-
43
- public setParentEntity(parentEntity: Class | Interface): void {
44
- this.parentEntity = parentEntity;
45
- parentEntity.addProperty(this);
46
- }
47
-
48
-
49
- /**
50
- * Getter $isClassSide
51
- * @return {boolean }
52
- */
53
- public get $isClassSide(): boolean {
54
- return this.isClassSide;
55
- }
56
-
57
- /**
58
- * Setter $isClassSide
59
- * @param {boolean } value
60
- */
61
- public set $isClassSide(value: boolean ) {
62
- this.isClassSide = value;
63
- }
64
-
65
- /**
66
- * Getter isDefinitelyAssigned
67
- * @return {boolean}
68
- */
69
- public get isDefinitelyAssigned(): boolean {
70
- return this._isDefinitelyAssigned;
71
- }
72
-
73
- /**
74
- * Setter isDefinitelyAssigned
75
- * @param {boolean} value
76
- */
77
- public set isDefinitelyAssigned(value: boolean) {
78
- this._isDefinitelyAssigned = value;
79
- }
80
-
81
- /**
82
- * Getter isOptional
83
- * @return {boolean}
84
- */
85
- public get isOptional(): boolean {
86
- return this._isOptional;
87
- }
88
-
89
- /**
90
- * Setter isOptional
91
- * @param {boolean} value
92
- */
93
- public set isOptional(value: boolean) {
94
- this._isOptional = value;
95
- }
96
-
97
- /**
98
- * Getter isJavaScriptPrivate
99
- * @return {boolean}
100
- */
101
- public get isJavaScriptPrivate(): boolean {
102
- return this._isJavaScriptPrivate;
103
- }
104
-
105
- /**
106
- * Setter isJavaScriptPrivate
107
- * @param {boolean} value
108
- */
109
- public set isJavaScriptPrivate(value: boolean) {
110
- this._isJavaScriptPrivate = value;
111
- }
112
- private _isDefinitelyAssigned: boolean;
113
-
114
- private _isOptional: boolean;
115
-
116
- private _isJavaScriptPrivate: boolean;
117
-
118
- /**
119
- * Getter visibility
120
- * @return {VisibilityTypes }
121
- */
122
- public get visibility(): VisibilityTypes {
123
- return this._visibility;
124
- }
125
-
126
- /**
127
- * Setter visibility
128
- * @param {VisibilityTypes } value
129
- */
130
- public set visibility(value: VisibilityTypes) {
131
- this._visibility = value;
132
- }
133
-
134
- private _visibility: VisibilityTypes = "";
135
-
136
- public getJSON(): string {
137
- const json: FamixJSONExporter = new FamixJSONExporter("Property", this);
138
- this.addPropertiesToExporter(json);
139
- return json.getJSON();
140
- }
141
-
142
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
143
- super.addPropertiesToExporter(exporter);
144
- exporter.addProperty("readOnly", this.readOnly);
145
- exporter.addProperty("isClassSide", this.getIsClassSide());
146
- exporter.addProperty("parentType", this.getParentEntity());
147
- exporter.addProperty("visibility", this.visibility);
148
- exporter.addProperty("isDefinitelyAssigned", this.isDefinitelyAssigned);
149
- exporter.addProperty("isOptional", this.isOptional);
150
- exporter.addProperty("isJavaScriptPrivate", this.isJavaScriptPrivate);
151
- }
152
- }