ts2famix 2.0.3 → 2.1.0-beta.2

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 (191) hide show
  1. package/.eslintrc.json +24 -24
  2. package/.vscode/settings.json +4 -0
  3. package/LICENSE +24 -24
  4. package/README.md +78 -78
  5. package/TODO +1 -0
  6. package/arwea-fix.json +1 -0
  7. package/bogus.ts +3 -0
  8. package/class-diagram.puml +792 -0
  9. package/debug.txt +13332 -0
  10. package/debuglog.txt +12073 -0
  11. package/dist/analyze.js +19 -9
  12. package/dist/analyze_functions/process_functions.js +101 -71
  13. package/dist/famix2puml.js +126 -0
  14. package/dist/famix_functions/EntityDictionary.js +881 -509
  15. package/dist/famix_functions/helpers_creation.js +18 -8
  16. package/dist/fqn.js +44 -11
  17. package/dist/getClasses-arrow-body.js +43 -0
  18. package/dist/lib/famix/famix_JSON_exporter.js +1 -1
  19. package/dist/lib/famix/famix_base_element.js +1 -1
  20. package/dist/lib/famix/famix_repository.js +67 -2
  21. package/dist/lib/famix/index.js +18 -8
  22. package/dist/lib/famix/model/famix/access.js +1 -1
  23. package/dist/lib/famix/model/famix/accessor.js +1 -1
  24. package/dist/lib/famix/model/famix/alias.js +1 -1
  25. package/dist/lib/famix/model/famix/arrow_function.js +1 -1
  26. package/dist/lib/famix/model/famix/behavioral_entity.js +1 -1
  27. package/dist/lib/famix/model/famix/class.js +1 -1
  28. package/dist/lib/famix/model/famix/comment.js +1 -1
  29. package/dist/lib/famix/model/famix/concretisation.js +1 -1
  30. package/dist/lib/famix/model/famix/container_entity.js +1 -1
  31. package/dist/lib/famix/model/famix/decorator.js +1 -1
  32. package/dist/lib/famix/model/famix/entity.js +1 -1
  33. package/dist/lib/famix/model/famix/enum.js +1 -1
  34. package/dist/lib/famix/model/famix/enum_value.js +1 -1
  35. package/dist/lib/famix/model/famix/function.js +1 -1
  36. package/dist/lib/famix/model/famix/import_clause.js +1 -1
  37. package/dist/lib/famix/model/famix/index.js +1 -1
  38. package/dist/lib/famix/model/famix/indexed_file_anchor.js +1 -1
  39. package/dist/lib/famix/model/famix/inheritance.js +1 -1
  40. package/dist/lib/famix/model/famix/interface.js +1 -1
  41. package/dist/lib/famix/model/famix/invocation.js +1 -1
  42. package/dist/lib/famix/model/famix/method.js +1 -1
  43. package/dist/lib/famix/model/famix/module.js +1 -1
  44. package/dist/lib/famix/model/famix/named_entity.js +1 -1
  45. package/dist/lib/famix/model/famix/parameter.js +1 -1
  46. package/dist/lib/famix/model/famix/parameter_concretisation.js +1 -1
  47. package/dist/lib/famix/model/famix/parameter_type.js +1 -1
  48. package/dist/lib/famix/model/famix/parametric_arrow_function.js +1 -1
  49. package/dist/lib/famix/model/famix/parametric_class.js +1 -1
  50. package/dist/lib/famix/model/famix/parametric_function.js +1 -1
  51. package/dist/lib/famix/model/famix/parametric_interface.js +1 -1
  52. package/dist/lib/famix/model/famix/parametric_method.js +1 -1
  53. package/dist/lib/famix/model/famix/primitive_type.js +1 -1
  54. package/dist/lib/famix/model/famix/property.js +1 -1
  55. package/dist/lib/famix/model/famix/reference.js +1 -1
  56. package/dist/lib/famix/model/famix/scoping_entity.js +1 -1
  57. package/dist/lib/famix/model/famix/script_entity.js +1 -1
  58. package/dist/lib/famix/model/famix/source_anchor.js +1 -1
  59. package/dist/lib/famix/model/famix/source_language.js +1 -1
  60. package/dist/lib/famix/model/famix/sourced_entity.js +1 -1
  61. package/dist/lib/famix/model/famix/structural_entity.js +1 -1
  62. package/dist/lib/famix/model/famix/type.js +1 -1
  63. package/dist/lib/famix/model/famix/variable.js +1 -1
  64. package/dist/lib/famix/src/famix_JSON_exporter.js +55 -0
  65. package/dist/lib/famix/src/famix_base_element.js +18 -0
  66. package/dist/lib/famix/src/famix_repository.js +224 -0
  67. package/dist/lib/famix/src/index.js +31 -0
  68. package/dist/lib/famix/src/model/famix/access.js +40 -0
  69. package/dist/lib/famix/src/model/famix/accessor.js +17 -0
  70. package/dist/lib/famix/src/model/famix/alias.js +33 -0
  71. package/dist/lib/famix/src/model/famix/arrowFunction.js +17 -0
  72. package/dist/lib/famix/src/model/famix/arrow_function.js +17 -0
  73. package/dist/lib/famix/src/model/famix/behavioral_entity.js +79 -0
  74. package/dist/lib/famix/src/model/famix/class.js +71 -0
  75. package/dist/lib/famix/src/model/famix/comment.js +39 -0
  76. package/dist/lib/famix/src/model/famix/concretisation.js +31 -0
  77. package/dist/lib/famix/src/model/famix/container_entity.js +126 -0
  78. package/dist/lib/famix/src/model/famix/decorator.js +32 -0
  79. package/dist/lib/famix/src/model/famix/entity.js +17 -0
  80. package/dist/lib/famix/src/model/famix/enum.js +31 -0
  81. package/dist/lib/famix/src/model/famix/enum_value.js +25 -0
  82. package/dist/lib/famix/src/model/famix/function.js +17 -0
  83. package/dist/lib/famix/src/model/famix/implicit_variable.js +17 -0
  84. package/dist/lib/famix/src/model/famix/import_clause.js +41 -0
  85. package/dist/lib/famix/src/model/famix/index.js +86 -0
  86. package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +38 -0
  87. package/dist/lib/famix/src/model/famix/inheritance.js +33 -0
  88. package/dist/lib/famix/src/model/famix/interface.js +64 -0
  89. package/dist/lib/famix/src/model/famix/invocation.js +54 -0
  90. package/dist/lib/famix/src/model/famix/method.js +67 -0
  91. package/dist/lib/famix/src/model/famix/module.js +60 -0
  92. package/dist/lib/famix/src/model/famix/named_entity.js +78 -0
  93. package/dist/lib/famix/src/model/famix/parameter.js +25 -0
  94. package/dist/lib/famix/src/model/famix/parameterConcretisation.js +44 -0
  95. package/dist/lib/famix/src/model/famix/parameter_concretisation.js +44 -0
  96. package/dist/lib/famix/src/model/famix/parameter_type.js +45 -0
  97. package/dist/lib/famix/src/model/famix/parametricArrowFunction.js +29 -0
  98. package/dist/lib/famix/src/model/famix/parametric_arrow_function.js +31 -0
  99. package/dist/lib/famix/src/model/famix/parametric_class.js +44 -0
  100. package/dist/lib/famix/src/model/famix/parametric_function.js +31 -0
  101. package/dist/lib/famix/src/model/famix/parametric_interface.js +44 -0
  102. package/dist/lib/famix/src/model/famix/parametric_method.js +31 -0
  103. package/dist/lib/famix/src/model/famix/primitive_type.js +17 -0
  104. package/dist/lib/famix/src/model/famix/property.js +73 -0
  105. package/dist/lib/famix/src/model/famix/reference.js +33 -0
  106. package/dist/lib/famix/src/model/famix/scoping_entity.js +36 -0
  107. package/dist/lib/famix/src/model/famix/script_entity.js +29 -0
  108. package/dist/lib/famix/src/model/famix/source_anchor.js +27 -0
  109. package/dist/lib/famix/src/model/famix/source_language.js +35 -0
  110. package/dist/lib/famix/src/model/famix/sourced_entity.js +60 -0
  111. package/dist/lib/famix/src/model/famix/structural_entity.js +39 -0
  112. package/dist/lib/famix/src/model/famix/text_anchor.js +38 -0
  113. package/dist/lib/famix/src/model/famix/type.js +73 -0
  114. package/dist/lib/famix/src/model/famix/variable.js +24 -0
  115. package/dist/lib/ts-complex/cyclomatic-service.js +1 -1
  116. package/dist/refactorer/refactor-getter-setter.js +18 -8
  117. package/dist/ts2famix-cli-wrapper.js +18 -8
  118. package/dist/ts2famix-cli.js +18 -8
  119. package/dist/ts2famix-tsconfig.js +18 -8
  120. package/doc-uml/famix-typescript-model.puml +607 -607
  121. package/eslint.config.mjs +28 -0
  122. package/fqn-model.json +1 -0
  123. package/iterateGenericTypes.ts +69 -0
  124. package/out/class-diagram/class-diagram.svg +1 -0
  125. package/package.json +70 -66
  126. package/sample.json +1 -0
  127. package/sample.ts +1 -0
  128. package/src/analyze.ts +120 -120
  129. package/src/analyze_functions/process_functions.ts +1040 -1019
  130. package/src/famix_functions/EntityDictionary.ts +2016 -1593
  131. package/src/famix_functions/helpers_creation.ts +135 -135
  132. package/src/fqn.ts +50 -16
  133. package/src/generate_uml.sh +20 -20
  134. package/src/lib/famix/License.md +22 -22
  135. package/src/lib/famix/famix_JSON_exporter.ts +56 -56
  136. package/src/lib/famix/famix_base_element.ts +22 -22
  137. package/src/lib/famix/famix_repository.ts +278 -243
  138. package/src/lib/famix/index.ts +8 -8
  139. package/src/lib/famix/model/famix/access.ts +50 -50
  140. package/src/lib/famix/model/famix/accessor.ts +15 -15
  141. package/src/lib/famix/model/famix/alias.ts +39 -39
  142. package/src/lib/famix/model/famix/arrow_function.ts +15 -15
  143. package/src/lib/famix/model/famix/behavioral_entity.ts +97 -97
  144. package/src/lib/famix/model/famix/class.ts +85 -85
  145. package/src/lib/famix/model/famix/comment.ts +47 -47
  146. package/src/lib/famix/model/famix/concretisation.ts +40 -40
  147. package/src/lib/famix/model/famix/container_entity.ts +160 -160
  148. package/src/lib/famix/model/famix/decorator.ts +37 -37
  149. package/src/lib/famix/model/famix/entity.ts +15 -15
  150. package/src/lib/famix/model/famix/enum.ts +30 -30
  151. package/src/lib/famix/model/famix/enum_value.ts +28 -28
  152. package/src/lib/famix/model/famix/function.ts +15 -15
  153. package/src/lib/famix/model/famix/import_clause.ts +51 -51
  154. package/src/lib/famix/model/famix/index.ts +41 -41
  155. package/src/lib/famix/model/famix/indexed_file_anchor.ts +46 -46
  156. package/src/lib/famix/model/famix/inheritance.ts +40 -40
  157. package/src/lib/famix/model/famix/interface.ts +75 -75
  158. package/src/lib/famix/model/famix/invocation.ts +65 -65
  159. package/src/lib/famix/model/famix/method.ts +89 -89
  160. package/src/lib/famix/model/famix/module.ts +71 -71
  161. package/src/lib/famix/model/famix/named_entity.ts +95 -95
  162. package/src/lib/famix/model/famix/parameter.ts +28 -28
  163. package/src/lib/famix/model/famix/parameter_concretisation.ts +51 -51
  164. package/src/lib/famix/model/famix/parameter_type.ts +58 -58
  165. package/src/lib/famix/model/famix/parametric_arrow_function.ts +32 -32
  166. package/src/lib/famix/model/famix/parametric_class.ts +49 -49
  167. package/src/lib/famix/model/famix/parametric_function.ts +32 -32
  168. package/src/lib/famix/model/famix/parametric_interface.ts +49 -49
  169. package/src/lib/famix/model/famix/parametric_method.ts +32 -32
  170. package/src/lib/famix/model/famix/primitive_type.ts +15 -15
  171. package/src/lib/famix/model/famix/property.ts +94 -94
  172. package/src/lib/famix/model/famix/reference.ts +40 -40
  173. package/src/lib/famix/model/famix/scoping_entity.ts +35 -35
  174. package/src/lib/famix/model/famix/script_entity.ts +34 -34
  175. package/src/lib/famix/model/famix/source_anchor.ts +30 -30
  176. package/src/lib/famix/model/famix/source_language.ts +35 -35
  177. package/src/lib/famix/model/famix/sourced_entity.ts +70 -70
  178. package/src/lib/famix/model/famix/structural_entity.ts +43 -43
  179. package/src/lib/famix/model/famix/type.ts +87 -87
  180. package/src/lib/famix/model/famix/variable.ts +27 -27
  181. package/src/lib/famix/package.json +28 -28
  182. package/src/lib/ts-complex/cyclomatic-service.ts +83 -83
  183. package/src/refactorer/refactor-getter-setter.ts +140 -140
  184. package/src/ts2famix-cli-wrapper.ts +21 -21
  185. package/src/ts2famix-cli.ts +60 -60
  186. package/stats.txt +3091 -0
  187. package/tabby-debug-output.txt +19433 -0
  188. package/ts2famix.log +22656 -0
  189. package/tsconfig.check-tests.json +14 -14
  190. package/tsconfig.json +72 -72
  191. package/validate-references.js +103 -0
@@ -1,28 +1,28 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { StructuralEntity } from "./structural_entity";
3
- import { Enum } from "./enum";
4
-
5
- export class EnumValue extends StructuralEntity {
6
-
7
- private _parentEntity!: Enum;
8
-
9
- public getJSON(): string {
10
- const json: FamixJSONExporter = new FamixJSONExporter("EnumValue", this);
11
- this.addPropertiesToExporter(json);
12
- return json.getJSON();
13
- }
14
-
15
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
16
- super.addPropertiesToExporter(exporter);
17
- exporter.addProperty("parentEnum", this.parentEntity);
18
- }
19
-
20
- get parentEntity(): Enum {
21
- return this._parentEntity;
22
- }
23
-
24
- set parentEntity(parentEntity: Enum) {
25
- this._parentEntity = parentEntity;
26
- parentEntity.addValue(this);
27
- }
28
- }
1
+ import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
+ import { StructuralEntity } from "./structural_entity";
3
+ import { Enum } from "./enum";
4
+
5
+ export class EnumValue extends StructuralEntity {
6
+
7
+ private _parentEntity!: Enum;
8
+
9
+ public getJSON(): string {
10
+ const json: FamixJSONExporter = new FamixJSONExporter("EnumValue", this);
11
+ this.addPropertiesToExporter(json);
12
+ return json.getJSON();
13
+ }
14
+
15
+ public addPropertiesToExporter(exporter: FamixJSONExporter): void {
16
+ super.addPropertiesToExporter(exporter);
17
+ exporter.addProperty("parentEnum", this.parentEntity);
18
+ }
19
+
20
+ get parentEntity(): Enum {
21
+ return this._parentEntity;
22
+ }
23
+
24
+ set parentEntity(parentEntity: Enum) {
25
+ this._parentEntity = parentEntity;
26
+ parentEntity.addValue(this);
27
+ }
28
+ }
@@ -1,15 +1,15 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { BehavioralEntity } from "./behavioral_entity";
3
-
4
- export class Function extends BehavioralEntity {
5
-
6
- public getJSON(): string {
7
- const json: FamixJSONExporter = new FamixJSONExporter("Function", this);
8
- this.addPropertiesToExporter(json);
9
- return json.getJSON();
10
- }
11
-
12
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
13
- super.addPropertiesToExporter(exporter);
14
- }
15
- }
1
+ import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
+ import { BehavioralEntity } from "./behavioral_entity";
3
+
4
+ export class Function extends BehavioralEntity {
5
+
6
+ public getJSON(): string {
7
+ const json: FamixJSONExporter = new FamixJSONExporter("Function", this);
8
+ this.addPropertiesToExporter(json);
9
+ return json.getJSON();
10
+ }
11
+
12
+ public addPropertiesToExporter(exporter: FamixJSONExporter): void {
13
+ super.addPropertiesToExporter(exporter);
14
+ }
15
+ }
@@ -1,51 +1,51 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Entity } from "./entity";
3
- import { Module } from "./module";
4
- import { NamedEntity } from "./named_entity";
5
-
6
- export class ImportClause extends Entity {
7
-
8
- private _importingEntity!: Module;
9
- private _importedEntity!: NamedEntity;
10
- private _moduleSpecifier!: string;
11
-
12
- public getJSON(): string {
13
- const json: FamixJSONExporter = new FamixJSONExporter("ImportClause", this);
14
- this.addPropertiesToExporter(json);
15
- return json.getJSON();
16
- }
17
-
18
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
19
- super.addPropertiesToExporter(exporter);
20
- exporter.addProperty("importingEntity", this.importingEntity);
21
- exporter.addProperty("importedEntity", this.importedEntity);
22
- // unknown property below
23
- // exporter.addProperty("moduleSpecifier", this.getModuleSpecifier());
24
- }
25
-
26
- get importingEntity(): Module {
27
- return this._importingEntity;
28
- }
29
-
30
- set importingEntity(importer: Module) {
31
- this._importingEntity = importer;
32
- importer.addOutgoingImport(this); // opposite
33
- }
34
-
35
- get importedEntity(): NamedEntity {
36
- return this._importedEntity;
37
- }
38
-
39
- set importedEntity(importedEntity: NamedEntity) {
40
- this._importedEntity = importedEntity;
41
- importedEntity.addIncomingImport(this); // incomingImports in Famix TImportable/TImport
42
- }
43
-
44
- get moduleSpecifier(): string {
45
- return this._moduleSpecifier;
46
- }
47
-
48
- set moduleSpecifier(moduleSpecifier: string) {
49
- this._moduleSpecifier = moduleSpecifier;
50
- }
51
- }
1
+ import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
+ import { Entity } from "./entity";
3
+ import { Module } from "./module";
4
+ import { NamedEntity } from "./named_entity";
5
+
6
+ export class ImportClause extends Entity {
7
+
8
+ private _importingEntity!: Module;
9
+ private _importedEntity!: NamedEntity;
10
+ private _moduleSpecifier!: string;
11
+
12
+ public getJSON(): string {
13
+ const json: FamixJSONExporter = new FamixJSONExporter("ImportClause", this);
14
+ this.addPropertiesToExporter(json);
15
+ return json.getJSON();
16
+ }
17
+
18
+ public addPropertiesToExporter(exporter: FamixJSONExporter): void {
19
+ super.addPropertiesToExporter(exporter);
20
+ exporter.addProperty("importingEntity", this.importingEntity);
21
+ exporter.addProperty("importedEntity", this.importedEntity);
22
+ // unknown property below
23
+ // exporter.addProperty("moduleSpecifier", this.getModuleSpecifier());
24
+ }
25
+
26
+ get importingEntity(): Module {
27
+ return this._importingEntity;
28
+ }
29
+
30
+ set importingEntity(importer: Module) {
31
+ this._importingEntity = importer;
32
+ importer.addOutgoingImport(this); // opposite
33
+ }
34
+
35
+ get importedEntity(): NamedEntity {
36
+ return this._importedEntity;
37
+ }
38
+
39
+ set importedEntity(importedEntity: NamedEntity) {
40
+ this._importedEntity = importedEntity;
41
+ importedEntity.addIncomingImport(this); // incomingImports in Famix TImportable/TImport
42
+ }
43
+
44
+ get moduleSpecifier(): string {
45
+ return this._moduleSpecifier;
46
+ }
47
+
48
+ set moduleSpecifier(moduleSpecifier: string) {
49
+ this._moduleSpecifier = moduleSpecifier;
50
+ }
51
+ }
@@ -1,41 +1,41 @@
1
- export { Access } from "./access";
2
- export { Accessor } from "./accessor";
3
- export { Alias } from "./alias";
4
- export { BehavioralEntity } from "./behavioral_entity";
5
- export { Class } from "./class";
6
- export { Comment } from "./comment";
7
- export { ContainerEntity } from "./container_entity";
8
- export { Concretisation } from "./concretisation";
9
- export { Decorator } from "./decorator";
10
- export { Entity } from "./entity";
11
- export { EnumValue } from "./enum_value";
12
- export { Enum } from "./enum";
13
- export { Property } from "./property";
14
- export { Function } from "./function";
15
- export { ImportClause } from "./import_clause";
16
- export { IndexedFileAnchor } from "./indexed_file_anchor";
17
- export { Inheritance } from "./inheritance";
18
- export { Interface } from "./interface";
19
- export { Invocation } from "./invocation";
20
- export { Method } from "./method";
21
- export { Module } from "./module";
22
- export { NamedEntity } from "./named_entity";
23
- export { ParameterType } from "./parameter_type";
24
- export { Parameter } from "./parameter";
25
- export { ParametricClass } from "./parametric_class";
26
- export { ParametricInterface } from "./parametric_interface";
27
- export { PrimitiveType } from "./primitive_type";
28
- export { Reference } from "./reference";
29
- export { ScopingEntity } from "./scoping_entity";
30
- export { ScriptEntity } from "./script_entity";
31
- export { SourceAnchor } from "./source_anchor";
32
- export { SourceLanguage } from "./source_language";
33
- export { SourcedEntity } from "./sourced_entity";
34
- export { StructuralEntity } from "./structural_entity";
35
- export { Type } from "./type";
36
- export { Variable } from "./variable";
37
- export { ParametricFunction } from "./parametric_function";
38
- export { ParametricMethod } from "./parametric_method";
39
- export { ArrowFunction } from "./arrow_function";
40
- export { ParametricArrowFunction } from "./parametric_arrow_function";
41
- export { ParameterConcretisation } from "./parameter_concretisation";
1
+ export { Access } from "./access";
2
+ export { Accessor } from "./accessor";
3
+ export { Alias } from "./alias";
4
+ export { BehavioralEntity } from "./behavioral_entity";
5
+ export { Class } from "./class";
6
+ export { Comment } from "./comment";
7
+ export { ContainerEntity } from "./container_entity";
8
+ export { Concretisation } from "./concretisation";
9
+ export { Decorator } from "./decorator";
10
+ export { Entity } from "./entity";
11
+ export { EnumValue } from "./enum_value";
12
+ export { Enum } from "./enum";
13
+ export { Property } from "./property";
14
+ export { Function } from "./function";
15
+ export { ImportClause } from "./import_clause";
16
+ export { IndexedFileAnchor } from "./indexed_file_anchor";
17
+ export { Inheritance } from "./inheritance";
18
+ export { Interface } from "./interface";
19
+ export { Invocation } from "./invocation";
20
+ export { Method } from "./method";
21
+ export { Module } from "./module";
22
+ export { NamedEntity } from "./named_entity";
23
+ export { ParameterType } from "./parameter_type";
24
+ export { Parameter } from "./parameter";
25
+ export { ParametricClass } from "./parametric_class";
26
+ export { ParametricInterface } from "./parametric_interface";
27
+ export { PrimitiveType } from "./primitive_type";
28
+ export { Reference } from "./reference";
29
+ export { ScopingEntity } from "./scoping_entity";
30
+ export { ScriptEntity } from "./script_entity";
31
+ export { SourceAnchor } from "./source_anchor";
32
+ export { SourceLanguage } from "./source_language";
33
+ export { SourcedEntity } from "./sourced_entity";
34
+ export { StructuralEntity } from "./structural_entity";
35
+ export { Type } from "./type";
36
+ export { Variable } from "./variable";
37
+ export { ParametricFunction } from "./parametric_function";
38
+ export { ParametricMethod } from "./parametric_method";
39
+ export { ArrowFunction } from "./arrow_function";
40
+ export { ParametricArrowFunction } from "./parametric_arrow_function";
41
+ export { ParameterConcretisation } from "./parameter_concretisation";
@@ -1,46 +1,46 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { SourceAnchor } from "./source_anchor";
3
-
4
- export class IndexedFileAnchor extends SourceAnchor {
5
-
6
- private _startPos!: number;
7
- private _endPos!: number;
8
- private _fileName!: string;
9
-
10
- public getJSON(): string {
11
- const json: FamixJSONExporter = new FamixJSONExporter("IndexedFileAnchor", this);
12
- this.addPropertiesToExporter(json);
13
- return json.getJSON();
14
- }
15
-
16
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
17
- super.addPropertiesToExporter(exporter);
18
- exporter.addProperty("startPos", this.startPos);
19
- exporter.addProperty("endPos", this.endPos);
20
- exporter.addProperty("fileName", this.fileName);
21
- }
22
-
23
- get startPos(): number {
24
- return this._startPos;
25
- }
26
-
27
- set startPos(startPos: number) {
28
- this._startPos = startPos;
29
- }
30
-
31
- get endPos(): number {
32
- return this._endPos;
33
- }
34
-
35
- set endPos(endPos: number) {
36
- this._endPos = endPos;
37
- }
38
-
39
- get fileName(): string {
40
- return this._fileName;
41
- }
42
-
43
- set fileName(fileName: string) {
44
- this._fileName = fileName;
45
- }
46
- }
1
+ import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
+ import { SourceAnchor } from "./source_anchor";
3
+
4
+ export class IndexedFileAnchor extends SourceAnchor {
5
+
6
+ private _startPos!: number;
7
+ private _endPos!: number;
8
+ private _fileName!: string;
9
+
10
+ public getJSON(): string {
11
+ const json: FamixJSONExporter = new FamixJSONExporter("IndexedFileAnchor", this);
12
+ this.addPropertiesToExporter(json);
13
+ return json.getJSON();
14
+ }
15
+
16
+ public addPropertiesToExporter(exporter: FamixJSONExporter): void {
17
+ super.addPropertiesToExporter(exporter);
18
+ exporter.addProperty("startPos", this.startPos);
19
+ exporter.addProperty("endPos", this.endPos);
20
+ exporter.addProperty("fileName", this.fileName);
21
+ }
22
+
23
+ get startPos(): number {
24
+ return this._startPos;
25
+ }
26
+
27
+ set startPos(startPos: number) {
28
+ this._startPos = startPos;
29
+ }
30
+
31
+ get endPos(): number {
32
+ return this._endPos;
33
+ }
34
+
35
+ set endPos(endPos: number) {
36
+ this._endPos = endPos;
37
+ }
38
+
39
+ get fileName(): string {
40
+ return this._fileName;
41
+ }
42
+
43
+ set fileName(fileName: string) {
44
+ this._fileName = fileName;
45
+ }
46
+ }
@@ -1,40 +1,40 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Class } from "./class";
3
- import { Entity } from "./entity";
4
- import { Interface } from "./interface";
5
-
6
- export class Inheritance extends Entity {
7
-
8
- private _superclass!: Class | Interface;
9
- private _subclass!: Class | Interface;
10
-
11
- public getJSON(): string {
12
- const json: FamixJSONExporter = new FamixJSONExporter("Inheritance", this);
13
- this.addPropertiesToExporter(json);
14
- return json.getJSON();
15
- }
16
-
17
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
18
- super.addPropertiesToExporter(exporter);
19
- exporter.addProperty("superclass", this.superclass);
20
- exporter.addProperty("subclass", this.subclass);
21
- }
22
-
23
- get superclass() {
24
- return this._superclass;
25
- }
26
-
27
- set superclass(superclass: Class | Interface) {
28
- this._superclass = superclass;
29
- superclass.addSubInheritance(this);
30
- }
31
-
32
- get subclass() {
33
- return this._subclass;
34
- }
35
-
36
- set subclass(subclass: Class | Interface) {
37
- this._subclass = subclass;
38
- subclass.addSuperInheritance(this);
39
- }
40
- }
1
+ import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
+ import { Class } from "./class";
3
+ import { Entity } from "./entity";
4
+ import { Interface } from "./interface";
5
+
6
+ export class Inheritance extends Entity {
7
+
8
+ private _superclass!: Class | Interface;
9
+ private _subclass!: Class | Interface;
10
+
11
+ public getJSON(): string {
12
+ const json: FamixJSONExporter = new FamixJSONExporter("Inheritance", this);
13
+ this.addPropertiesToExporter(json);
14
+ return json.getJSON();
15
+ }
16
+
17
+ public addPropertiesToExporter(exporter: FamixJSONExporter): void {
18
+ super.addPropertiesToExporter(exporter);
19
+ exporter.addProperty("superclass", this.superclass);
20
+ exporter.addProperty("subclass", this.subclass);
21
+ }
22
+
23
+ get superclass() {
24
+ return this._superclass;
25
+ }
26
+
27
+ set superclass(superclass: Class | Interface) {
28
+ this._superclass = superclass;
29
+ superclass.addSubInheritance(this);
30
+ }
31
+
32
+ get subclass() {
33
+ return this._subclass;
34
+ }
35
+
36
+ set subclass(subclass: Class | Interface) {
37
+ this._subclass = subclass;
38
+ subclass.addSuperInheritance(this);
39
+ }
40
+ }
@@ -1,75 +1,75 @@
1
- import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
- import { Type } from "./type";
3
- import { Method } from "./method";
4
- import { Property } from "./property";
5
- import { Inheritance } from "./inheritance";
6
-
7
- export class Interface extends Type {
8
-
9
- private _properties: Set<Property> = new Set();
10
-
11
- public addProperty(property: Property): void {
12
- if (!this._properties.has(property)) {
13
- this._properties.add(property);
14
- property.parentEntity = this;
15
- }
16
- }
17
-
18
- private _methods: Set<Method> = new Set();
19
-
20
- public addMethod(method: Method): void {
21
- if (!this._methods.has(method)) {
22
- this._methods.add(method);
23
- method.parentEntity = this;
24
- }
25
- }
26
-
27
- private _superInheritances: Set<Inheritance> = new Set();
28
-
29
- public addSuperInheritance(superInheritance: Inheritance): void {
30
- if (!this._superInheritances.has(superInheritance)) {
31
- this._superInheritances.add(superInheritance);
32
- superInheritance.subclass = this;
33
- }
34
- }
35
-
36
- private _subInheritances: Set<Inheritance> = new Set();
37
-
38
- public addSubInheritance(subInheritance: Inheritance): void {
39
- if (!this._subInheritances.has(subInheritance)) {
40
- this._subInheritances.add(subInheritance);
41
- subInheritance.superclass = this;
42
- }
43
- }
44
-
45
-
46
- public getJSON(): string {
47
- const json: FamixJSONExporter = new FamixJSONExporter("Interface", this);
48
- this.addPropertiesToExporter(json);
49
- return json.getJSON();
50
- }
51
-
52
- public addPropertiesToExporter(exporter: FamixJSONExporter): void {
53
- super.addPropertiesToExporter(exporter);
54
- exporter.addProperty("attributes", this.properties);
55
- exporter.addProperty("methods", this.methods);
56
- exporter.addProperty("superInheritances", this.superInheritances);
57
- exporter.addProperty("subInheritances", this.subInheritances);
58
- }
59
-
60
- get properties() {
61
- return this._properties;
62
- }
63
-
64
- get methods() {
65
- return this._methods;
66
- }
67
-
68
- get superInheritances() {
69
- return this._superInheritances;
70
- }
71
-
72
- get subInheritances() {
73
- return this._subInheritances;
74
- }
75
- }
1
+ import { FamixJSONExporter } from "../../famix_JSON_exporter";
2
+ import { Type } from "./type";
3
+ import { Method } from "./method";
4
+ import { Property } from "./property";
5
+ import { Inheritance } from "./inheritance";
6
+
7
+ export class Interface extends Type {
8
+
9
+ private _properties: Set<Property> = new Set();
10
+
11
+ public addProperty(property: Property): void {
12
+ if (!this._properties.has(property)) {
13
+ this._properties.add(property);
14
+ property.parentEntity = this;
15
+ }
16
+ }
17
+
18
+ private _methods: Set<Method> = new Set();
19
+
20
+ public addMethod(method: Method): void {
21
+ if (!this._methods.has(method)) {
22
+ this._methods.add(method);
23
+ method.parentEntity = this;
24
+ }
25
+ }
26
+
27
+ private _superInheritances: Set<Inheritance> = new Set();
28
+
29
+ public addSuperInheritance(superInheritance: Inheritance): void {
30
+ if (!this._superInheritances.has(superInheritance)) {
31
+ this._superInheritances.add(superInheritance);
32
+ superInheritance.subclass = this;
33
+ }
34
+ }
35
+
36
+ private _subInheritances: Set<Inheritance> = new Set();
37
+
38
+ public addSubInheritance(subInheritance: Inheritance): void {
39
+ if (!this._subInheritances.has(subInheritance)) {
40
+ this._subInheritances.add(subInheritance);
41
+ subInheritance.superclass = this;
42
+ }
43
+ }
44
+
45
+
46
+ public getJSON(): string {
47
+ const json: FamixJSONExporter = new FamixJSONExporter("Interface", this);
48
+ this.addPropertiesToExporter(json);
49
+ return json.getJSON();
50
+ }
51
+
52
+ public addPropertiesToExporter(exporter: FamixJSONExporter): void {
53
+ super.addPropertiesToExporter(exporter);
54
+ exporter.addProperty("attributes", this.properties);
55
+ exporter.addProperty("methods", this.methods);
56
+ exporter.addProperty("superInheritances", this.superInheritances);
57
+ exporter.addProperty("subInheritances", this.subInheritances);
58
+ }
59
+
60
+ get properties() {
61
+ return this._properties;
62
+ }
63
+
64
+ get methods() {
65
+ return this._methods;
66
+ }
67
+
68
+ get superInheritances() {
69
+ return this._superInheritances;
70
+ }
71
+
72
+ get subInheritances() {
73
+ return this._subInheritances;
74
+ }
75
+ }