ts2famix 2.1.0-beta.2 → 3.1.0
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.
- package/.eslintrc.json +24 -24
- package/LICENSE +24 -24
- package/README.md +78 -78
- package/dist/analyze.js +3 -3
- package/dist/analyze_functions/process_functions.js +92 -62
- package/dist/famix_functions/EntityDictionary.js +674 -599
- package/dist/famix_functions/helpers_creation.js +18 -12
- package/dist/fqn.js +351 -18
- package/dist/lib/famix/famix_JSON_exporter.js +1 -1
- package/dist/lib/famix/famix_base_element.js +1 -1
- package/dist/lib/famix/famix_repository.js +14 -5
- package/dist/lib/famix/index.js +1 -1
- package/dist/lib/famix/model/famix/access.js +1 -1
- package/dist/lib/famix/model/famix/accessor.js +1 -1
- package/dist/lib/famix/model/famix/alias.js +1 -1
- package/dist/lib/famix/model/famix/arrow_function.js +1 -1
- package/dist/lib/famix/model/famix/behavioral_entity.js +1 -1
- package/dist/lib/famix/model/famix/class.js +1 -1
- package/dist/lib/famix/model/famix/comment.js +1 -1
- package/dist/lib/famix/model/famix/concretisation.js +1 -1
- package/dist/lib/famix/model/famix/container_entity.js +1 -1
- package/dist/lib/famix/model/famix/decorator.js +1 -1
- package/dist/lib/famix/model/famix/entity.js +1 -1
- package/dist/lib/famix/model/famix/enum.js +1 -1
- package/dist/lib/famix/model/famix/enum_value.js +1 -1
- package/dist/lib/famix/model/famix/function.js +1 -1
- package/dist/lib/famix/model/famix/import_clause.js +1 -1
- package/dist/lib/famix/model/famix/index.js +1 -1
- package/dist/lib/famix/model/famix/indexed_file_anchor.js +1 -1
- package/dist/lib/famix/model/famix/inheritance.js +1 -1
- package/dist/lib/famix/model/famix/interface.js +1 -1
- package/dist/lib/famix/model/famix/invocation.js +1 -1
- package/dist/lib/famix/model/famix/method.js +1 -1
- package/dist/lib/famix/model/famix/module.js +2 -2
- package/dist/lib/famix/model/famix/named_entity.js +1 -1
- package/dist/lib/famix/model/famix/parameter.js +1 -1
- package/dist/lib/famix/model/famix/parameter_concretisation.js +1 -1
- package/dist/lib/famix/model/famix/parameter_type.js +1 -1
- package/dist/lib/famix/model/famix/parametric_arrow_function.js +1 -1
- package/dist/lib/famix/model/famix/parametric_class.js +1 -1
- package/dist/lib/famix/model/famix/parametric_function.js +1 -1
- package/dist/lib/famix/model/famix/parametric_interface.js +1 -1
- package/dist/lib/famix/model/famix/parametric_method.js +1 -1
- package/dist/lib/famix/model/famix/primitive_type.js +1 -1
- package/dist/lib/famix/model/famix/property.js +1 -1
- package/dist/lib/famix/model/famix/reference.js +1 -1
- package/dist/lib/famix/model/famix/scoping_entity.js +1 -1
- package/dist/lib/famix/model/famix/script_entity.js +1 -1
- package/dist/lib/famix/model/famix/source_anchor.js +1 -1
- package/dist/lib/famix/model/famix/source_language.js +1 -1
- package/dist/lib/famix/model/famix/sourced_entity.js +1 -1
- package/dist/lib/famix/model/famix/structural_entity.js +1 -1
- package/dist/lib/famix/model/famix/type.js +1 -1
- package/dist/lib/famix/model/famix/variable.js +1 -1
- package/dist/lib/ts-complex/cyclomatic-service.js +1 -1
- package/dist/refactorer/refactor-getter-setter.js +1 -1
- package/dist/ts2famix-cli-wrapper.js +1 -1
- package/dist/ts2famix-cli.js +3 -1
- package/doc-uml/famix-typescript-model.puml +619 -607
- package/doc-uml/famix-typescript-model.svg +1 -1
- package/eslint.config.mjs +28 -28
- package/jest.config.json +1 -1
- package/package.json +70 -70
- package/src/analyze.ts +120 -120
- package/src/analyze_functions/process_functions.ts +1069 -1040
- package/src/famix_functions/EntityDictionary.ts +2061 -2016
- package/src/famix_functions/helpers_creation.ts +143 -135
- package/src/fqn.ts +416 -50
- package/src/generate_uml.sh +20 -20
- package/src/lib/famix/License.md +22 -22
- package/src/lib/famix/famix_JSON_exporter.ts +56 -56
- package/src/lib/famix/famix_base_element.ts +22 -22
- package/src/lib/famix/famix_repository.ts +288 -278
- package/src/lib/famix/index.ts +8 -8
- package/src/lib/famix/model/famix/access.ts +50 -50
- package/src/lib/famix/model/famix/accessor.ts +15 -15
- package/src/lib/famix/model/famix/alias.ts +39 -39
- package/src/lib/famix/model/famix/arrow_function.ts +15 -15
- package/src/lib/famix/model/famix/behavioral_entity.ts +97 -97
- package/src/lib/famix/model/famix/class.ts +85 -85
- package/src/lib/famix/model/famix/comment.ts +47 -47
- package/src/lib/famix/model/famix/concretisation.ts +40 -40
- package/src/lib/famix/model/famix/container_entity.ts +160 -160
- package/src/lib/famix/model/famix/decorator.ts +37 -37
- package/src/lib/famix/model/famix/entity.ts +15 -15
- package/src/lib/famix/model/famix/enum.ts +30 -30
- package/src/lib/famix/model/famix/enum_value.ts +28 -28
- package/src/lib/famix/model/famix/function.ts +15 -15
- package/src/lib/famix/model/famix/import_clause.ts +51 -51
- package/src/lib/famix/model/famix/index.ts +41 -41
- package/src/lib/famix/model/famix/indexed_file_anchor.ts +46 -46
- package/src/lib/famix/model/famix/inheritance.ts +40 -40
- package/src/lib/famix/model/famix/interface.ts +75 -75
- package/src/lib/famix/model/famix/invocation.ts +65 -65
- package/src/lib/famix/model/famix/method.ts +89 -89
- package/src/lib/famix/model/famix/module.ts +71 -71
- package/src/lib/famix/model/famix/named_entity.ts +95 -95
- package/src/lib/famix/model/famix/parameter.ts +28 -28
- package/src/lib/famix/model/famix/parameter_concretisation.ts +51 -51
- package/src/lib/famix/model/famix/parameter_type.ts +58 -58
- package/src/lib/famix/model/famix/parametric_arrow_function.ts +32 -32
- package/src/lib/famix/model/famix/parametric_class.ts +49 -49
- package/src/lib/famix/model/famix/parametric_function.ts +32 -32
- package/src/lib/famix/model/famix/parametric_interface.ts +49 -49
- package/src/lib/famix/model/famix/parametric_method.ts +32 -32
- package/src/lib/famix/model/famix/primitive_type.ts +15 -15
- package/src/lib/famix/model/famix/property.ts +94 -94
- package/src/lib/famix/model/famix/reference.ts +40 -40
- package/src/lib/famix/model/famix/scoping_entity.ts +35 -35
- package/src/lib/famix/model/famix/script_entity.ts +34 -34
- package/src/lib/famix/model/famix/source_anchor.ts +30 -30
- package/src/lib/famix/model/famix/source_language.ts +35 -35
- package/src/lib/famix/model/famix/sourced_entity.ts +70 -70
- package/src/lib/famix/model/famix/structural_entity.ts +43 -43
- package/src/lib/famix/model/famix/type.ts +87 -87
- package/src/lib/famix/model/famix/variable.ts +27 -27
- package/src/lib/famix/package.json +28 -28
- package/src/lib/ts-complex/cyclomatic-service.ts +83 -83
- package/src/refactorer/refactor-getter-setter.ts +140 -140
- package/src/ts2famix-cli-wrapper.ts +21 -21
- package/src/ts2famix-cli.ts +62 -60
- package/tsconfig.check-tests.json +14 -14
- package/tsconfig.json +73 -72
- package/.vscode/settings.json +0 -4
- package/TODO +0 -1
- package/arwea-fix.json +0 -1
- package/bogus.ts +0 -3
- package/class-diagram.puml +0 -792
- package/debug.txt +0 -13332
- package/debuglog.txt +0 -12073
- package/dist/famix2puml.js +0 -126
- package/dist/getClasses-arrow-body.js +0 -43
- package/dist/lib/famix/src/famix_JSON_exporter.js +0 -55
- package/dist/lib/famix/src/famix_base_element.js +0 -18
- package/dist/lib/famix/src/famix_repository.js +0 -224
- package/dist/lib/famix/src/index.js +0 -31
- package/dist/lib/famix/src/model/famix/access.js +0 -40
- package/dist/lib/famix/src/model/famix/accessor.js +0 -17
- package/dist/lib/famix/src/model/famix/alias.js +0 -33
- package/dist/lib/famix/src/model/famix/arrowFunction.js +0 -17
- package/dist/lib/famix/src/model/famix/arrow_function.js +0 -17
- package/dist/lib/famix/src/model/famix/behavioral_entity.js +0 -79
- package/dist/lib/famix/src/model/famix/class.js +0 -71
- package/dist/lib/famix/src/model/famix/comment.js +0 -39
- package/dist/lib/famix/src/model/famix/concretisation.js +0 -31
- package/dist/lib/famix/src/model/famix/container_entity.js +0 -126
- package/dist/lib/famix/src/model/famix/decorator.js +0 -32
- package/dist/lib/famix/src/model/famix/entity.js +0 -17
- package/dist/lib/famix/src/model/famix/enum.js +0 -31
- package/dist/lib/famix/src/model/famix/enum_value.js +0 -25
- package/dist/lib/famix/src/model/famix/function.js +0 -17
- package/dist/lib/famix/src/model/famix/implicit_variable.js +0 -17
- package/dist/lib/famix/src/model/famix/import_clause.js +0 -41
- package/dist/lib/famix/src/model/famix/index.js +0 -86
- package/dist/lib/famix/src/model/famix/indexed_file_anchor.js +0 -38
- package/dist/lib/famix/src/model/famix/inheritance.js +0 -33
- package/dist/lib/famix/src/model/famix/interface.js +0 -64
- package/dist/lib/famix/src/model/famix/invocation.js +0 -54
- package/dist/lib/famix/src/model/famix/method.js +0 -67
- package/dist/lib/famix/src/model/famix/module.js +0 -60
- package/dist/lib/famix/src/model/famix/named_entity.js +0 -78
- package/dist/lib/famix/src/model/famix/parameter.js +0 -25
- package/dist/lib/famix/src/model/famix/parameterConcretisation.js +0 -44
- package/dist/lib/famix/src/model/famix/parameter_concretisation.js +0 -44
- package/dist/lib/famix/src/model/famix/parameter_type.js +0 -45
- package/dist/lib/famix/src/model/famix/parametricArrowFunction.js +0 -29
- package/dist/lib/famix/src/model/famix/parametric_arrow_function.js +0 -31
- package/dist/lib/famix/src/model/famix/parametric_class.js +0 -44
- package/dist/lib/famix/src/model/famix/parametric_function.js +0 -31
- package/dist/lib/famix/src/model/famix/parametric_interface.js +0 -44
- package/dist/lib/famix/src/model/famix/parametric_method.js +0 -31
- package/dist/lib/famix/src/model/famix/primitive_type.js +0 -17
- package/dist/lib/famix/src/model/famix/property.js +0 -73
- package/dist/lib/famix/src/model/famix/reference.js +0 -33
- package/dist/lib/famix/src/model/famix/scoping_entity.js +0 -36
- package/dist/lib/famix/src/model/famix/script_entity.js +0 -29
- package/dist/lib/famix/src/model/famix/source_anchor.js +0 -27
- package/dist/lib/famix/src/model/famix/source_language.js +0 -35
- package/dist/lib/famix/src/model/famix/sourced_entity.js +0 -60
- package/dist/lib/famix/src/model/famix/structural_entity.js +0 -39
- package/dist/lib/famix/src/model/famix/text_anchor.js +0 -38
- package/dist/lib/famix/src/model/famix/type.js +0 -73
- package/dist/lib/famix/src/model/famix/variable.js +0 -24
- package/fqn-model.json +0 -1
- package/iterateGenericTypes.ts +0 -69
- package/out/class-diagram/class-diagram.svg +0 -1
- package/sample.json +0 -1
- package/sample.ts +0 -1
- package/stats.txt +0 -3091
- package/tabby-debug-output.txt +0 -19433
- package/ts2famix.log +0 -22656
- package/validate-references.js +0 -103
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { SourceLanguage } from "./source_language";
|
|
3
|
-
import { Entity } from "./entity";
|
|
4
|
-
import { Comment } from "./comment";
|
|
5
|
-
import { SourceAnchor } from "./source_anchor";
|
|
6
|
-
import { logger } from "../../../../analyze";
|
|
7
|
-
|
|
8
|
-
export class SourcedEntity extends Entity {
|
|
9
|
-
|
|
10
|
-
private _isStub!: boolean;
|
|
11
|
-
private _sourceAnchor!: SourceAnchor;
|
|
12
|
-
private _comments: Set<Comment> = new Set();
|
|
13
|
-
|
|
14
|
-
public addComment(comment: Comment): void {
|
|
15
|
-
if (!this._comments.has(comment)) {
|
|
16
|
-
this._comments.add(comment);
|
|
17
|
-
comment.container = this;
|
|
18
|
-
} else {
|
|
19
|
-
logger.debug("Adding comment that is already in comments: " + comment.getJSON() + " to " + this.getJSON());
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private _declaredSourceLanguage!: SourceLanguage;
|
|
24
|
-
|
|
25
|
-
public getJSON(): string {
|
|
26
|
-
const json: FamixJSONExporter = new FamixJSONExporter("SourcedEntity", this);
|
|
27
|
-
this.addPropertiesToExporter(json);
|
|
28
|
-
return json.getJSON();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
32
|
-
super.addPropertiesToExporter(exporter);
|
|
33
|
-
exporter.addProperty("isStub", this.isStub);
|
|
34
|
-
exporter.addProperty("sourceAnchor", this.sourceAnchor);
|
|
35
|
-
exporter.addProperty("comments", this.comments);
|
|
36
|
-
exporter.addProperty("declaredSourceLanguage", this.declaredSourceLanguage);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
get isStub() {
|
|
40
|
-
return this._isStub;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
set isStub(isStub: boolean) {
|
|
44
|
-
this._isStub = isStub;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
get sourceAnchor() {
|
|
48
|
-
return this._sourceAnchor;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
set sourceAnchor(sourceAnchor: SourceAnchor) {
|
|
52
|
-
if (this._sourceAnchor === undefined) {
|
|
53
|
-
this._sourceAnchor = sourceAnchor;
|
|
54
|
-
sourceAnchor.element = this;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get comments() {
|
|
59
|
-
return this._comments;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
get declaredSourceLanguage() {
|
|
63
|
-
return this._declaredSourceLanguage;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
set declaredSourceLanguage(declaredSourceLanguage: SourceLanguage) {
|
|
67
|
-
this._declaredSourceLanguage = declaredSourceLanguage;
|
|
68
|
-
declaredSourceLanguage.addSourcedEntity(this);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { SourceLanguage } from "./source_language";
|
|
3
|
+
import { Entity } from "./entity";
|
|
4
|
+
import { Comment } from "./comment";
|
|
5
|
+
import { SourceAnchor } from "./source_anchor";
|
|
6
|
+
import { logger } from "../../../../analyze";
|
|
7
|
+
|
|
8
|
+
export class SourcedEntity extends Entity {
|
|
9
|
+
|
|
10
|
+
private _isStub!: boolean;
|
|
11
|
+
private _sourceAnchor!: SourceAnchor;
|
|
12
|
+
private _comments: Set<Comment> = new Set();
|
|
13
|
+
|
|
14
|
+
public addComment(comment: Comment): void {
|
|
15
|
+
if (!this._comments.has(comment)) {
|
|
16
|
+
this._comments.add(comment);
|
|
17
|
+
comment.container = this;
|
|
18
|
+
} else {
|
|
19
|
+
logger.debug("Adding comment that is already in comments: " + comment.getJSON() + " to " + this.getJSON());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private _declaredSourceLanguage!: SourceLanguage;
|
|
24
|
+
|
|
25
|
+
public getJSON(): string {
|
|
26
|
+
const json: FamixJSONExporter = new FamixJSONExporter("SourcedEntity", this);
|
|
27
|
+
this.addPropertiesToExporter(json);
|
|
28
|
+
return json.getJSON();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
32
|
+
super.addPropertiesToExporter(exporter);
|
|
33
|
+
exporter.addProperty("isStub", this.isStub);
|
|
34
|
+
exporter.addProperty("sourceAnchor", this.sourceAnchor);
|
|
35
|
+
exporter.addProperty("comments", this.comments);
|
|
36
|
+
exporter.addProperty("declaredSourceLanguage", this.declaredSourceLanguage);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get isStub() {
|
|
40
|
+
return this._isStub;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set isStub(isStub: boolean) {
|
|
44
|
+
this._isStub = isStub;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get sourceAnchor() {
|
|
48
|
+
return this._sourceAnchor;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
set sourceAnchor(sourceAnchor: SourceAnchor) {
|
|
52
|
+
if (this._sourceAnchor === undefined) {
|
|
53
|
+
this._sourceAnchor = sourceAnchor;
|
|
54
|
+
sourceAnchor.element = this;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get comments() {
|
|
59
|
+
return this._comments;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get declaredSourceLanguage() {
|
|
63
|
+
return this._declaredSourceLanguage;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set declaredSourceLanguage(declaredSourceLanguage: SourceLanguage) {
|
|
67
|
+
this._declaredSourceLanguage = declaredSourceLanguage;
|
|
68
|
+
declaredSourceLanguage.addSourcedEntity(this);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { Type } from "./type";
|
|
3
|
-
import { Access } from "./access";
|
|
4
|
-
import { NamedEntity } from "./named_entity";
|
|
5
|
-
|
|
6
|
-
export class StructuralEntity extends NamedEntity {
|
|
7
|
-
|
|
8
|
-
private _incomingAccesses: Set<Access> = new Set();
|
|
9
|
-
|
|
10
|
-
public addIncomingAccess(incomingAccess: Access): void {
|
|
11
|
-
if (!this._incomingAccesses.has(incomingAccess)) {
|
|
12
|
-
this._incomingAccesses.add(incomingAccess);
|
|
13
|
-
incomingAccess.variable = this;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
private _declaredType!: Type;
|
|
18
|
-
|
|
19
|
-
public getJSON(): string {
|
|
20
|
-
const json: FamixJSONExporter = new FamixJSONExporter("StructuralEntity", this);
|
|
21
|
-
this.addPropertiesToExporter(json);
|
|
22
|
-
return json.getJSON();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
26
|
-
super.addPropertiesToExporter(exporter);
|
|
27
|
-
exporter.addProperty("incomingAccesses", this.incomingAccesses);
|
|
28
|
-
exporter.addProperty("declaredType", this.declaredType);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
get incomingAccesses() {
|
|
32
|
-
return this._incomingAccesses;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
get declaredType() {
|
|
36
|
-
return this._declaredType;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
set declaredType(declaredType: Type) {
|
|
40
|
-
this._declaredType = declaredType;
|
|
41
|
-
declaredType.addStructureWithDeclaredType(this);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { Type } from "./type";
|
|
3
|
+
import { Access } from "./access";
|
|
4
|
+
import { NamedEntity } from "./named_entity";
|
|
5
|
+
|
|
6
|
+
export class StructuralEntity extends NamedEntity {
|
|
7
|
+
|
|
8
|
+
private _incomingAccesses: Set<Access> = new Set();
|
|
9
|
+
|
|
10
|
+
public addIncomingAccess(incomingAccess: Access): void {
|
|
11
|
+
if (!this._incomingAccesses.has(incomingAccess)) {
|
|
12
|
+
this._incomingAccesses.add(incomingAccess);
|
|
13
|
+
incomingAccess.variable = this;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private _declaredType!: Type;
|
|
18
|
+
|
|
19
|
+
public getJSON(): string {
|
|
20
|
+
const json: FamixJSONExporter = new FamixJSONExporter("StructuralEntity", this);
|
|
21
|
+
this.addPropertiesToExporter(json);
|
|
22
|
+
return json.getJSON();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
26
|
+
super.addPropertiesToExporter(exporter);
|
|
27
|
+
exporter.addProperty("incomingAccesses", this.incomingAccesses);
|
|
28
|
+
exporter.addProperty("declaredType", this.declaredType);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get incomingAccesses() {
|
|
32
|
+
return this._incomingAccesses;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get declaredType() {
|
|
36
|
+
return this._declaredType;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
set declaredType(declaredType: Type) {
|
|
40
|
+
this._declaredType = declaredType;
|
|
41
|
+
declaredType.addStructureWithDeclaredType(this);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { StructuralEntity } from "./structural_entity";
|
|
3
|
-
import { ContainerEntity } from "./container_entity";
|
|
4
|
-
import { Reference } from "./reference";
|
|
5
|
-
import { BehavioralEntity } from "./behavioral_entity";
|
|
6
|
-
import { Alias } from "./alias";
|
|
7
|
-
|
|
8
|
-
export class Type extends ContainerEntity {
|
|
9
|
-
|
|
10
|
-
private _container!: ContainerEntity;
|
|
11
|
-
private _typeAliases: Set<Alias> = new Set();
|
|
12
|
-
|
|
13
|
-
public addTypeAlias(typeAlias: Alias): void {
|
|
14
|
-
if (!this._typeAliases.has(typeAlias)) {
|
|
15
|
-
this._typeAliases.add(typeAlias);
|
|
16
|
-
typeAlias.aliasedEntity = this;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
private _structuresWithDeclaredType: Set<StructuralEntity> = new Set();
|
|
21
|
-
|
|
22
|
-
public addStructureWithDeclaredType(structureWithDeclaredType: StructuralEntity): void {
|
|
23
|
-
if (!this._structuresWithDeclaredType.has(structureWithDeclaredType)) {
|
|
24
|
-
this._structuresWithDeclaredType.add(structureWithDeclaredType);
|
|
25
|
-
structureWithDeclaredType.declaredType = this;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
private _behavioralEntitiesWithDeclaredType: Set<BehavioralEntity> = new Set();
|
|
30
|
-
|
|
31
|
-
public addBehavioralEntityWithDeclaredType(behavioralEntityWithDeclaredType: BehavioralEntity): void {
|
|
32
|
-
if (!this._behavioralEntitiesWithDeclaredType.has(behavioralEntityWithDeclaredType)) {
|
|
33
|
-
this._behavioralEntitiesWithDeclaredType.add(behavioralEntityWithDeclaredType);
|
|
34
|
-
behavioralEntityWithDeclaredType.declaredType = this;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
private _incomingReferences: Set<Reference> = new Set();
|
|
39
|
-
|
|
40
|
-
public addIncomingReference(incomingReference: Reference): void {
|
|
41
|
-
if (!this._incomingReferences.has(incomingReference)) {
|
|
42
|
-
this._incomingReferences.add(incomingReference);
|
|
43
|
-
incomingReference.target = this;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public getJSON(): string {
|
|
48
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Type", this);
|
|
49
|
-
this.addPropertiesToExporter(json);
|
|
50
|
-
return json.getJSON();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
54
|
-
super.addPropertiesToExporter(exporter);
|
|
55
|
-
exporter.addProperty("typeContainer", this.container);
|
|
56
|
-
/* unsupported properties in MM so far */
|
|
57
|
-
// exporter.addProperty("typeAliases", this.getTypeAliases());
|
|
58
|
-
// exporter.addProperty("structuresWithDeclaredType", this.getStructuresWithDeclaredType());
|
|
59
|
-
// exporter.addProperty("behavioralEntitiesWithDeclaredType", this.getBehavioralEntitiesWithDeclaredType());
|
|
60
|
-
exporter.addProperty("incomingReferences", this.incomingReferences);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
get container() {
|
|
64
|
-
return this._container;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
set container(container: ContainerEntity) {
|
|
68
|
-
this._container = container;
|
|
69
|
-
container.addType(this);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
get typeAliases() {
|
|
73
|
-
return this._typeAliases;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
get structuresWithDeclaredType() {
|
|
77
|
-
return this._structuresWithDeclaredType;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
get behavioralEntitiesWithDeclaredType() {
|
|
81
|
-
return this._behavioralEntitiesWithDeclaredType;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
get incomingReferences() {
|
|
85
|
-
return this._incomingReferences;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { StructuralEntity } from "./structural_entity";
|
|
3
|
+
import { ContainerEntity } from "./container_entity";
|
|
4
|
+
import { Reference } from "./reference";
|
|
5
|
+
import { BehavioralEntity } from "./behavioral_entity";
|
|
6
|
+
import { Alias } from "./alias";
|
|
7
|
+
|
|
8
|
+
export class Type extends ContainerEntity {
|
|
9
|
+
|
|
10
|
+
private _container!: ContainerEntity;
|
|
11
|
+
private _typeAliases: Set<Alias> = new Set();
|
|
12
|
+
|
|
13
|
+
public addTypeAlias(typeAlias: Alias): void {
|
|
14
|
+
if (!this._typeAliases.has(typeAlias)) {
|
|
15
|
+
this._typeAliases.add(typeAlias);
|
|
16
|
+
typeAlias.aliasedEntity = this;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
private _structuresWithDeclaredType: Set<StructuralEntity> = new Set();
|
|
21
|
+
|
|
22
|
+
public addStructureWithDeclaredType(structureWithDeclaredType: StructuralEntity): void {
|
|
23
|
+
if (!this._structuresWithDeclaredType.has(structureWithDeclaredType)) {
|
|
24
|
+
this._structuresWithDeclaredType.add(structureWithDeclaredType);
|
|
25
|
+
structureWithDeclaredType.declaredType = this;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private _behavioralEntitiesWithDeclaredType: Set<BehavioralEntity> = new Set();
|
|
30
|
+
|
|
31
|
+
public addBehavioralEntityWithDeclaredType(behavioralEntityWithDeclaredType: BehavioralEntity): void {
|
|
32
|
+
if (!this._behavioralEntitiesWithDeclaredType.has(behavioralEntityWithDeclaredType)) {
|
|
33
|
+
this._behavioralEntitiesWithDeclaredType.add(behavioralEntityWithDeclaredType);
|
|
34
|
+
behavioralEntityWithDeclaredType.declaredType = this;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private _incomingReferences: Set<Reference> = new Set();
|
|
39
|
+
|
|
40
|
+
public addIncomingReference(incomingReference: Reference): void {
|
|
41
|
+
if (!this._incomingReferences.has(incomingReference)) {
|
|
42
|
+
this._incomingReferences.add(incomingReference);
|
|
43
|
+
incomingReference.target = this;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public getJSON(): string {
|
|
48
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Type", this);
|
|
49
|
+
this.addPropertiesToExporter(json);
|
|
50
|
+
return json.getJSON();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
54
|
+
super.addPropertiesToExporter(exporter);
|
|
55
|
+
exporter.addProperty("typeContainer", this.container);
|
|
56
|
+
/* unsupported properties in MM so far */
|
|
57
|
+
// exporter.addProperty("typeAliases", this.getTypeAliases());
|
|
58
|
+
// exporter.addProperty("structuresWithDeclaredType", this.getStructuresWithDeclaredType());
|
|
59
|
+
// exporter.addProperty("behavioralEntitiesWithDeclaredType", this.getBehavioralEntitiesWithDeclaredType());
|
|
60
|
+
exporter.addProperty("incomingReferences", this.incomingReferences);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get container() {
|
|
64
|
+
return this._container;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set container(container: ContainerEntity) {
|
|
68
|
+
this._container = container;
|
|
69
|
+
container.addType(this);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get typeAliases() {
|
|
73
|
+
return this._typeAliases;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get structuresWithDeclaredType() {
|
|
77
|
+
return this._structuresWithDeclaredType;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get behavioralEntitiesWithDeclaredType() {
|
|
81
|
+
return this._behavioralEntitiesWithDeclaredType;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
get incomingReferences() {
|
|
85
|
+
return this._incomingReferences;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
-
import { ContainerEntity } from "./container_entity";
|
|
3
|
-
import { StructuralEntity } from "./structural_entity";
|
|
4
|
-
|
|
5
|
-
export class Variable extends StructuralEntity {
|
|
6
|
-
|
|
7
|
-
private _parentContainerEntity!: ContainerEntity;
|
|
8
|
-
|
|
9
|
-
public getJSON(): string {
|
|
10
|
-
const json: FamixJSONExporter = new FamixJSONExporter("Variable", this);
|
|
11
|
-
this.addPropertiesToExporter(json);
|
|
12
|
-
return json.getJSON();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
16
|
-
super.addPropertiesToExporter(exporter);
|
|
17
|
-
exporter.addProperty("parentBehaviouralEntity", this.parentContainerEntity);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get parentContainerEntity() {
|
|
21
|
-
return this._parentContainerEntity;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
set parentContainerEntity(parentContainerEntity: ContainerEntity) {
|
|
25
|
-
this._parentContainerEntity = parentContainerEntity;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
import { FamixJSONExporter } from "../../famix_JSON_exporter";
|
|
2
|
+
import { ContainerEntity } from "./container_entity";
|
|
3
|
+
import { StructuralEntity } from "./structural_entity";
|
|
4
|
+
|
|
5
|
+
export class Variable extends StructuralEntity {
|
|
6
|
+
|
|
7
|
+
private _parentContainerEntity!: ContainerEntity;
|
|
8
|
+
|
|
9
|
+
public getJSON(): string {
|
|
10
|
+
const json: FamixJSONExporter = new FamixJSONExporter("Variable", this);
|
|
11
|
+
this.addPropertiesToExporter(json);
|
|
12
|
+
return json.getJSON();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public addPropertiesToExporter(exporter: FamixJSONExporter): void {
|
|
16
|
+
super.addPropertiesToExporter(exporter);
|
|
17
|
+
exporter.addProperty("parentBehaviouralEntity", this.parentContainerEntity);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get parentContainerEntity() {
|
|
21
|
+
return this._parentContainerEntity;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set parentContainerEntity(parentContainerEntity: ContainerEntity) {
|
|
25
|
+
this._parentContainerEntity = parentContainerEntity;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "famix",
|
|
3
|
-
"version": "1.0.5",
|
|
4
|
-
"description": "a FAMIX model written typescript",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"types": "build/index.d.ts",
|
|
7
|
-
"files": ["dist/**/*"],
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/pascalerni/famix.git"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "echo \"Error: no test specified\" && exit 0",
|
|
14
|
-
"build" : "tsc",
|
|
15
|
-
"lint": "tslint -p tsconfig.json",
|
|
16
|
-
"prepare": "npm run build",
|
|
17
|
-
"prepublishOnly": "npm test && npm run lint",
|
|
18
|
-
"preversion": "npm run lint",
|
|
19
|
-
"version": "git add -A src",
|
|
20
|
-
"postversion": "git push && git push --tags"
|
|
21
|
-
},
|
|
22
|
-
"author": "Pascal Erni",
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"tslint": "^5.20.0",
|
|
26
|
-
"typescript": "^3.6.3"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "famix",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "a FAMIX model written typescript",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
|
+
"files": ["dist/**/*"],
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/pascalerni/famix.git"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
14
|
+
"build" : "tsc",
|
|
15
|
+
"lint": "tslint -p tsconfig.json",
|
|
16
|
+
"prepare": "npm run build",
|
|
17
|
+
"prepublishOnly": "npm test && npm run lint",
|
|
18
|
+
"preversion": "npm run lint",
|
|
19
|
+
"version": "git add -A src",
|
|
20
|
+
"postversion": "git push && git push --tags"
|
|
21
|
+
},
|
|
22
|
+
"author": "Pascal Erni",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"tslint": "^5.20.0",
|
|
26
|
+
"typescript": "^3.6.3"
|
|
27
|
+
}
|
|
28
|
+
}
|