Skip to content

Commit c4bf42e

Browse files
authored
Merge pull request #1117 from jecisc/containers
Remove usage of private API in the generators
2 parents 3e5e5e4 + 1d23a5e commit c4bf42e

21 files changed

Lines changed: 175 additions & 64 deletions

src/Famix-MetamodelBuilder-Core/FmxMBRelationSide.class.st

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ FmxMBRelationSide >> cardinality: anObject [
5959

6060
{ #category : 'properties' }
6161
FmxMBRelationSide >> container [
62-
62+
"This method should not be called directly by the user. This is reserved to be used internaly in the builder."
63+
6364
self withNavigationOf: self relation.
6465
container := true
6566
]

src/Famix-MetamodelGeneration/FamixGenerator.class.st

Lines changed: 40 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,9 +1297,8 @@ FamixGenerator >> defineRelations [
12971297
comment: 'This property corresponds to the set of annotations associated to the entity').
12981298

12991299
((tAnnotationInstanceAttribute property: #parentAnnotationInstance)
1300-
comment: 'The instance of the annotation in which the attribute is used.';
1301-
container)
1302-
*-
1300+
comment: 'The instance of the annotation in which the attribute is used.')
1301+
*-<>
13031302
((tAnnotationInstance property: #attributes)
13041303
comment: 'This corresponds to the actual values of the attributes in an AnnotationInstance').
13051304

@@ -1311,9 +1310,8 @@ FamixGenerator >> defineRelations [
13111310
container"). "TODO: resolve"
13121311

13131312
((tAnnotationType property: #annotationTypesContainer)
1314-
comment: 'Container in which an AnnotationType may reside';
1315-
container )
1316-
*-
1313+
comment: 'Container in which an AnnotationType may reside')
1314+
*-<>
13171315
((tWithAnnotationTypes property: #definedAnnotationTypes)
13181316
comment: 'The container in which the AnnotationTypes may be declared').
13191317

@@ -1330,16 +1328,14 @@ FamixGenerator >> defineRelations [
13301328
comment: 'Next association in an ordered collection of associations. Currently not supported by the Moose importer').
13311329

13321330
((tAttribute property: #parentType)
1333-
comment: 'Type declaring the attribute. belongsTo implementation';
1334-
container)
1335-
*-
1331+
comment: 'Type declaring the attribute. belongsTo implementation')
1332+
*-<>
13361333
((tWithAttributes property: #attributes)
13371334
comment: 'List of attributes declared by this type.').
13381335

13391336
((tCompilationUnit property: #compilationUnitOwner)
1340-
comment: 'The compilation unit that defines this module';
1341-
container)
1342-
-
1337+
comment: 'The compilation unit that defines this module')
1338+
-<>
13431339
((tWithCompilationUnits property: #compilationUnit)).
13441340

13451341
((tThrowable property: #catchingEntities))
@@ -1348,9 +1344,8 @@ FamixGenerator >> defineRelations [
13481344
comment: 'The exceptions caught by the method').
13491345

13501346
((tComment property: #commentedEntity)
1351-
comment: 'Source code commented by the comment';
1352-
container)
1353-
*-
1347+
comment: 'Source code commented by the comment')
1348+
*-<>
13541349
((tWithComments property: #comments)
13551350
comment: 'List of comments for the entity').
13561351

@@ -1366,17 +1361,15 @@ FamixGenerator >> defineRelations [
13661361
comment: 'List of invocations performed on BehaviouralEntities referenced by this entity').
13671362

13681363
((tEnumValue property: #parentEnum)
1369-
comment: 'The Enum declaring this value. It offers the implementation of belongsTo';
1370-
container)
1371-
*-
1364+
comment: 'The Enum declaring this value. It offers the implementation of belongsTo')
1365+
*-<>
13721366
((tWithEnumValues property: #enumValues)).
13731367

13741368
((tFolder property: #childrenFileSystemEntities)
13751369
comment: 'List of entities contained in this folder.')
1376-
-*
1370+
<>-*
13771371
((tFileSystemEntity property: #parentFolder)
1378-
comment: 'Folder entity containing this file.';
1379-
container).
1372+
comment: 'Folder entity containing this file.').
13801373

13811374
((tFile property: #entities)
13821375
comment: 'List of entities defined in the file')
@@ -1397,30 +1390,26 @@ FamixGenerator >> defineRelations [
13971390
comment: 'The include entities that have this file as a target.').
13981391

13991392
((tFunction property: #functionOwner)
1400-
comment: 'The container defining the function. The function is placed in a container, because certain languages can nest functions in functions.';
1401-
container)
1402-
*-
1393+
comment: 'The container defining the function. The function is placed in a container, because certain languages can nest functions in functions.')
1394+
*-<>
14031395
((tWithFunctions property: #functions)
14041396
comment: 'Functions defined in the container, if any.').
14051397

14061398
((tLambda property: #lambdaContainer)
1407-
comment: 'The container defining the lambda expression. The lambda is placed in a container, because certain languages can nest lambdas in lambdas.';
1408-
container)
1409-
*-
1399+
comment: 'The container defining the lambda expression. The lambda is placed in a container, because certain languages can nest lambdas in lambdas.')
1400+
*-<>
14101401
((tWithLambdas property: #lambdas)
14111402
comment: 'Lambdas defined in the container, if any.').
14121403

14131404
((tGlobalVariable property: #parentScope)
1414-
comment: 'Scope declaring the global variable. belongsTo implementation';
1415-
container)
1416-
*-
1405+
comment: 'Scope declaring the global variable. belongsTo implementation')
1406+
*-<>
14171407
((tWithGlobalVariables property: #globalVariables)
14181408
comment: 'Global variables defined in the scope, if any.').
14191409

14201410
((tImplicitVariable property: #parentBehaviouralEntity)
1421-
comment: 'The behaviour containing this implicit variable. belongsTo implementation';
1422-
container)
1423-
*-
1411+
comment: 'The behaviour containing this implicit variable. belongsTo implementation')
1412+
*-<>
14241413
((tWithImplicitVariables property: #implicitVariables)
14251414
comment: 'Implicit variables used locally by this behaviour.').
14261415

@@ -1459,36 +1448,31 @@ FamixGenerator >> defineRelations [
14591448
comment: 'List of imports of this entity').
14601449

14611450
((tLocalVariable property: #parentBehaviouralEntity)
1462-
comment: 'Behavioural entity declaring this local variable. belongsTo implementation';
1463-
container)
1464-
*-
1451+
comment: 'Behavioural entity declaring this local variable. belongsTo implementation')
1452+
*-<>
14651453
((tWithLocalVariables property: #localVariables)
14661454
comment: 'Variables locally defined by this behaviour.').
14671455

14681456
((tMethod property: #parentType)
1469-
comment: 'Type declaring the method. It provides the implementation for belongsTo.';
1470-
container)
1471-
*-
1457+
comment: 'Type declaring the method. It provides the implementation for belongsTo.')
1458+
*-<>
14721459
((tWithMethods property: #methods)
14731460
comment: 'Methods declared by this type.').
14741461

14751462
((tModule property: #moduleEntities))
1476-
-*
1463+
<>-*
14771464
((tDefinedInModule property: #parentModule)
1478-
comment: 'Module that contains the definition of this entity';
1479-
container).
1465+
comment: 'Module that contains the definition of this entity').
14801466

14811467
((tPackage property: #childEntities))
1482-
-*
1468+
<>-*
14831469
((tPackageable property: #parentPackage)
1484-
comment: 'Package containing the entity in the code structure (if applicable)';
1485-
container).
1470+
comment: 'Package containing the entity in the code structure (if applicable)').
14861471

14871472

14881473
((tParameter property: #parentBehaviouralEntity)
1489-
comment: 'Behavioural entity containing this parameter. belongsTo implementation';
1490-
container)
1491-
*-
1474+
comment: 'Behavioural entity containing this parameter. belongsTo implementation')
1475+
*-<>
14921476
((tWithParameters property: #parameters)
14931477
comment: 'List of formal parameters declared by this behaviour.').
14941478

@@ -1532,37 +1516,30 @@ FamixGenerator >> defineRelations [
15321516
((tWithInheritances property: #subInheritances)
15331517
comment: 'Subinheritance relationships, i.e. known subclasses of this type.').
15341518

1535-
((tTemplate property: #templateOwner) container)
1536-
*-
1537-
((tWithTemplates property: #templates)).
1519+
(tTemplate property: #templateOwner) *-<> (tWithTemplates property: #templates).
15381520

1539-
((tTemplate property: #templateUsers))
1540-
-*
1541-
((tTemplateUser property: #template)).
1521+
(tTemplate property: #templateUsers) -* (tTemplateUser property: #template).
15421522

1543-
((tThrowable property: #throwingEntities))
1523+
(tThrowable property: #throwingEntities)
15441524
*-*
15451525
((tWithExceptions property: #thrownExceptions)
15461526
comment: 'The exceptions thrown by the method').
15471527

1548-
((tTrait property: #traitOwner) container )
1549-
*-
1550-
((tWithTraits property: #traits)).
1528+
(tTrait property: #traitOwner ) *-<> (tWithTraits property: #traits).
15511529

1552-
((tTrait property: #incomingTraitUsages))
1530+
(tTrait property: #incomingTraitUsages)
15531531
-*
15541532
((tTraitUsage property: #trait)
15551533
source).
15561534

1557-
((tTraitUser property: #traitUsages))
1535+
(tTraitUser property: #traitUsages)
15581536
-*
15591537
((tTraitUsage property: #user)
15601538
target).
15611539

15621540
((tType property: #typeContainer)
1563-
comment: 'Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).';
1564-
container)
1565-
*-
1541+
comment: 'Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).')
1542+
*-<>
15661543
((tWithTypes property: #types)
15671544
comment: 'Types contained (declared) in this entity, if any.
15681545
#types is declared in ContainerEntity because different kinds of container can embed types. Types are usually contained in a Famix.Namespace. But types can also be contained in a Famix.Class or Famix.Method (in Java with inner classes for example). Famix.Function can also contain some types such as structs.').

src/Famix-TestComposedMetamodel-Entities/FamixTestComposedCustomEntity1.class.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,10 @@ FamixTestComposedCustomEntity1 >> customEntity1: anObject [
7777
self attributeAt: #customEntity1 put: anObject.
7878
anObject customEntity1: self ]
7979
]
80+
81+
{ #category : 'navigation' }
82+
FamixTestComposedCustomEntity1 >> customEntity1Group [
83+
<generated>
84+
<navigation: 'CustomEntity1'>
85+
^ MooseSpecializedGroup with: self customEntity1
86+
]

src/Famix-Traits/FamixTAnnotationInstance.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ FamixTAnnotationInstance >> attributes: anObject [
120120
attributes value: anObject
121121
]
122122

123+
{ #category : 'navigation' }
124+
FamixTAnnotationInstance >> attributesGroup [
125+
<generated>
126+
<navigation: 'Attributes'>
127+
^ MooseSpecializedGroup withAll: self attributes asSet
128+
]
129+
123130
{ #category : 'printing' }
124131
FamixTAnnotationInstance >> displayStringOn: aStream [
125132

src/Famix-Traits/FamixTFolder.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ FamixTFolder >> childrenFileSystemEntities: anObject [
102102
childrenFileSystemEntities value: anObject
103103
]
104104

105+
{ #category : 'navigation' }
106+
FamixTFolder >> childrenFileSystemEntitiesGroup [
107+
<generated>
108+
<navigation: 'ChildrenFileSystemEntities'>
109+
^ MooseSpecializedGroup withAll: self childrenFileSystemEntities asSet
110+
]
111+
105112
{ #category : 'adding' }
106113
FamixTFolder >> files [
107114
^ self childrenFileSystemEntities reject: #isFolder

src/Famix-Traits/FamixTModule.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ FamixTModule >> moduleEntities: anObject [
6868
<generated>
6969
moduleEntities value: anObject
7070
]
71+
72+
{ #category : 'navigation' }
73+
FamixTModule >> moduleEntitiesGroup [
74+
<generated>
75+
<navigation: 'ModuleEntities'>
76+
^ MooseSpecializedGroup withAll: self moduleEntities asSet
77+
]

src/Famix-Traits/FamixTPackage.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ FamixTPackage >> childEntities: anObject [
8383
childEntities value: anObject
8484
]
8585

86+
{ #category : 'navigation' }
87+
FamixTPackage >> childEntitiesGroup [
88+
<generated>
89+
<navigation: 'ChildEntities'>
90+
^ MooseSpecializedGroup withAll: self childEntities asSet
91+
]
92+
8693
{ #category : 'testing' }
8794
FamixTPackage >> isPackage [
8895

src/Famix-Traits/FamixTWithAnnotationTypes.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ FamixTWithAnnotationTypes >> definedAnnotationTypes: anObject [
5858
<generated>
5959
definedAnnotationTypes value: anObject
6060
]
61+
62+
{ #category : 'navigation' }
63+
FamixTWithAnnotationTypes >> definedAnnotationTypesGroup [
64+
<generated>
65+
<navigation: 'DefinedAnnotationTypes'>
66+
^ MooseSpecializedGroup withAll: self definedAnnotationTypes asSet
67+
]

src/Famix-Traits/FamixTWithAttributes.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ FamixTWithAttributes >> attributes: anObject [
5858
attributes value: anObject
5959
]
6060

61+
{ #category : 'navigation' }
62+
FamixTWithAttributes >> attributesGroup [
63+
<generated>
64+
<navigation: 'Attributes'>
65+
^ MooseSpecializedGroup withAll: self attributes asSet
66+
]
67+
6168
{ #category : 'Famix-Extensions' }
6269
FamixTWithAttributes >> numberOfAttributes [
6370

src/Famix-Traits/FamixTWithComments.trait.st

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ FamixTWithComments >> comments: anObject [
6060
comments value: anObject
6161
]
6262

63+
{ #category : 'navigation' }
64+
FamixTWithComments >> commentsGroup [
65+
<generated>
66+
<navigation: 'Comments'>
67+
^ MooseSpecializedGroup withAll: self comments asSet
68+
]
69+
6370
{ #category : 'testing' }
6471
FamixTWithComments >> hasComments [
6572
<FMProperty: #hasComments type: #Boolean>

0 commit comments

Comments
 (0)