diff --git a/src/Famix-Java-Entities/FamixJavaConcretisation.class.st b/src/Famix-Java-Entities/FamixJavaConcretisation.class.st new file mode 100644 index 000000000..012fe406f --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaConcretisation.class.st @@ -0,0 +1,43 @@ +" +## Relations +====================== + +### Association source +| Relation | Origin | Opposite | Type | Comment | +| `genericEntity` | `FamixTConcretisation` | `concretisations` | `FamixTParametricEntity` | genericEntity linked to in this relationship. from-side of the association| + +### Association target +| Relation | Origin | Opposite | Type | Comment | +| `concreteEntity` | `FamixTConcretisation` | `genericEntity` | `FamixTParametricEntity` | concreteEntity linked to in this relationship. to-side of the association| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| +| `parameterConcretisations` | `FamixTConcretisation` | `concretisations` | `FamixTParameterConcretisation` | | +| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| + +" +Class { + #name : #FamixJavaConcretisation, + #superclass : #FamixJavaEntity, + #traits : 'FamixTConcretisation', + #classTraits : 'FamixTConcretisation classTrait', + #category : #'Famix-Java-Entities-Entities' +} + +{ #category : #meta } +FamixJavaConcretisation class >> annotation [ + + + + + ^ self +] diff --git a/src/Famix-Java-Entities/FamixJavaException.class.st b/src/Famix-Java-Entities/FamixJavaException.class.st index 3916fbd44..b76bbad7b 100644 --- a/src/Famix-Java-Entities/FamixJavaException.class.st +++ b/src/Famix-Java-Entities/FamixJavaException.class.st @@ -26,12 +26,12 @@ ### Other | Relation | Origin | Opposite | Type | Comment | | `annotationInstances` | `FamixTWithAnnotationInstances` | `annotatedEntity` | `FamixTAnnotationInstance` | This property corresponds to the set of annotations associated to the entity| -| `catchingEntities` | `FamixTException` | `caughtExceptions` | `FamixTWithExceptions` | | +| `catchingEntities` | `FamixTThrowable` | `caughtExceptions` | `FamixTWithExceptions` | | | `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity| -| `declaringEntities` | `FamixTException` | `declaredExceptions` | `FamixTWithExceptions` | | +| `declaringEntities` | `FamixTThrowable` | `declaredExceptions` | `FamixTWithExceptions` | | | `receivingInvocations` | `FamixTInvocationsReceiver` | `receiver` | `FamixTInvocation` | List of invocations performed on this entity (considered as the receiver)| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `throwingEntities` | `FamixTException` | `thrownExceptions` | `FamixTWithExceptions` | | +| `throwingEntities` | `FamixTThrowable` | `thrownExceptions` | `FamixTWithExceptions` | | | `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| diff --git a/src/Famix-Java-Entities/FamixJavaImportingContext.class.st b/src/Famix-Java-Entities/FamixJavaImportingContext.class.st index 6a9305449..5dfacd7de 100644 --- a/src/Famix-Java-Entities/FamixJavaImportingContext.class.st +++ b/src/Famix-Java-Entities/FamixJavaImportingContext.class.st @@ -71,6 +71,13 @@ FamixJavaImportingContext >> importComment [ ^ self importConcreteEntity: (self class fm3ClassNamed: #Comment) ] +{ #category : #importing } +FamixJavaImportingContext >> importConcretisation [ + + + ^ self importAssociation: (self class fm3ClassNamed: #Concretisation) +] + { #category : #importing } FamixJavaImportingContext >> importEnum [ @@ -170,38 +177,38 @@ FamixJavaImportingContext >> importParameter [ ] { #category : #importing } -FamixJavaImportingContext >> importParameterType [ +FamixJavaImportingContext >> importParameterConcretisation [ - ^ self importConcreteEntity: (self class fm3ClassNamed: #ParameterType) + ^ self importAssociation: (self class fm3ClassNamed: #ParameterConcretisation) ] { #category : #importing } -FamixJavaImportingContext >> importParameterizableClass [ +FamixJavaImportingContext >> importParameterType [ - ^ self importConcreteEntity: (self class fm3ClassNamed: #ParameterizableClass) + ^ self importConcreteEntity: (self class fm3ClassNamed: #ParameterType) ] { #category : #importing } -FamixJavaImportingContext >> importParameterizableException [ +FamixJavaImportingContext >> importParametricClass [ - ^ self importConcreteEntity: (self class fm3ClassNamed: #ParameterizableException) + ^ self importConcreteEntity: (self class fm3ClassNamed: #ParametricClass) ] { #category : #importing } -FamixJavaImportingContext >> importParameterizableInterface [ +FamixJavaImportingContext >> importParametricInterface [ - ^ self importConcreteEntity: (self class fm3ClassNamed: #ParameterizableInterface) + ^ self importConcreteEntity: (self class fm3ClassNamed: #ParametricInterface) ] { #category : #importing } -FamixJavaImportingContext >> importParameterizedType [ +FamixJavaImportingContext >> importParametricMethod [ - ^ self importConcreteEntity: (self class fm3ClassNamed: #ParameterizedType) + ^ self importConcreteEntity: (self class fm3ClassNamed: #ParametricMethod) ] { #category : #importing } @@ -253,6 +260,13 @@ FamixJavaImportingContext >> importUnknownVariable [ ^ self importConcreteEntity: (self class fm3ClassNamed: #UnknownVariable) ] +{ #category : #importing } +FamixJavaImportingContext >> importWildcard [ + + + ^ self importConcreteEntity: (self class fm3ClassNamed: #Wildcard) +] + { #category : #testing } FamixJavaImportingContext >> shouldImportAccess [ @@ -309,6 +323,13 @@ FamixJavaImportingContext >> shouldImportComment [ ^ self shouldImport: #Comment ] +{ #category : #testing } +FamixJavaImportingContext >> shouldImportConcretisation [ + + + ^ self shouldImport: #Concretisation +] + { #category : #testing } FamixJavaImportingContext >> shouldImportEnum [ @@ -408,38 +429,38 @@ FamixJavaImportingContext >> shouldImportParameter [ ] { #category : #testing } -FamixJavaImportingContext >> shouldImportParameterType [ +FamixJavaImportingContext >> shouldImportParameterConcretisation [ - ^ self shouldImport: #ParameterType + ^ self shouldImport: #ParameterConcretisation ] { #category : #testing } -FamixJavaImportingContext >> shouldImportParameterizableClass [ +FamixJavaImportingContext >> shouldImportParameterType [ - ^ self shouldImport: #ParameterizableClass + ^ self shouldImport: #ParameterType ] { #category : #testing } -FamixJavaImportingContext >> shouldImportParameterizableException [ +FamixJavaImportingContext >> shouldImportParametricClass [ - ^ self shouldImport: #ParameterizableException + ^ self shouldImport: #ParametricClass ] { #category : #testing } -FamixJavaImportingContext >> shouldImportParameterizableInterface [ +FamixJavaImportingContext >> shouldImportParametricInterface [ - ^ self shouldImport: #ParameterizableInterface + ^ self shouldImport: #ParametricInterface ] { #category : #testing } -FamixJavaImportingContext >> shouldImportParameterizedType [ +FamixJavaImportingContext >> shouldImportParametricMethod [ - ^ self shouldImport: #ParameterizedType + ^ self shouldImport: #ParametricMethod ] { #category : #testing } @@ -490,3 +511,10 @@ FamixJavaImportingContext >> shouldImportUnknownVariable [ ^ self shouldImport: #UnknownVariable ] + +{ #category : #testing } +FamixJavaImportingContext >> shouldImportWildcard [ + + + ^ self shouldImport: #Wildcard +] diff --git a/src/Famix-Java-Entities/FamixJavaMethod.class.st b/src/Famix-Java-Entities/FamixJavaMethod.class.st index 8f48176f1..32157c593 100644 --- a/src/Famix-Java-Entities/FamixJavaMethod.class.st +++ b/src/Famix-Java-Entities/FamixJavaMethod.class.st @@ -25,12 +25,12 @@ ### Other | Relation | Origin | Opposite | Type | Comment | -| `caughtExceptions` | `FamixTWithExceptions` | `catchingEntities` | `FamixTException` | The exceptions caught by the method| +| `caughtExceptions` | `FamixTWithExceptions` | `catchingEntities` | `FamixTThrowable` | The exceptions caught by the method| | `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity| -| `declaredExceptions` | `FamixTWithExceptions` | `declaringEntities` | `FamixTException` | The exceptions declared by the method| +| `declaredExceptions` | `FamixTWithExceptions` | `declaringEntities` | `FamixTThrowable` | The exceptions declared by the method| | `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `thrownExceptions` | `FamixTWithExceptions` | `throwingEntities` | `FamixTException` | The exceptions thrown by the method| +| `thrownExceptions` | `FamixTWithExceptions` | `throwingEntities` | `FamixTThrowable` | The exceptions thrown by the method| ## Properties diff --git a/src/Famix-Java-Entities/FamixJavaParameterConcretisation.class.st b/src/Famix-Java-Entities/FamixJavaParameterConcretisation.class.st new file mode 100644 index 000000000..06d1623de --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaParameterConcretisation.class.st @@ -0,0 +1,43 @@ +" +## Relations +====================== + +### Association source +| Relation | Origin | Opposite | Type | Comment | +| `genericParameter` | `FamixTParameterConcretisation` | `concretisations` | `FamixTGenericParameterType` | genericParameter linked to in this relationship. from-side of the association| + +### Association target +| Relation | Origin | Opposite | Type | Comment | +| `concreteParameter` | `FamixTParameterConcretisation` | `generics` | `FamixTConcreteParameterType` | concreteParameter linked to in this relationship. to-side of the association| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTParameterConcretisation` | `parameterConcretisations` | `FamixTConcretisation` | | +| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| +| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| + +" +Class { + #name : #FamixJavaParameterConcretisation, + #superclass : #FamixJavaEntity, + #traits : 'FamixTParameterConcretisation', + #classTraits : 'FamixTParameterConcretisation classTrait', + #category : #'Famix-Java-Entities-Entities' +} + +{ #category : #meta } +FamixJavaParameterConcretisation class >> annotation [ + + + + + ^ self +] diff --git a/src/Famix-Java-Entities/FamixJavaParameterType.class.st b/src/Famix-Java-Entities/FamixJavaParameterType.class.st index e0c5eb353..55016f17e 100644 --- a/src/Famix-Java-Entities/FamixJavaParameterType.class.st +++ b/src/Famix-Java-Entities/FamixJavaParameterType.class.st @@ -1,8 +1,45 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +| `typeContainer` | `FamixTType` | `types` | `FamixTWithTypes` | Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).| + +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTGenericParameterType` | `genericParameter` | `FamixTParameterConcretisation` | concretisations relationships, i.e. known concretisation of this type.| +| `superInheritances` | `FamixTWithInheritances` | `subclass` | `FamixTInheritance` | Superinheritance relationships, i.e. known superclasses of this type.| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `incomingReferences` | `FamixTReferenceable` | `referredType` | `FamixTReference` | References to this entity by other entities.| +| `subInheritances` | `FamixTWithInheritances` | `superclass` | `FamixTInheritance` | Subinheritance relationships, i.e. known subclasses of this type.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `catchingEntities` | `FamixTThrowable` | `caughtExceptions` | `FamixTWithExceptions` | | +| `declaredType` | `FamixTTypedEntity` | `typedEntities` | `FamixTType` | Type of the entity, if any| +| `declaringEntities` | `FamixTThrowable` | `declaredExceptions` | `FamixTWithExceptions` | | +| `genericEntities` | `FamixTGenericParameterType` | `genericParameters` | `FamixTParametricEntity` | genericEntity of a parameter| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| +| `throwingEntities` | `FamixTThrowable` | `thrownExceptions` | `FamixTWithExceptions` | | +| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| +| `name` | `String` | nil | Basic name of the entity, not full reference.| + +" Class { #name : #FamixJavaParameterType, #superclass : #FamixJavaType, - #traits : 'FamixTParameterType', - #classTraits : 'FamixTParameterType classTrait', + #traits : 'FamixTGenericParameterType + FamixTThrowable + FamixTTypedEntity + FamixTWithInheritances', + #classTraits : 'FamixTGenericParameterType classTrait + FamixTThrowable classTrait + FamixTTypedEntity classTrait + FamixTWithInheritances classTrait', #category : #'Famix-Java-Entities-Entities' } diff --git a/src/Famix-Java-Entities/FamixJavaParameterizableClass.class.st b/src/Famix-Java-Entities/FamixJavaParameterizableClass.class.st deleted file mode 100644 index e1040b336..000000000 --- a/src/Famix-Java-Entities/FamixJavaParameterizableClass.class.st +++ /dev/null @@ -1,54 +0,0 @@ -" -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `parameterizedTypes` | `FamixTWithParameterizedTypes` | `parameterizableClass` | `FamixTParameterizedType` | | - - - -" -Class { - #name : #FamixJavaParameterizableClass, - #superclass : #FamixJavaClass, - #traits : 'FamixTWithParameterizedTypes', - #classTraits : 'FamixTWithParameterizedTypes classTrait', - #category : #'Famix-Java-Entities-Entities' -} - -{ #category : #meta } -FamixJavaParameterizableClass class >> annotation [ - - - - - ^ self -] - -{ #category : #enumerating } -FamixJavaParameterizableClass >> allSubclassesDo: aBlock [ - "override traversal to include subtypes of parameterized types" - - | recursion | - recursion := [ :each | - aBlock value: each subclass. - each subclass allSubclassesDo: aBlock ]. - self subInheritances do: recursion. - self parameterizedTypes do: [ :type | - type subInheritances do: recursion ] -] - -{ #category : #accessing } -FamixJavaParameterizableClass >> parameters [ - - - - ^self types select: [:each | each isParameterType] -] - -{ #category : #accessing } -FamixJavaParameterizableClass >> parameters: aCollection [ - - self attributeAt: #parameters put: aCollection -] diff --git a/src/Famix-Java-Entities/FamixJavaParameterizableException.class.st b/src/Famix-Java-Entities/FamixJavaParameterizableException.class.st deleted file mode 100644 index 3477396cb..000000000 --- a/src/Famix-Java-Entities/FamixJavaParameterizableException.class.st +++ /dev/null @@ -1,27 +0,0 @@ -" -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `parameterizedTypes` | `FamixTWithParameterizedTypes` | `parameterizableClass` | `FamixTParameterizedType` | | - - - -" -Class { - #name : #FamixJavaParameterizableException, - #superclass : #FamixJavaException, - #traits : 'FamixTWithParameterizedTypes', - #classTraits : 'FamixTWithParameterizedTypes classTrait', - #category : #'Famix-Java-Entities-Entities' -} - -{ #category : #meta } -FamixJavaParameterizableException class >> annotation [ - - - - - ^ self -] diff --git a/src/Famix-Java-Entities/FamixJavaParameterizableInterface.class.st b/src/Famix-Java-Entities/FamixJavaParameterizableInterface.class.st deleted file mode 100644 index f26d661f4..000000000 --- a/src/Famix-Java-Entities/FamixJavaParameterizableInterface.class.st +++ /dev/null @@ -1,27 +0,0 @@ -" -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `parameterizedTypes` | `FamixTWithParameterizedTypes` | `parameterizableClass` | `FamixTParameterizedType` | | - - - -" -Class { - #name : #FamixJavaParameterizableInterface, - #superclass : #FamixJavaInterface, - #traits : 'FamixTWithParameterizedTypes', - #classTraits : 'FamixTWithParameterizedTypes classTrait', - #category : #'Famix-Java-Entities-Entities' -} - -{ #category : #meta } -FamixJavaParameterizableInterface class >> annotation [ - - - - - ^ self -] diff --git a/src/Famix-Java-Entities/FamixJavaParameterizedType.class.st b/src/Famix-Java-Entities/FamixJavaParameterizedType.class.st deleted file mode 100644 index 9528beae8..000000000 --- a/src/Famix-Java-Entities/FamixJavaParameterizedType.class.st +++ /dev/null @@ -1,75 +0,0 @@ -" -## Relations -====================== - -### Outgoing dependencies -| Relation | Origin | Opposite | Type | Comment | -| `interfaceImplementations` | `FamixTCanImplement` | `implementingClass` | `FamixTImplementation` | Implementation relationships| -| `superInheritances` | `FamixTWithInheritances` | `subclass` | `FamixTInheritance` | Superinheritance relationships, i.e. known superclasses of this type.| - -### Incoming dependencies -| Relation | Origin | Opposite | Type | Comment | -| `implementations` | `FamixTImplementable` | `interface` | `FamixTImplementation` | Implementation relationships.| -| `subInheritances` | `FamixTWithInheritances` | `superclass` | `FamixTInheritance` | Subinheritance relationships, i.e. known subclasses of this type.| - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `arguments` | `FamixTWithParameterizedTypeUsers` | `argumentsInParameterizedTypes` | `FamixTParameterizedTypeUser` | | -| `parameterizableClass` | `FamixTParameterizedType` | `parameterizedTypes` | `FamixTWithParameterizedTypes` | Base type of this parameterized type.| - - - -" -Class { - #name : #FamixJavaParameterizedType, - #superclass : #FamixJavaType, - #traits : 'FamixTCanImplement + FamixTImplementable + FamixTParameterizedType + FamixTWithInheritances + FamixTWithParameterizedTypeUsers', - #classTraits : 'FamixTCanImplement classTrait + FamixTImplementable classTrait + FamixTParameterizedType classTrait + FamixTWithInheritances classTrait + FamixTWithParameterizedTypeUsers classTrait', - #category : #'Famix-Java-Entities-Entities' -} - -{ #category : #meta } -FamixJavaParameterizedType class >> annotation [ - - - - - ^ self -] - -{ #category : #enumerating } -FamixJavaParameterizedType >> allSuperclassesDo: aBlock [ - "override traversal to include supertypes of parameterizable class" - - | recursion | - recursion := [ :each | - aBlock value: each superclass. - each superclass allSuperclassesDo: aBlock ]. - self superInheritances do: recursion. - self parameterizableClass ifNotNil: [ :class | - class superInheritances do: recursion ] -] - -{ #category : #printing } -FamixJavaParameterizedType >> displayStringOn: aStream [ - self mooseNameOn: aStream -] - -{ #category : #testing } -FamixJavaParameterizedType >> isParameterizedType [ - ^ true -] - -{ #category : #accessing } -FamixJavaParameterizedType >> mooseNameOn: aStream [ - - self name ifNotNil: [ :n | aStream << n ] ifNil: [ - parameterizableClass - ifNotNil: [ :pc | pc mooseNameOn: aStream ] - ifNil: [ aStream nextPutAll: self class undefinedName ] ]. - aStream nextPut: $<. - self arguments - do: [ :each | each mooseNameOn: aStream ] - separatedBy: [ aStream nextPut: $, ]. - aStream nextPut: $> -] diff --git a/src/Famix-Java-Entities/FamixJavaParametricClass.class.st b/src/Famix-Java-Entities/FamixJavaParametricClass.class.st new file mode 100644 index 000000000..709612f4f --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaParametricClass.class.st @@ -0,0 +1,36 @@ +" +## Relations +====================== + +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretisation` | concretisations relationships, i.e. known concreteEntities of this type.| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `genericEntity` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretisation` | genericEntity relationships, i.e. known genericEntity of this type.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | list of concreteParameters| +| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | list of genericParameters| + + + +" +Class { + #name : #FamixJavaParametricClass, + #superclass : #FamixJavaClass, + #traits : 'FamixTParametricEntity', + #classTraits : 'FamixTParametricEntity classTrait', + #category : #'Famix-Java-Entities-Entities' +} + +{ #category : #meta } +FamixJavaParametricClass class >> annotation [ + + + + + ^ self +] diff --git a/src/Famix-Java-Entities/FamixJavaParametricInterface.class.st b/src/Famix-Java-Entities/FamixJavaParametricInterface.class.st new file mode 100644 index 000000000..413508f9a --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaParametricInterface.class.st @@ -0,0 +1,36 @@ +" +## Relations +====================== + +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretisation` | concretisations relationships, i.e. known concreteEntities of this type.| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `genericEntity` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretisation` | genericEntity relationships, i.e. known genericEntity of this type.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | list of concreteParameters| +| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | list of genericParameters| + + + +" +Class { + #name : #FamixJavaParametricInterface, + #superclass : #FamixJavaInterface, + #traits : 'FamixTParametricEntity', + #classTraits : 'FamixTParametricEntity classTrait', + #category : #'Famix-Java-Entities-Entities' +} + +{ #category : #meta } +FamixJavaParametricInterface class >> annotation [ + + + + + ^ self +] diff --git a/src/Famix-Java-Entities/FamixJavaParametricMethod.class.st b/src/Famix-Java-Entities/FamixJavaParametricMethod.class.st new file mode 100644 index 000000000..59f4d6052 --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaParametricMethod.class.st @@ -0,0 +1,36 @@ +" +## Relations +====================== + +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretisation` | concretisations relationships, i.e. known concreteEntities of this type.| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `genericEntity` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretisation` | genericEntity relationships, i.e. known genericEntity of this type.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | list of concreteParameters| +| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | list of genericParameters| + + + +" +Class { + #name : #FamixJavaParametricMethod, + #superclass : #FamixJavaMethod, + #traits : 'FamixTParametricEntity', + #classTraits : 'FamixTParametricEntity classTrait', + #category : #'Famix-Java-Entities-Entities' +} + +{ #category : #meta } +FamixJavaParametricMethod class >> annotation [ + + + + + ^ self +] diff --git a/src/Famix-Java-Entities/FamixJavaTBound.trait.st b/src/Famix-Java-Entities/FamixJavaTBound.trait.st new file mode 100644 index 000000000..b7a1d25ff --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaTBound.trait.st @@ -0,0 +1,77 @@ +" +Represents a bound for a lower bounded and upper bounded wildcard. + +## Relations +====================== + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `lowerBoundedWildcards` | `FamixJavaTBound` | `lowerBound` | `FamixJavaTBounded` | Wildcards lower bounded by this bound.| +| `upperBoundedWildcards` | `FamixJavaTBound` | `upperBound` | `FamixJavaTBounded` | Wildcards upper bounded by this bound.| + + + +" +Trait { + #name : #FamixJavaTBound, + #instVars : [ + '#lowerBoundedWildcards => FMMany type: #FamixJavaTBounded opposite: #lowerBound', + '#upperBoundedWildcards => FMMany type: #FamixJavaTBounded opposite: #upperBound' + ], + #category : #'Famix-Java-Entities-Traits' +} + +{ #category : #meta } +FamixJavaTBound classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixJavaTBound >> addLowerBoundedWildcard: anObject [ + + ^ self lowerBoundedWildcards add: anObject +] + +{ #category : #adding } +FamixJavaTBound >> addUpperBoundedWildcard: anObject [ + + ^ self upperBoundedWildcards add: anObject +] + +{ #category : #accessing } +FamixJavaTBound >> lowerBoundedWildcards [ + "Relation named: #lowerBoundedWildcards type: #FamixJavaTBounded opposite: #lowerBound" + + + + + ^ lowerBoundedWildcards +] + +{ #category : #accessing } +FamixJavaTBound >> lowerBoundedWildcards: anObject [ + + + lowerBoundedWildcards value: anObject +] + +{ #category : #accessing } +FamixJavaTBound >> upperBoundedWildcards [ + "Relation named: #upperBoundedWildcards type: #FamixJavaTBounded opposite: #upperBound" + + + + + ^ upperBoundedWildcards +] + +{ #category : #accessing } +FamixJavaTBound >> upperBoundedWildcards: anObject [ + + + upperBoundedWildcards value: anObject +] diff --git a/src/Famix-Java-Entities/FamixJavaTBounded.trait.st b/src/Famix-Java-Entities/FamixJavaTBounded.trait.st new file mode 100644 index 000000000..6e8accdc0 --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaTBounded.trait.st @@ -0,0 +1,63 @@ +" +Represents a bounded wildcard, lower bounded with keyword super or upper bounded with keyword extends. + +## Relations +====================== + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `lowerBound` | `FamixJavaTBounded` | `lowerBoundedWildcards` | `FamixJavaTBound` | Lower bound on wildcard, specified by super keyword.| +| `upperBound` | `FamixJavaTBounded` | `upperBoundedWildcards` | `FamixJavaTBound` | Upper bound on wildcard, specified by extends keyword.| + + + +" +Trait { + #name : #FamixJavaTBounded, + #instVars : [ + '#lowerBound => FMOne type: #FamixJavaTBound opposite: #lowerBoundedWildcards', + '#upperBound => FMOne type: #FamixJavaTBound opposite: #upperBoundedWildcards' + ], + #category : #'Famix-Java-Entities-Traits' +} + +{ #category : #meta } +FamixJavaTBounded classSide >> annotation [ + + + + + ^ self +] + +{ #category : #accessing } +FamixJavaTBounded >> lowerBound [ + "Relation named: #lowerBound type: #FamixJavaTBound opposite: #lowerBoundedWildcards" + + + + ^ lowerBound +] + +{ #category : #accessing } +FamixJavaTBounded >> lowerBound: anObject [ + + + lowerBound := anObject +] + +{ #category : #accessing } +FamixJavaTBounded >> upperBound [ + "Relation named: #upperBound type: #FamixJavaTBound opposite: #upperBoundedWildcards" + + + + ^ upperBound +] + +{ #category : #accessing } +FamixJavaTBounded >> upperBound: anObject [ + + + upperBound := anObject +] diff --git a/src/Famix-Java-Entities/FamixJavaTEntityCreator.trait.st b/src/Famix-Java-Entities/FamixJavaTEntityCreator.trait.st index 7ff465405..baa20f2cc 100644 --- a/src/Famix-Java-Entities/FamixJavaTEntityCreator.trait.st +++ b/src/Famix-Java-Entities/FamixJavaTEntityCreator.trait.st @@ -95,6 +95,13 @@ FamixJavaTEntityCreator >> newComment [ ^ self add: FamixJavaComment new ] +{ #category : #'entity creation' } +FamixJavaTEntityCreator >> newConcretisation [ + + + ^ self add: FamixJavaConcretisation new +] + { #category : #'entity creation' } FamixJavaTEntityCreator >> newEnum [ @@ -242,6 +249,13 @@ FamixJavaTEntityCreator >> newParameter [ ^ self add: FamixJavaParameter new ] +{ #category : #'entity creation' } +FamixJavaTEntityCreator >> newParameterConcretisation [ + + + ^ self add: FamixJavaParameterConcretisation new +] + { #category : #'entity creation' } FamixJavaTEntityCreator >> newParameterNamed: aName [ @@ -257,31 +271,31 @@ FamixJavaTEntityCreator >> newParameterType [ ] { #category : #'entity creation' } -FamixJavaTEntityCreator >> newParameterizableClass [ +FamixJavaTEntityCreator >> newParameterTypeNamed: aName [ - ^ self add: FamixJavaParameterizableClass new + ^ self add: (FamixJavaParameterType named: aName) ] { #category : #'entity creation' } -FamixJavaTEntityCreator >> newParameterizableException [ +FamixJavaTEntityCreator >> newParametricClass [ - ^ self add: FamixJavaParameterizableException new + ^ self add: FamixJavaParametricClass new ] { #category : #'entity creation' } -FamixJavaTEntityCreator >> newParameterizableInterface [ +FamixJavaTEntityCreator >> newParametricInterface [ - ^ self add: FamixJavaParameterizableInterface new + ^ self add: FamixJavaParametricInterface new ] { #category : #'entity creation' } -FamixJavaTEntityCreator >> newParameterizedType [ +FamixJavaTEntityCreator >> newParametricMethod [ - ^ self add: FamixJavaParameterizedType new + ^ self add: FamixJavaParametricMethod new ] { #category : #'entity creation' } @@ -353,3 +367,10 @@ FamixJavaTEntityCreator >> newUnknownVariableNamed: aName [ ^ self add: (FamixJavaUnknownVariable named: aName) ] + +{ #category : #'entity creation' } +FamixJavaTEntityCreator >> newWildcard [ + + + ^ self add: FamixJavaWildcard new +] diff --git a/src/Famix-Java-Entities/FamixJavaType.class.st b/src/Famix-Java-Entities/FamixJavaType.class.st index 9fce5eea2..e7615dcb2 100644 --- a/src/Famix-Java-Entities/FamixJavaType.class.st +++ b/src/Famix-Java-Entities/FamixJavaType.class.st @@ -12,13 +12,16 @@ ### Incoming dependencies | Relation | Origin | Opposite | Type | Comment | +| `generics` | `FamixTConcreteParameterType` | `concreteParameter` | `FamixTParameterConcretisation` | generic relationships, i.e. known genericParameter of this type.| | `incomingReferences` | `FamixTReferenceable` | `referredType` | `FamixTReference` | References to this entity by other entities.| ### Other | Relation | Origin | Opposite | Type | Comment | -| `argumentsInParameterizedTypes` | `FamixTParameterizedTypeUser` | `arguments` | `FamixTWithParameterizedTypeUsers` | | +| `concreteEntities` | `FamixTConcreteParameterType` | `concreteParameters` | `FamixTParametricEntity` | concreteEntity of a parameter| +| `lowerBoundedWildcards` | `FamixJavaTBound` | `lowerBound` | `FamixJavaTBounded` | Wildcards lower bounded by this bound.| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| | `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| +| `upperBoundedWildcards` | `FamixJavaTBound` | `upperBound` | `FamixJavaTBounded` | Wildcards upper bounded by this bound.| ## Properties @@ -32,8 +35,8 @@ Class { #name : #FamixJavaType, #superclass : #FamixJavaContainerEntity, - #traits : 'FamixTParameterizedTypeUser + FamixTType + FamixTWithMethods', - #classTraits : 'FamixTParameterizedTypeUser classTrait + FamixTType classTrait + FamixTWithMethods classTrait', + #traits : 'FamixJavaTBound + FamixTConcreteParameterType + FamixTWithMethods', + #classTraits : 'FamixJavaTBound classTrait + FamixTConcreteParameterType classTrait + FamixTWithMethods classTrait', #category : #'Famix-Java-Entities-Entities' } diff --git a/src/Famix-Java-Entities/FamixJavaWildcard.class.st b/src/Famix-Java-Entities/FamixJavaWildcard.class.st new file mode 100644 index 000000000..9077c6b87 --- /dev/null +++ b/src/Famix-Java-Entities/FamixJavaWildcard.class.st @@ -0,0 +1,28 @@ +" +## Relations +====================== + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `lowerBound` | `FamixJavaTBounded` | `lowerBoundedWildcards` | `FamixJavaTBound` | Lower bound on wildcard, specified by super keyword.| +| `upperBound` | `FamixJavaTBounded` | `upperBoundedWildcards` | `FamixJavaTBound` | Upper bound on wildcard, specified by extends keyword.| + + + +" +Class { + #name : #FamixJavaWildcard, + #superclass : #FamixJavaType, + #traits : 'FamixJavaTBounded', + #classTraits : 'FamixJavaTBounded classTrait', + #category : #'Famix-Java-Entities-Entities' +} + +{ #category : #meta } +FamixJavaWildcard class >> annotation [ + + + + + ^ self +] diff --git a/src/Famix-Java-Generator/FamixJavaGenerator.class.st b/src/Famix-Java-Generator/FamixJavaGenerator.class.st index e6cf1b8d5..59176a846 100644 --- a/src/Famix-Java-Generator/FamixJavaGenerator.class.st +++ b/src/Famix-Java-Generator/FamixJavaGenerator.class.st @@ -9,6 +9,7 @@ Class { 'annotationTypeAttribute', 'attribute', 'class', + 'concretisation', 'containerEntity', 'enum', 'enumValue', @@ -20,13 +21,15 @@ Class { 'method', 'package', 'parameter', + 'parameterConcretisation', 'parameterType', - 'parameterizableClass', + 'parametricClass', + 'parametricInterface', + 'parametricMethod', 'primitiveType', 'reference', 'type', 'unknownVariable', - 'parameterizedType', 'indexedFileAnchor', 'tCanBeVolatile', 'tCanBeTransient', @@ -37,9 +40,13 @@ Class { 'tImplementable', 'tCanImplement', 'tWithInterfaces', - 'parameterizableInterface', - 'parameterizableException', - 'import' + 'import', + 'tBounded', + 'tBound', + 'wildcard' + ], + #classInstVars : [ + 'builder' ], #category : #'Famix-Java-Generator' } @@ -56,6 +63,18 @@ FamixJavaGenerator class >> prefix [ ^ #'FamixJava' ] +{ #category : #definition } +FamixJavaGenerator >> commentForTBound [ + + ^ 'Represents a bound for a lower bounded and upper bounded wildcard.' +] + +{ #category : #definition } +FamixJavaGenerator >> commentForTBounded [ + + ^ 'Represents a bounded wildcard, lower bounded with keyword super or upper bounded with keyword extends.' +] + { #category : #definition } FamixJavaGenerator >> commentForTCanBeSynchronized [ ^ 'I allow an entity to be synchronized @@ -138,16 +157,22 @@ FamixJavaGenerator >> defineClasses [ package := builder newClassNamed: #Package. parameter := builder newClassNamed: #Parameter. parameterType := builder newClassNamed: #ParameterType. - parameterizableClass := builder newClassNamed: #ParameterizableClass. - parameterizableException := builder newClassNamed: #ParameterizableException. - parameterizableInterface := builder newClassNamed: #ParameterizableInterface. - parameterizedType := builder newClassNamed: #ParameterizedType. primitiveType := builder newClassNamed: #PrimitiveType. reference := builder newClassNamed: #Reference. type := builder newClassNamed: #Type. unknownVariable := builder newClassNamed: #UnknownVariable. primitiveType withTesting. - + + + parametricClass := builder newClassNamed: #ParametricClass. + parametricMethod := builder newClassNamed: #ParametricMethod. + parametricInterface := builder newClassNamed: #ParametricInterface. + parameterConcretisation := builder newClassNamed: #ParameterConcretisation. + + concretisation := builder newClassNamed: #Concretisation. + wildcard := builder newClassNamed: #Wildcard. + + self defineComments ] @@ -310,23 +335,6 @@ FamixJavaGenerator >> defineHierarchy [ parameter --|> #TWithComments. parameterType --|> type. - parameterType --|> #TParameterType. - - parameterizableClass --|> class. - parameterizableClass --|> #TWithParameterizedTypes. - - parameterizableException --|> exception. - parameterizableException --|> #TWithParameterizedTypes. - - parameterizableInterface --|> interface. - parameterizableInterface --|> #TWithParameterizedTypes. - - parameterizedType --|> type. - parameterizedType --|> #TParameterizedType. - parameterizedType --|> #TWithParameterizedTypeUsers. - parameterizedType --|> #TWithInheritances. - parameterizedType --|> #TCanImplement. - parameterizedType --|> #TImplementable. primitiveType --|> type. primitiveType --|> #TPrimitiveType. @@ -334,40 +342,63 @@ FamixJavaGenerator >> defineHierarchy [ reference --|> #TReference. type --|> containerEntity. - type --|> #TType. - type --|> #TParameterizedTypeUser. type --|> #TWithMethods. unknownVariable --|> namedEntity. unknownVariable --|> #TUnknownVariable. unknownVariable --|> #TInvocationsReceiver. - - + + parametricClass --|> class. + parametricClass --|> #TParametricEntity. + + parametricMethod --|> method. + parametricMethod --|> #TParametricEntity. + + parametricInterface --|> interface. + parametricInterface --|> #TParametricEntity. + + parameterType --|> #TGenericParameterType. + parameterType --|> #TTypedEntity . + + type --|> #TConcreteParameterType. + type --|> tBound. + + concretisation --|> #TConcretisation. + + parameterConcretisation --|> #TParameterConcretisation. + + wildcard --|> type. + wildcard --|> tBounded. + + inheritance --|> #TInheritance. + parameterType --|> #TWithInheritances. + parameterType --|> #TThrowable. ] { #category : #definition } FamixJavaGenerator >> defineProperties [ - super defineProperties. - - (tCanBeVolatile - property: #isVolatile - type: #Boolean - defaultValue: false) comment: 'Entity can be declared volatile'. - (tCanBeTransient - property: #isTransient - type: #Boolean - defaultValue: false) comment: 'Entity can be declared transient'. - (tCanBeSynchronized - property: #isSynchronized - type: #Boolean - defaultValue: false) comment: 'Entity can be declared synchronized' + + ((tCanBeVolatile property: #isVolatile type: #Boolean defaultValue: false) + comment: 'Entity can be declared volatile'). + ((tCanBeTransient property: #isTransient type: #Boolean defaultValue: false) + comment: 'Entity can be declared transient' ). + ((tCanBeSynchronized property: #isSynchronized type: #Boolean defaultValue: false) + comment: 'Entity can be declared synchronized'). ] { #category : #definition } FamixJavaGenerator >> defineRelations [ + ((tBounded property: #lowerBound) comment: 'Lower bound on wildcard, specified by super keyword.') + *- + ((tBound property: #lowerBoundedWildcards) comment: 'Wildcards lower bounded by this bound.'). + + ((tBounded property: #upperBound) comment: 'Upper bound on wildcard, specified by extends keyword.') + *- + ((tBound property: #upperBoundedWildcards) comment: 'Wildcards upper bounded by this bound.'). + ] { #category : #definition } @@ -391,7 +422,8 @@ FamixJavaGenerator >> defineTraits [ tJavaClassMetrics := builder newTraitNamed: #TClassMetrics. - + tBounded := builder newTraitNamed: #TBounded comment: self commentForTBounded. + tBound := builder newTraitNamed: #TBound comment: self commentForTBound ] diff --git a/src/Famix-Java-Tests/FamixJavaParameterizableClassTest.class.st b/src/Famix-Java-Tests/FamixJavaParameterizableClassTest.class.st deleted file mode 100644 index 978e6c989..000000000 --- a/src/Famix-Java-Tests/FamixJavaParameterizableClassTest.class.st +++ /dev/null @@ -1,33 +0,0 @@ -Class { - #name : #FamixJavaParameterizableClassTest, - #superclass : #TestCase, - #category : #'Famix-Java-Tests' -} - -{ #category : #tests } -FamixJavaParameterizableClassTest >> testParameterTypes [ - | model aParameterizableClass | - model := FamixJavaModel new. - model - importFromMSEStream: - '( - (Famix-Java-Entities.Package (id: 1) (name ''PackageA'')) - (Famix-Java-Entities.ParameterizableClass (id: 2) (name ''ParameterizableClassA'') ) - (Famix-Java-Entities.ParameterizableClass (id: 3) (name ''ParameterizableClassB'') ) - (Famix-Java-Entities.ParameterizableClass (id: 4) (name ''ParameterizableClassC'') ) - (Famix-Java-Entities.ParameterType (id: 5) (name ''A'') (typeContainer (ref: 2))) - (Famix-Java-Entities.ParameterType (id: 6) (name ''B'') (typeContainer (ref: 2))) - (Famix-Java-Entities.ParameterType (id: 7) (name ''C'') (typeContainer (ref: 3))) - )' readStream. - self assert: model entities size equals: 7. - self assert: model allParameterizableClasses size equals: 3. - aParameterizableClass := model allParameterizableClasses entityNamed: #ParameterizableClassA. - self assert: aParameterizableClass parameters size equals: 2. - self assert: aParameterizableClass parameters first equals: (model allParameterTypes entityNamed: #'ParameterizableClassA::A'). - self assert: aParameterizableClass parameters last equals: (model allParameterTypes entityNamed: #'ParameterizableClassA::B'). - aParameterizableClass := model allParameterizableClasses entityNamed: #ParameterizableClassB. - self assert: aParameterizableClass parameters size equals: 1. - self assert: aParameterizableClass parameters first equals: (model allParameterTypes entityNamed: #'ParameterizableClassB::C'). - aParameterizableClass := model allParameterizableClasses entityNamed: #ParameterizableClassC. - self assertEmpty: aParameterizableClass parameters -] diff --git a/src/Famix-Java-Tests/FamixJavaParameterizedTypeTest.class.st b/src/Famix-Java-Tests/FamixJavaParameterizedTypeTest.class.st deleted file mode 100644 index d4a44593f..000000000 --- a/src/Famix-Java-Tests/FamixJavaParameterizedTypeTest.class.st +++ /dev/null @@ -1,146 +0,0 @@ -Class { - #name : #FamixJavaParameterizedTypeTest, - #superclass : #TestCase, - #instVars : [ - 'model' - ], - #category : #'Famix-Java-Tests' -} - -{ #category : #running } -FamixJavaParameterizedTypeTest >> setUp [ - super setUp. - model := FamixJavaModel new. - - model - importFromMSEStream: - '( - (Famix-Java-Entities.Package (id: 1) (name ''PackageA'')) - (Famix-Java-Entities.Class (id: 2) (name ''ClassA'')) - - (Famix-Java-Entities.ParameterizableClass (id: 3) (name ''ParameterizableClassA'')) - (Famix-Java-Entities.ParameterType (id: 5) (name ''A'') (typeContainer (ref: 3))) - (Famix-Java-Entities.ParameterType (id: 6) (name ''B'') (typeContainer (ref: 3))) - (Famix-Java-Entities.ParameterType (id: 7) (name ''C'') (typeContainer (ref: 3))) - - (Famix-Java-Entities.Type (id: 4) (name ''TypeB'')) - (Famix-Java-Entities.Type (id: 5) (name ''TypeC'')) - (Famix-Java-Entities.ParameterizedType (id: 6) (parameterizableClass (ref: 3)) (arguments (ref: 4))) - (Famix-Java-Entities.ParameterizedType (id: 7) (parameterizableClass (ref: 3)) (arguments (ref: 4) (ref: 5))) - - (Famix-Java-Entities.Attribute (id: 8) (name ''attributeA1'') (parentType (ref: 2)) (declaredType (ref: 6))) - (Famix-Java-Entities.Attribute (id: 9) (name ''attributeA2'') (parentType (ref: 2)) (declaredType (ref: 7))) - - (Famix-Java-Entities.Method (id: 10) (name ''methodA1'') (parentType (ref: 2)) (declaredType (ref: 6))) - (Famix-Java-Entities.Method (id: 11) (name ''methodA2'') (parentType (ref: 2)) (declaredType (ref: 7))) - - (Famix-Java-Entities.Parameter (id: 12) (name ''parameterMtdA1'') (parentBehaviouralEntity (ref: 10)) (declaredType (ref: 6))) - (Famix-Java-Entities.Parameter (id: 13) (name ''parameterMtdA2'') (parentBehaviouralEntity (ref: 11)) (declaredType (ref: 7))) - - (Famix-Java-Entities.LocalVariable (id: 14) (name ''localVariableMtdA1'') (parentBehaviouralEntity (ref: 10)) (declaredType (ref: 6))) - (Famix-Java-Entities.LocalVariable (id: 15) (name ''localVariableMtdA2'') (parentBehaviouralEntity (ref: 11)) (declaredType (ref: 7))) - )' readStream -] - -{ #category : #tests } -FamixJavaParameterizedTypeTest >> testArgumentTypes [ - | fmxEntity fmxMethod declaredType typeB typeC parameterizedTypeA parameterizedTypeB parameterizableClassA | - parameterizedTypeB := model allParameterizedTypes entityNamed: #'ParameterizableClassA'. - parameterizedTypeA := model allParameterizedTypes entityNamed: #'ParameterizableClassA'. - parameterizableClassA := (model entities select: [ :each | each name = 'ParameterizableClassA' ]) at: 1. - typeB := (model entities select: [ :each | each name = 'TypeB' ]) at: 1. - typeC := (model entities select: [ :each | each name = 'TypeC' ]) at: 1. - fmxEntity := model allAttributes entityNamed: #'ClassA.attributeA1'. - declaredType := fmxEntity declaredType. - self assert: declaredType equals: parameterizedTypeA. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 1. - self assert: (declaredType arguments at: 1) equals: typeB. - fmxEntity := model allAttributes entityNamed: #'ClassA.attributeA2'. - declaredType := fmxEntity declaredType. - self assert: declaredType equals: parameterizedTypeB. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 2. - self assert: (declaredType arguments at: 1) equals: typeB. - self assert: (declaredType arguments at: 2) equals: typeC. - fmxMethod := (model allMethods select: [ :each | each name = 'methodA1' ]) at: 1. - declaredType := fmxMethod declaredType. - self assert: declaredType equals: parameterizedTypeA. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 1. - self assert: (declaredType arguments at: 1) equals: typeB. - fmxEntity := (fmxMethod parameters select: [ :each | each name = 'parameterMtdA1' ]) at: 1. - declaredType := fmxEntity declaredType. - self assert: declaredType equals: parameterizedTypeA. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 1. - self assert: (declaredType arguments at: 1) equals: typeB. - fmxEntity := (fmxMethod localVariables select: [ :each | each name = 'localVariableMtdA1' ]) at: 1. - declaredType := fmxEntity declaredType. - self assert: declaredType equals: parameterizedTypeA. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 1. - self assert: (declaredType arguments at: 1) equals: typeB. - fmxMethod := (model allMethods select: [ :each | each name = 'methodA2' ]) at: 1. - declaredType := fmxMethod declaredType. - self assert: declaredType equals: parameterizedTypeB. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 2. - self assert: (declaredType arguments at: 1) equals: typeB. - self assert: (declaredType arguments at: 2) equals: typeC. - fmxEntity := (fmxMethod parameters select: [ :each | each name = 'parameterMtdA2' ]) at: 1. - declaredType := fmxEntity declaredType. - self assert: declaredType equals: parameterizedTypeB. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 2. - self assert: (declaredType arguments at: 1) equals: typeB. - self assert: (declaredType arguments at: 2) equals: typeC. - fmxEntity := (fmxMethod localVariables select: [ :each | each name = 'localVariableMtdA2' ]) at: 1. - declaredType := fmxEntity declaredType. - self assert: declaredType equals: parameterizedTypeB. - self assert: declaredType parameterizableClass equals: parameterizableClassA. - self assert: declaredType arguments size equals: 2. - self assert: (declaredType arguments at: 1) equals: typeB. - self assert: (declaredType arguments at: 2) equals: typeC -] - -{ #category : #tests } -FamixJavaParameterizedTypeTest >> testArguments [ - | parameterizableType | - parameterizableType := model allParameterizedTypes entityNamed: #'ParameterizableClassA'. - self denyEmpty: parameterizableType arguments. - self assert: parameterizableType arguments size equals: 2 -] - -{ #category : #tests } -FamixJavaParameterizedTypeTest >> testArgumentsConstruction [ - | parameterizableType argument1 argument2 | - parameterizableType := FamixJavaParameterizedType new. - argument1 := FamixJavaClass new. - argument2 := FamixJavaClass new. - parameterizableType arguments: {argument1}. - parameterizableType arguments add: argument2. - self assert: parameterizableType arguments size equals: 2. - self assert: argument1 argumentsInParameterizedTypes size equals: 1. - self assert: argument1 argumentsInParameterizedTypes first equals: parameterizableType. - self assert: argument2 argumentsInParameterizedTypes size equals: 1. - self assert: argument2 argumentsInParameterizedTypes first equals: parameterizableType -] - -{ #category : #tests } -FamixJavaParameterizedTypeTest >> testModelSize [ - self assert: model entities size equals: 18. - self assert: model allParameterizedTypes size equals: 2 -] - -{ #category : #tests } -FamixJavaParameterizedTypeTest >> testMooseName [ - | parameterizableType | - parameterizableType := model allParameterizedTypes entityNamed: #'ParameterizableClassA'. - self assert: parameterizableType isNotNil -] - -{ #category : #tests } -FamixJavaParameterizedTypeTest >> testParameterizableClass [ - self assert: model allParameterizableClasses anyOne parameterizedTypes size equals: 2 -] diff --git a/src/Famix-Java-Tests/FamixJavaParametricTest.class.st b/src/Famix-Java-Tests/FamixJavaParametricTest.class.st new file mode 100644 index 000000000..053174a99 --- /dev/null +++ b/src/Famix-Java-Tests/FamixJavaParametricTest.class.st @@ -0,0 +1,185 @@ +Class { + #name : #FamixJavaParametricTest, + #superclass : #TestCase, + #instVars : [ + 'parametricClass1' + ], + #category : #'Famix-Java-Tests' +} + +{ #category : #running } +FamixJavaParametricTest >> setUp [ + super setUp. + + parametricClass1 := FamixJavaParametricClass named:'ParametricClass1' + +] + +{ #category : #running } +FamixJavaParametricTest >> test1 [ +"List testMethod(List list)" +| method parametre list | + +method := FamixJavaParametricMethod named:'testMethod'. +parametre := FamixJavaParameter named:'list'. +list := FamixJavaParametricClass named:'List'. +list addConcreteParameter: (FamixJavaType named:'Object'). +parametre declaredType: list. +method addParameter: parametre. +method declaredType: list. +method addConcreteParameter: list + + + + +] + +{ #category : #running } +FamixJavaParametricTest >> test2 [ + +"public genericMethod(T t)" +| m p return | +m:= FamixJavaParametricMethod named:'genericMethod'. +p := FamixJavaParameter named:'t'. +p declaredType: (FamixJavaParameterType named:'T'). +m addParameter: p. +return := FamixJavaParameterType named:'T'. +FamixJavaInheritance new subclass: return ; superclass: (FamixJavaClass named:'Building'). +m declaredType: return. +m. + + + + +] + +{ #category : #running } +FamixJavaParametricTest >> test3 [ + +"public class ClassA {} + public class ClassB extends classA{String, V} + private void method (Interger num ,String s, V v){ + }" + +| method classA k v classAbis string num s t vparam | +classA := FamixJavaParametricClass named:'ClassA'. +k := FamixJavaParameterType named:'K'. +v := FamixJavaParameterType named:'V'. +classA genericParameters: { k.v }. +classAbis := FamixJavaParametricClass named:'ClassA'. +FamixJavaConcretisation new concreteEntity: classAbis ; genericEntity: classA. +string :=FamixJavaType named:'string'. +FamixJavaParameterConcretisation new concreteParameter: string ; genericParameter: k. + +method := FamixJavaParametricMethod named:'method'. +num := FamixJavaParameter named:'num'. +s := FamixJavaParameter named:'s'. +vparam := FamixJavaParameter named:'v'. +num declaredType: (FamixJavaClass named:'Integer'). +s declaredType: (FamixJavaClass named:'String'). +vparam declaredType: v. +method parameters: { num. s. vparam }. +method addGenericParameter: vparam declaredType . + +] + +{ #category : #running } +FamixJavaParametricTest >> testConcreteAndGenericParameter [ +"classA --> classB extends classA" + | parameter1 parameter2 | + parameter1 := FamixJavaType named: 'String'. + parameter2 := FamixJavaParameterType named: 'V'. + + parametricClass1 concreteParameters: { parameter1 }. + parametricClass1 genericParameters: { parameter2 }. + self + assertCollection: parametricClass1 concreteParameters + hasSameElements: { parameter1 }. + self + assertCollection: parametricClass1 genericParameters + hasSameElements: { parameter2 } +] + +{ #category : #running } +FamixJavaParametricTest >> testConcretisationEntity [ +"List --> classB extends List" +| listT listString | +listT := FamixJavaParametricClass named: 'ListT'. +listString := FamixJavaParametricClass named: 'ListString'. +FamixJavaConcretisation new concreteEntity: listString ; genericEntity: listT . +self assertCollection: (listT concretisations collect:#concreteEntity ) + hasSameElements: { listString } +] + +{ #category : #running } +FamixJavaParametricTest >> testConcretisationParameter [ +"classA --> classB extends classA" +| parameterConcrete parameterGeneric | +parameterConcrete := FamixJavaType named:'parametric'. +parameterGeneric := FamixJavaParameterType named:'Generic'. +FamixJavaParameterConcretisation new concreteParameter: parameterConcrete; genericParameter: parameterGeneric. + +self assertCollection: (parameterGeneric concretisations collect:#concreteParameter ) hasSameElements:{parameterConcrete } +] + +{ #category : #running } +FamixJavaParametricTest >> testInheritanceClass [ + +| class1 class2 | + +class1 := FamixJavaClass named:'Class1'. +class2 := FamixJavaClass named:'Class2'. + +parametricClass1 addSubInheritance: (FamixJavaInheritance new + subclass: class1 ; + superclass: parametricClass1 ). + +class1 addSubInheritance: (FamixJavaInheritance new subclass: class2; +superclass: class1). + +self assertCollection: (parametricClass1 subclassHierarchy ) + hasSameElements: {class1. class2} +] + +{ #category : #running } +FamixJavaParametricTest >> testInheritanceParameter [ + +" " +| supGeneric subGeneric subConcrete | +supGeneric :=FamixJavaParameterType named:'supGeneric'. +subGeneric := FamixJavaParameterType named:'subGeneric'. +subConcrete := FamixJavaClass named:'String'. + +FamixJavaInheritance new subclass: subGeneric ; superclass: supGeneric . +self assertCollection: (supGeneric subInheritances collect:#subclass) hasSameElements: { subGeneric } . +subConcrete addSuperInheritance: ( FamixJavaInheritance new subclass: subConcrete ; superclass: supGeneric) . +self assertCollection: (supGeneric subInheritances collect:#subclass) hasSameElements: { subGeneric. subConcrete } . +] + +{ #category : #running } +FamixJavaParametricTest >> testIsConcreteEntity [ + + +| parameter1 parameter2 | +parameter1 := FamixJavaType named:'String'. +parameter2 := FamixJavaParameterType named:'V'. +self assert: parametricClass1 isConcreteEntity. +parametricClass1 concreteParameters: { parameter1 }. +self assert: parametricClass1 isConcreteEntity. +parametricClass1 genericParameters: { parameter2 }. +self deny: parametricClass1 isConcreteEntity. + +] + +{ #category : #running } +FamixJavaParametricTest >> testIsGenericEnity [ + +| listT k | +listT := FamixJavaParametricClass named: 'ListT'. +k := FamixJavaParameterType named:'K'. +self assert: listT isConcreteEntity. +listT genericParameters: { k }. +listT genericParameters . +self deny: listT isConcreteEntity. +self assert: listT isGenericEntity. +] diff --git a/src/Famix-Java-Visitor/FamixJavaParameterizableClass.extension.st b/src/Famix-Java-Visitor/FamixJavaParameterizableClass.extension.st deleted file mode 100644 index 7fc6d14a2..000000000 --- a/src/Famix-Java-Visitor/FamixJavaParameterizableClass.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #FamixJavaParameterizableClass } - -{ #category : #'*Famix-Java-Visitor-generated' } -FamixJavaParameterizableClass >> accept: aFamixJavaVisitor [ - ^ aFamixJavaVisitor visitParameterizableClass: self -] diff --git a/src/Famix-Java-Visitor/FamixJavaParameterizedType.extension.st b/src/Famix-Java-Visitor/FamixJavaParameterizedType.extension.st deleted file mode 100644 index b0e5f02f6..000000000 --- a/src/Famix-Java-Visitor/FamixJavaParameterizedType.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #FamixJavaParameterizedType } - -{ #category : #'*Famix-Java-Visitor-generated' } -FamixJavaParameterizedType >> accept: aFamixJavaVisitor [ - ^ aFamixJavaVisitor visitParameterizedType: self -] diff --git a/src/Famix-MetamodelGeneration/FamixGenerator.class.st b/src/Famix-MetamodelGeneration/FamixGenerator.class.st index 859a39ca9..2d722cdec 100644 --- a/src/Famix-MetamodelGeneration/FamixGenerator.class.st +++ b/src/Famix-MetamodelGeneration/FamixGenerator.class.st @@ -40,8 +40,6 @@ Class { 'tPackage', 'tPackageable', 'tParameter', - 'tParameterizedType', - 'tParameterizedTypeUser', 'tPreprocessorDefine', 'tPreprocessorIfdef', 'tReference', @@ -76,8 +74,6 @@ Class { 'tWithLocalVariables', 'tWithMethods', 'tDefinedInModule', - 'tWithParameterizedTypeUsers', - 'tWithParameterizedTypes', 'tWithParameters', 'tWithReferences', 'tWithTemplates', @@ -124,7 +120,13 @@ Class { 'tImplementation', 'tImportable', 'tImport', - 'tWithImports' + 'tWithImports', + 'tConcretisation', + 'tParameterConcretisation', + 'tParametricEntity', + 'tConcreteParameterType', + 'tGenericParameterType', + 'tThrowable' ], #category : #'Famix-MetamodelGeneration' } @@ -296,6 +298,18 @@ FamixGenerator >> commentForTCompilationUnit [ ^ 'I represent a compilation unit file. Typically a .c or .cpp file' ] +{ #category : #comments } +FamixGenerator >> commentForTConcreteParameterType [ + + ^ 'FamixTConcreteParameterType represents the concretePamameters of an FamixTParametricEntity. it can be a class or a ParameterType that has one FamixTParameterConcretization' +] + +{ #category : #comments } +FamixGenerator >> commentForTConcretisation [ + + ^ '' +] + { #category : #comments } FamixGenerator >> commentForTDeclaredException [ @@ -392,6 +406,12 @@ FamixGenerator >> commentForTFunction [ ^ 'FamixTFunction represents a behavioural entity in a procedural language.' ] +{ #category : #comments } +FamixGenerator >> commentForTGenericParameterType [ + + ^ 'FamixTGenericParameterType represents generic parameters in an FamixJavaParametricEntity. This is an FamixJavaParameterType' +] + { #category : #comments } FamixGenerator >> commentForTGlobalVariable [ @@ -543,6 +563,12 @@ int addNumbers(int a, int b) { ' ] +{ #category : #comments } +FamixGenerator >> commentForTParameterConcretisation [ + + ^ '' +] + { #category : #comments } FamixGenerator >> commentForTParameterType [ ^ 'ParameterType represents the symbolic type used in parameterizable classes. This is a FamixTType. @@ -556,22 +582,16 @@ Where AClass is a ParameterizableClass. A, B and C are ParameterType of AClass.' ] { #category : #comments } -FamixGenerator >> commentForTParameterizedType [ +FamixGenerator >> commentForTParametricEntity [ - ^ 'FamixTParameterizedType represents a type with arguments. So, it is an instantiation for the use of FamixTParameterizableClass. It can appear as a type of an attribute, a type of a local variable, a parameter of a method, a return of a method, etc. + ^ 'FamixTParametricEntity represents a type with parameters. It can be an parametricClass, parametricMethod, parametricInterface. Example: ... public Map anAttribute; ... -Where Map is the FamixTParameterizedType of anAttribute. String and Collection are arguments. Map is the parameterizableClass.' -] - -{ #category : #comments } -FamixGenerator >> commentForTParameterizedTypeUser [ - - ^ '' +Where Map is the FamixTParametricEntity of anAttribute. String and Collection are concrete parameters. Map is the parametricClass.' ] { #category : #comments } @@ -681,6 +701,12 @@ FamixGenerator >> commentForTTemplateUser [ ^ '' ] +{ #category : #comments } +FamixGenerator >> commentForTThrowable [ + +^ 'TThrowable represents all types of possible exceptions.' +] + { #category : #comments } FamixGenerator >> commentForTThrownException [ @@ -874,18 +900,6 @@ FamixGenerator >> commentForTWithPackages [ ^ '' ] -{ #category : #comments } -FamixGenerator >> commentForTWithParameterizedTypeUsers [ - - ^ '' -] - -{ #category : #comments } -FamixGenerator >> commentForTWithParameterizedTypes [ - - ^ '' -] - { #category : #comments } FamixGenerator >> commentForTWithParameters [ @@ -1075,6 +1089,14 @@ FamixGenerator >> defineHierarchy [ tWithStatements --|> tSourceEntity. tWithStatements --|> tWithReferences. + + tConcretisation --|> tAssociation . + tParameterConcretisation --|> tAssociation . + + tConcreteParameterType --|> tType . + tGenericParameterType --|> tType. + + tException --|> tThrowable. ] { #category : #definition } @@ -1158,7 +1180,7 @@ FamixGenerator >> defineProperties [ (tRelativeSourceAnchor property: #startPos type: #Number) comment: 'Start position in the source'. (tRelativeSourceAnchor property: #endPos type: #Number) comment: - 'Stop position in the source' + 'Stop position in the source'. ] { #category : #definition } @@ -1224,7 +1246,7 @@ FamixGenerator >> defineRelations [ ((tWithAttributes property: #attributes) comment: 'List of attributes declared by this type.'). - ((tException property: #catchingEntities)) + ((tThrowable property: #catchingEntities)) *-* ((tWithExceptions property: #caughtExceptions) comment: 'The exceptions caught by the method'). @@ -1241,7 +1263,7 @@ FamixGenerator >> defineRelations [ - ((tWithCompilationUnits property: #compilationUnit)). - ((tException property: #declaringEntities)) + ((tThrowable property: #declaringEntities)) *-* ((tWithExceptions property: #declaredExceptions) comment: 'The exceptions declared by the method'). @@ -1377,15 +1399,6 @@ FamixGenerator >> defineRelations [ ((tWithParameters property: #parameters) comment: 'List of formal parameters declared by this behaviour.'). - ((tParameterizedType property: #parameterizableClass) - comment: 'Base type of this parameterized type.') - *- - ((tWithParameterizedTypes property: #parameterizedTypes)). - - ((tParameterizedTypeUser property: #argumentsInParameterizedTypes)) - *-* - ((tWithParameterizedTypeUsers property: #arguments)). - ((tReference property: #referencer) comment: 'Source entity making the reference. from-side of the association'; source) @@ -1434,7 +1447,7 @@ FamixGenerator >> defineRelations [ -* ((tTemplateUser property: #template)). - ((tException property: #throwingEntities)) + ((tThrowable property: #throwingEntities)) *-* ((tWithExceptions property: #thrownExceptions) comment: 'The exceptions thrown by the method'). @@ -1487,8 +1500,51 @@ FamixGenerator >> defineRelations [ *- ((tImplementable property: #implementations) comment: 'Implementation relationships.'). + + + + (tConcretisation property:#parameterConcretisations) + *-* + (tParameterConcretisation property:#concretisations). + + ((tGenericParameterType property:#genericEntities) + comment: 'genericEntity of a parameter') + *-* + ((tParametricEntity property:#genericParameters) + comment: 'list of genericParameters'). + + ((tConcreteParameterType property:#concreteEntities) + comment: 'concreteEntity of a parameter') + *-* + ((tParametricEntity property:#concreteParameters) + comment: 'list of concreteParameters'). + + ((tParameterConcretisation property:#genericParameter) + comment: 'genericParameter linked to in this relationship. from-side of the association'; source) + *- + ((tGenericParameterType property:#concretisations) + comment: 'concretisations relationships, i.e. known concretisation of this type.'). + + ((tParameterConcretisation property:#concreteParameter) + comment: 'concreteParameter linked to in this relationship. to-side of the association'; target) + *- + ((tConcreteParameterType property:#generics) + comment: 'generic relationships, i.e. known genericParameter of this type.'). + + ((tConcretisation property: #genericEntity) + comment: 'genericEntity linked to in this relationship. from-side of the association'; source) + *- + ((tParametricEntity property: #concretisations) + comment: 'concretisations relationships, i.e. known concreteEntities of this type.'). + + ((tConcretisation property: #concreteEntity) + comment: 'concreteEntity linked to in this relationship. to-side of the association'; target) + - + ((tParametricEntity property: #genericEntity) + comment: 'genericEntity relationships, i.e. known genericEntity of this type.'). + ] { #category : #definition } @@ -1652,15 +1708,6 @@ FamixGenerator >> defineTraits [ tParameter := builder newTraitNamed: #TParameter. tParameter comment: self commentForTParameter. - tParameterizedType := builder newTraitNamed: #TParameterType. - tParameterizedType comment: self commentForTParameterType. - - tParameterizedType := builder newTraitNamed: #TParameterizedType. - tParameterizedType comment: self commentForTParameterizedType. - - tParameterizedTypeUser := builder newTraitNamed: #TParameterizedTypeUser. - tParameterizedTypeUser comment: self commentForTParameterizedTypeUser. - tPreprocessorDefine := builder newTraitNamed: #TPreprocessorDefine. tPreprocessorDefine comment: self commentForTPreprocessorDefine. @@ -1790,13 +1837,6 @@ FamixGenerator >> defineTraits [ tDefinedInModule := builder newTraitNamed: #TDefinedInModule. tDefinedInModule comment: self commentForTDefinedInModule. - - tWithParameterizedTypeUsers := builder newTraitNamed: #TWithParameterizedTypeUsers. - tWithParameterizedTypeUsers comment: self commentForTWithParameterizedTypeUsers. - - tWithParameterizedTypes := builder newTraitNamed: #TWithParameterizedTypes. - tWithParameterizedTypes comment: self commentForTWithParameterizedTypes. - tWithParameters := builder newTraitNamed: #TWithParameters. tWithParameters comment: self commentForTWithParameters. @@ -1845,4 +1885,18 @@ FamixGenerator >> defineTraits [ newTraitNamed: #TCanImplement comment: self commentForTCanImplement. tImplementation := builder newTraitNamed: #TImplementation. + + tParametricEntity := builder newTraitNamed: #TParametricEntity + comment: self commentForTParametricEntity . + tConcreteParameterType := builder newTraitNamed: #TConcreteParameterType + comment: self commentForTConcreteParameterType. + tGenericParameterType := builder newTraitNamed: #TGenericParameterType + comment: self commentForTGenericParameterType. + tConcretisation := builder newTraitNamed: #TConcretisation + comment: self commentForTConcretisation. + tParameterConcretisation := builder newTraitNamed: #TParameterConcretisation + comment: self commentForTParameterConcretisation. + tThrowable := builder newTraitNamed: #TThrowable + comment: self commentForTThrowable. + ] diff --git a/src/Famix-Traits/FamixTConcreteParameterType.trait.st b/src/Famix-Traits/FamixTConcreteParameterType.trait.st new file mode 100644 index 000000000..f78b22f53 --- /dev/null +++ b/src/Famix-Traits/FamixTConcreteParameterType.trait.st @@ -0,0 +1,95 @@ +" +FamixTConcreteParameterType represents the concretePamameters of an FamixTParametricEntity. it can be a class or a ParameterType that has one FamixTParameterConcretization + +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +| `typeContainer` | `FamixTType` | `types` | `FamixTWithTypes` | Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `generics` | `FamixTConcreteParameterType` | `concreteParameter` | `FamixTParameterConcretisation` | generic relationships, i.e. known genericParameter of this type.| +| `incomingReferences` | `FamixTReferenceable` | `referredType` | `FamixTReference` | References to this entity by other entities.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concreteEntities` | `FamixTConcreteParameterType` | `concreteParameters` | `FamixTParametricEntity` | concreteEntity of a parameter| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| +| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| +| `name` | `String` | nil | Basic name of the entity, not full reference.| + +" +Trait { + #name : #FamixTConcreteParameterType, + #instVars : [ + '#concreteEntities => FMMany type: #FamixTParametricEntity opposite: #concreteParameters', + '#generics => FMMany type: #FamixTParameterConcretisation opposite: #concreteParameter' + ], + #traits : 'FamixTType', + #classTraits : 'FamixTType classTrait', + #category : #'Famix-Traits-Traits' +} + +{ #category : #meta } +FamixTConcreteParameterType classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixTConcreteParameterType >> addConcreteEntity: anObject [ + + ^ self concreteEntities add: anObject +] + +{ #category : #adding } +FamixTConcreteParameterType >> addGeneric: anObject [ + + ^ self generics add: anObject +] + +{ #category : #accessing } +FamixTConcreteParameterType >> concreteEntities [ + "Relation named: #concreteEntities type: #FamixTParametricEntity opposite: #concreteParameters" + + + + + ^ concreteEntities +] + +{ #category : #accessing } +FamixTConcreteParameterType >> concreteEntities: anObject [ + + + concreteEntities value: anObject +] + +{ #category : #accessing } +FamixTConcreteParameterType >> generics [ + "Relation named: #generics type: #FamixTParameterConcretisation opposite: #concreteParameter" + + + + + ^ generics +] + +{ #category : #accessing } +FamixTConcreteParameterType >> generics: anObject [ + + + generics value: anObject +] diff --git a/src/Famix-Traits/FamixTConcretisation.trait.st b/src/Famix-Traits/FamixTConcretisation.trait.st new file mode 100644 index 000000000..a79fbc261 --- /dev/null +++ b/src/Famix-Traits/FamixTConcretisation.trait.st @@ -0,0 +1,103 @@ +" +## Relations +====================== + +### Association source +| Relation | Origin | Opposite | Type | Comment | +| `genericEntity` | `FamixTConcretisation` | `concretisations` | `FamixTParametricEntity` | genericEntity linked to in this relationship. from-side of the association| + +### Association target +| Relation | Origin | Opposite | Type | Comment | +| `concreteEntity` | `FamixTConcretisation` | `genericEntity` | `FamixTParametricEntity` | concreteEntity linked to in this relationship. to-side of the association| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| +| `parameterConcretisations` | `FamixTConcretisation` | `concretisations` | `FamixTParameterConcretisation` | | +| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| + +" +Trait { + #name : #FamixTConcretisation, + #instVars : [ + '#concreteEntity => FMOne type: #FamixTParametricEntity opposite: #genericEntity', + '#genericEntity => FMOne type: #FamixTParametricEntity opposite: #concretisations', + '#parameterConcretisations => FMMany type: #FamixTParameterConcretisation opposite: #concretisations' + ], + #traits : 'FamixTAssociation', + #classTraits : 'FamixTAssociation classTrait', + #category : #'Famix-Traits-Traits' +} + +{ #category : #meta } +FamixTConcretisation classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixTConcretisation >> addParameterConcretisation: anObject [ + + ^ self parameterConcretisations add: anObject +] + +{ #category : #accessing } +FamixTConcretisation >> concreteEntity [ + "Relation named: #concreteEntity type: #FamixTParametricEntity opposite: #genericEntity" + + + + + ^ concreteEntity +] + +{ #category : #accessing } +FamixTConcretisation >> concreteEntity: anObject [ + + + concreteEntity := anObject +] + +{ #category : #accessing } +FamixTConcretisation >> genericEntity [ + "Relation named: #genericEntity type: #FamixTParametricEntity opposite: #concretisations" + + + + + ^ genericEntity +] + +{ #category : #accessing } +FamixTConcretisation >> genericEntity: anObject [ + + + genericEntity := anObject +] + +{ #category : #accessing } +FamixTConcretisation >> parameterConcretisations [ + "Relation named: #parameterConcretisations type: #FamixTParameterConcretisation opposite: #concretisations" + + + + ^ parameterConcretisations +] + +{ #category : #accessing } +FamixTConcretisation >> parameterConcretisations: anObject [ + + + parameterConcretisations value: anObject +] diff --git a/src/Famix-Traits/FamixTException.trait.st b/src/Famix-Traits/FamixTException.trait.st index 9db9488f1..79c3a4731 100644 --- a/src/Famix-Traits/FamixTException.trait.st +++ b/src/Famix-Traits/FamixTException.trait.st @@ -24,12 +24,12 @@ This is the abstract representation of an Exception. It is specific to Java. It ### Other | Relation | Origin | Opposite | Type | Comment | -| `catchingEntities` | `FamixTException` | `caughtExceptions` | `FamixTWithExceptions` | | +| `catchingEntities` | `FamixTThrowable` | `caughtExceptions` | `FamixTWithExceptions` | | | `comments` | `FamixTWithComments` | `commentedEntity` | `FamixTComment` | List of comments for the entity| -| `declaringEntities` | `FamixTException` | `declaredExceptions` | `FamixTWithExceptions` | | +| `declaringEntities` | `FamixTThrowable` | `declaredExceptions` | `FamixTWithExceptions` | | | `receivingInvocations` | `FamixTInvocationsReceiver` | `receiver` | `FamixTInvocation` | List of invocations performed on this entity (considered as the receiver)| | `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| -| `throwingEntities` | `FamixTException` | `thrownExceptions` | `FamixTWithExceptions` | | +| `throwingEntities` | `FamixTThrowable` | `thrownExceptions` | `FamixTWithExceptions` | | | `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| @@ -43,13 +43,8 @@ This is the abstract representation of an Exception. It is specific to Java. It " Trait { #name : #FamixTException, - #instVars : [ - '#catchingEntities => FMMany type: #FamixTWithExceptions opposite: #caughtExceptions', - '#declaringEntities => FMMany type: #FamixTWithExceptions opposite: #declaredExceptions', - '#throwingEntities => FMMany type: #FamixTWithExceptions opposite: #thrownExceptions' - ], - #traits : 'FamixTClass', - #classTraits : 'FamixTClass classTrait', + #traits : 'FamixTClass + FamixTThrowable', + #classTraits : 'FamixTClass classTrait + FamixTThrowable classTrait', #category : #'Famix-Traits-Exception' } @@ -62,75 +57,9 @@ FamixTException classSide >> annotation [ ^ self ] -{ #category : #adding } -FamixTException >> addCatchingEntity: anObject [ - - ^ self catchingEntities add: anObject -] - -{ #category : #adding } -FamixTException >> addDeclaringEntity: anObject [ - - ^ self declaringEntities add: anObject -] - -{ #category : #adding } -FamixTException >> addThrowingEntity: anObject [ - - ^ self throwingEntities add: anObject -] - -{ #category : #accessing } -FamixTException >> catchingEntities [ - "Relation named: #catchingEntities type: #FamixTWithExceptions opposite: #caughtExceptions" - - - - ^ catchingEntities -] - -{ #category : #accessing } -FamixTException >> catchingEntities: anObject [ - - - catchingEntities value: anObject -] - -{ #category : #accessing } -FamixTException >> declaringEntities [ - "Relation named: #declaringEntities type: #FamixTWithExceptions opposite: #declaredExceptions" - - - - ^ declaringEntities -] - -{ #category : #accessing } -FamixTException >> declaringEntities: anObject [ - - - declaringEntities value: anObject -] - { #category : #testing } FamixTException >> isException [ ^ true ] - -{ #category : #accessing } -FamixTException >> throwingEntities [ - "Relation named: #throwingEntities type: #FamixTWithExceptions opposite: #thrownExceptions" - - - - ^ throwingEntities -] - -{ #category : #accessing } -FamixTException >> throwingEntities: anObject [ - - - throwingEntities value: anObject -] diff --git a/src/Famix-Traits/FamixTGenericParameterType.trait.st b/src/Famix-Traits/FamixTGenericParameterType.trait.st new file mode 100644 index 000000000..f844dbe6d --- /dev/null +++ b/src/Famix-Traits/FamixTGenericParameterType.trait.st @@ -0,0 +1,98 @@ +" +FamixTGenericParameterType represents generic parameters in an FamixJavaParametricEntity. This is an FamixJavaParameterType + +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +| `typeContainer` | `FamixTType` | `types` | `FamixTWithTypes` | Container entity to which this type belongs. Container is a namespace, not a package (Smalltalk).| + +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTGenericParameterType` | `genericParameter` | `FamixTParameterConcretisation` | concretisations relationships, i.e. known concretisation of this type.| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `incomingReferences` | `FamixTReferenceable` | `referredType` | `FamixTReference` | References to this entity by other entities.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `genericEntities` | `FamixTGenericParameterType` | `genericParameters` | `FamixTParametricEntity` | genericEntity of a parameter| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| +| `typedEntities` | `FamixTType` | `declaredType` | `FamixTTypedEntity` | Entities that have this type as declaredType| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| +| `name` | `String` | nil | Basic name of the entity, not full reference.| + +" +Trait { + #name : #FamixTGenericParameterType, + #instVars : [ + '#concretisations => FMMany type: #FamixTParameterConcretisation opposite: #genericParameter', + '#genericEntities => FMMany type: #FamixTParametricEntity opposite: #genericParameters' + ], + #traits : 'FamixTType', + #classTraits : 'FamixTType classTrait', + #category : #'Famix-Traits-Traits' +} + +{ #category : #meta } +FamixTGenericParameterType classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixTGenericParameterType >> addConcretisation: anObject [ + + ^ self concretisations add: anObject +] + +{ #category : #adding } +FamixTGenericParameterType >> addGenericEntity: anObject [ + + ^ self genericEntities add: anObject +] + +{ #category : #accessing } +FamixTGenericParameterType >> concretisations [ + "Relation named: #concretisations type: #FamixTParameterConcretisation opposite: #genericParameter" + + + + + ^ concretisations +] + +{ #category : #accessing } +FamixTGenericParameterType >> concretisations: anObject [ + + + concretisations value: anObject +] + +{ #category : #accessing } +FamixTGenericParameterType >> genericEntities [ + "Relation named: #genericEntities type: #FamixTParametricEntity opposite: #genericParameters" + + + + + ^ genericEntities +] + +{ #category : #accessing } +FamixTGenericParameterType >> genericEntities: anObject [ + + + genericEntities value: anObject +] diff --git a/src/Famix-Traits/FamixTParameterConcretisation.trait.st b/src/Famix-Traits/FamixTParameterConcretisation.trait.st new file mode 100644 index 000000000..f5463c9d6 --- /dev/null +++ b/src/Famix-Traits/FamixTParameterConcretisation.trait.st @@ -0,0 +1,102 @@ +" +## Relations +====================== + +### Association source +| Relation | Origin | Opposite | Type | Comment | +| `genericParameter` | `FamixTParameterConcretisation` | `concretisations` | `FamixTGenericParameterType` | genericParameter linked to in this relationship. from-side of the association| + +### Association target +| Relation | Origin | Opposite | Type | Comment | +| `concreteParameter` | `FamixTParameterConcretisation` | `generics` | `FamixTConcreteParameterType` | concreteParameter linked to in this relationship. to-side of the association| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTParameterConcretisation` | `parameterConcretisations` | `FamixTConcretisation` | | +| `next` | `FamixTAssociation` | `previous` | `FamixTAssociation` | Next association in an ordered collection of associations. Currently not supported by the Moose importer| +| `previous` | `FamixTAssociation` | `next` | `FamixTAssociation` | Previous association in an ordered collection of associations. Currently not supported by the Moose importer| +| `sourceAnchor` | `FamixTSourceEntity` | `element` | `FamixTSourceAnchor` | SourceAnchor entity linking to the original source code for this entity| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +| `isStub` | `Boolean` | false | Flag true if the entity attributes are incomplete, either because the entity is missing or not imported.| + +" +Trait { + #name : #FamixTParameterConcretisation, + #instVars : [ + '#concreteParameter => FMOne type: #FamixTConcreteParameterType opposite: #generics', + '#concretisations => FMMany type: #FamixTConcretisation opposite: #parameterConcretisations', + '#genericParameter => FMOne type: #FamixTGenericParameterType opposite: #concretisations' + ], + #traits : 'FamixTAssociation', + #classTraits : 'FamixTAssociation classTrait', + #category : #'Famix-Traits-Traits' +} + +{ #category : #meta } +FamixTParameterConcretisation classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixTParameterConcretisation >> addConcretisation: anObject [ + + ^ self concretisations add: anObject +] + +{ #category : #accessing } +FamixTParameterConcretisation >> concreteParameter [ + "Relation named: #concreteParameter type: #FamixTConcreteParameterType opposite: #generics" + + + + + ^ concreteParameter +] + +{ #category : #accessing } +FamixTParameterConcretisation >> concreteParameter: anObject [ + + + concreteParameter := anObject +] + +{ #category : #accessing } +FamixTParameterConcretisation >> concretisations [ + "Relation named: #concretisations type: #FamixTConcretisation opposite: #parameterConcretisations" + + + ^ concretisations +] + +{ #category : #accessing } +FamixTParameterConcretisation >> concretisations: anObject [ + + + concretisations value: anObject +] + +{ #category : #accessing } +FamixTParameterConcretisation >> genericParameter [ + "Relation named: #genericParameter type: #FamixTGenericParameterType opposite: #concretisations" + + + + + ^ genericParameter +] + +{ #category : #accessing } +FamixTParameterConcretisation >> genericParameter: anObject [ + + + genericParameter := anObject +] diff --git a/src/Famix-Traits/FamixTParameterType.trait.st b/src/Famix-Traits/FamixTParameterType.trait.st deleted file mode 100644 index 26f7443c5..000000000 --- a/src/Famix-Traits/FamixTParameterType.trait.st +++ /dev/null @@ -1,25 +0,0 @@ -" -ParameterType represents the symbolic type used in parameterizable classes. This is a FamixTType. - -Example: -public class AClass { -... -} - -Where AClass is a ParameterizableClass. A, B and C are ParameterType of AClass. - - -" -Trait { - #name : #FamixTParameterType, - #category : #'Famix-Traits-Traits' -} - -{ #category : #meta } -FamixTParameterType classSide >> annotation [ - - - - - ^ self -] diff --git a/src/Famix-Traits/FamixTParameterizedType.trait.st b/src/Famix-Traits/FamixTParameterizedType.trait.st deleted file mode 100644 index 5311b1d18..000000000 --- a/src/Famix-Traits/FamixTParameterizedType.trait.st +++ /dev/null @@ -1,54 +0,0 @@ -" -FamixTParameterizedType represents a type with arguments. So, it is an instantiation for the use of FamixTParameterizableClass. It can appear as a type of an attribute, a type of a local variable, a parameter of a method, a return of a method, etc. -Example: - -... -public Map anAttribute; -... - -Where Map is the FamixTParameterizedType of anAttribute. String and Collection are arguments. Map is the parameterizableClass. - -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `parameterizableClass` | `FamixTParameterizedType` | `parameterizedTypes` | `FamixTWithParameterizedTypes` | Base type of this parameterized type.| - - - -" -Trait { - #name : #FamixTParameterizedType, - #instVars : [ - '#parameterizableClass => FMOne type: #FamixTWithParameterizedTypes opposite: #parameterizedTypes' - ], - #category : #'Famix-Traits-ParameterizedType' -} - -{ #category : #meta } -FamixTParameterizedType classSide >> annotation [ - - - - - ^ self -] - -{ #category : #accessing } -FamixTParameterizedType >> parameterizableClass [ - "Relation named: #parameterizableClass type: #FamixTWithParameterizedTypes opposite: #parameterizedTypes" - - - - ^ parameterizableClass -] - -{ #category : #accessing } -FamixTParameterizedType >> parameterizableClass: anObject [ - - parameterizableClass := anObject. - self resetMooseName. - - -] diff --git a/src/Famix-Traits/FamixTParameterizedTypeUser.trait.st b/src/Famix-Traits/FamixTParameterizedTypeUser.trait.st deleted file mode 100644 index 92268818f..000000000 --- a/src/Famix-Traits/FamixTParameterizedTypeUser.trait.st +++ /dev/null @@ -1,50 +0,0 @@ -" -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `argumentsInParameterizedTypes` | `FamixTParameterizedTypeUser` | `arguments` | `FamixTWithParameterizedTypeUsers` | | - - - -" -Trait { - #name : #FamixTParameterizedTypeUser, - #instVars : [ - '#argumentsInParameterizedTypes => FMMany type: #FamixTWithParameterizedTypeUsers opposite: #arguments' - ], - #category : #'Famix-Traits-ParameterizedTypeUser' -} - -{ #category : #meta } -FamixTParameterizedTypeUser classSide >> annotation [ - - - - - ^ self -] - -{ #category : #accessing } -FamixTParameterizedTypeUser >> addArgumentsInParameterizedType: anObject [ - - argumentsInParameterizedTypes add: anObject - -] - -{ #category : #accessing } -FamixTParameterizedTypeUser >> argumentsInParameterizedTypes [ - "Relation named: #argumentsInParameterizedTypes type: #FamixTWithParameterizedTypeUsers opposite: #arguments" - - - - ^ argumentsInParameterizedTypes -] - -{ #category : #accessing } -FamixTParameterizedTypeUser >> argumentsInParameterizedTypes: anObject [ - - - argumentsInParameterizedTypes value: anObject -] diff --git a/src/Famix-Traits/FamixTParametricEntity.trait.st b/src/Famix-Traits/FamixTParametricEntity.trait.st new file mode 100644 index 000000000..030115724 --- /dev/null +++ b/src/Famix-Traits/FamixTParametricEntity.trait.st @@ -0,0 +1,172 @@ +" +FamixTParametricEntity represents a type with parameters. It can be an parametricClass, parametricMethod, parametricInterface. +Example: + +... +public Map anAttribute; +... + +Where Map is the FamixTParametricEntity of anAttribute. String and Collection are concrete parameters. Map is the parametricClass. + +## Relations +====================== + +### Outgoing dependencies +| Relation | Origin | Opposite | Type | Comment | +| `concretisations` | `FamixTParametricEntity` | `genericEntity` | `FamixTConcretisation` | concretisations relationships, i.e. known concreteEntities of this type.| + +### Incoming dependencies +| Relation | Origin | Opposite | Type | Comment | +| `genericEntity` | `FamixTParametricEntity` | `concreteEntity` | `FamixTConcretisation` | genericEntity relationships, i.e. known genericEntity of this type.| + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `concreteParameters` | `FamixTParametricEntity` | `concreteEntities` | `FamixTConcreteParameterType` | list of concreteParameters| +| `genericParameters` | `FamixTParametricEntity` | `genericEntities` | `FamixTGenericParameterType` | list of genericParameters| + + + +" +Trait { + #name : #FamixTParametricEntity, + #instVars : [ + '#concreteParameters => FMMany type: #FamixTConcreteParameterType opposite: #concreteEntities', + '#concretisations => FMMany type: #FamixTConcretisation opposite: #genericEntity', + '#genericEntity => FMOne type: #FamixTConcretisation opposite: #concreteEntity', + '#genericParameters => FMMany type: #FamixTGenericParameterType opposite: #genericEntities' + ], + #category : #'Famix-Traits-Traits' +} + +{ #category : #meta } +FamixTParametricEntity classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixTParametricEntity >> addConcreteParameter: anObject [ + + ^ self concreteParameters add: anObject +] + +{ #category : #adding } +FamixTParametricEntity >> addConcretisation: anObject [ + + ^ self concretisations add: anObject +] + +{ #category : #adding } +FamixTParametricEntity >> addGenericParameter: anObject [ + + ^ self genericParameters add: anObject +] + +{ #category : #accessing } +FamixTParametricEntity >> concreteParameters [ + "Relation named: #concreteParameters type: #FamixTConcreteParameterType opposite: #concreteEntities" + + + + ^ concreteParameters +] + +{ #category : #accessing } +FamixTParametricEntity >> concreteParameters: anObject [ + + + concreteParameters value: anObject +] + +{ #category : #accessing } +FamixTParametricEntity >> concretisations [ + "Relation named: #concretisations type: #FamixTConcretisation opposite: #genericEntity" + + + + + ^ concretisations +] + +{ #category : #accessing } +FamixTParametricEntity >> concretisations: anObject [ + + + concretisations value: anObject +] + +{ #category : #accessing } +FamixTParametricEntity >> genericEntity [ + "Relation named: #genericEntity type: #FamixTConcretisation opposite: #concreteEntity" + + + + + ^ genericEntity +] + +{ #category : #accessing } +FamixTParametricEntity >> genericEntity: anObject [ + + + genericEntity := anObject +] + +{ #category : #accessing } +FamixTParametricEntity >> genericParameters [ + "Relation named: #genericParameters type: #FamixTGenericParameterType opposite: #genericEntities" + + + + ^ genericParameters +] + +{ #category : #accessing } +FamixTParametricEntity >> genericParameters: anObject [ + + + genericParameters value: anObject +] + +{ #category : #accessing } +FamixTParametricEntity >> isConcreteEntity [ +"An Entity is generic if it has at least one ParameterType" + + | param res | + res := true. + param := OrderedCollection new. + param addAll: self genericParameters. + param addAll: self concreteParameters. + param do: [ :p | p isParameterType + ifTrue: [ res := false ] ]. + ^ res. + + "self genericParameters ifNotEmpty: [ ^ false ] + ifEmpty: [^ true]." +] + +{ #category : #accessing } +FamixTParametricEntity >> isGenericEntity [ +"An Entity is generic if it has at least one ParameterType" + + | param res | + res := false. + param := OrderedCollection new. + param addAll: self genericParameters. + param addAll: self concreteParameters. + param do: [ :p | p isParameterType + ifTrue: [ res := true ] ]. + ^ res. +] + +{ #category : #accessing } +FamixTParametricEntity >> parametricParameters [ + + |collection| + collection := OrderedCollection new. + collection addAll: self concreteParameters , self genericParameters . + ^ collection +] diff --git a/src/Famix-Traits/FamixTThrowable.trait.st b/src/Famix-Traits/FamixTThrowable.trait.st new file mode 100644 index 000000000..326871f85 --- /dev/null +++ b/src/Famix-Traits/FamixTThrowable.trait.st @@ -0,0 +1,99 @@ +" +TThrowable represents all types of possible exceptions. + +## Relations +====================== + +### Other +| Relation | Origin | Opposite | Type | Comment | +| `catchingEntities` | `FamixTThrowable` | `caughtExceptions` | `FamixTWithExceptions` | | +| `declaringEntities` | `FamixTThrowable` | `declaredExceptions` | `FamixTWithExceptions` | | +| `throwingEntities` | `FamixTThrowable` | `thrownExceptions` | `FamixTWithExceptions` | | + + + +" +Trait { + #name : #FamixTThrowable, + #instVars : [ + '#catchingEntities => FMMany type: #FamixTWithExceptions opposite: #caughtExceptions', + '#declaringEntities => FMMany type: #FamixTWithExceptions opposite: #declaredExceptions', + '#throwingEntities => FMMany type: #FamixTWithExceptions opposite: #thrownExceptions' + ], + #category : #'Famix-Traits-Traits' +} + +{ #category : #meta } +FamixTThrowable classSide >> annotation [ + + + + + ^ self +] + +{ #category : #adding } +FamixTThrowable >> addCatchingEntity: anObject [ + + ^ self catchingEntities add: anObject +] + +{ #category : #adding } +FamixTThrowable >> addDeclaringEntity: anObject [ + + ^ self declaringEntities add: anObject +] + +{ #category : #adding } +FamixTThrowable >> addThrowingEntity: anObject [ + + ^ self throwingEntities add: anObject +] + +{ #category : #accessing } +FamixTThrowable >> catchingEntities [ + "Relation named: #catchingEntities type: #FamixTWithExceptions opposite: #caughtExceptions" + + + + ^ catchingEntities +] + +{ #category : #accessing } +FamixTThrowable >> catchingEntities: anObject [ + + + catchingEntities value: anObject +] + +{ #category : #accessing } +FamixTThrowable >> declaringEntities [ + "Relation named: #declaringEntities type: #FamixTWithExceptions opposite: #declaredExceptions" + + + + ^ declaringEntities +] + +{ #category : #accessing } +FamixTThrowable >> declaringEntities: anObject [ + + + declaringEntities value: anObject +] + +{ #category : #accessing } +FamixTThrowable >> throwingEntities [ + "Relation named: #throwingEntities type: #FamixTWithExceptions opposite: #thrownExceptions" + + + + ^ throwingEntities +] + +{ #category : #accessing } +FamixTThrowable >> throwingEntities: anObject [ + + + throwingEntities value: anObject +] diff --git a/src/Famix-Traits/FamixTWithExceptions.trait.st b/src/Famix-Traits/FamixTWithExceptions.trait.st index 0aaa055e6..00ff4d9bf 100644 --- a/src/Famix-Traits/FamixTWithExceptions.trait.st +++ b/src/Famix-Traits/FamixTWithExceptions.trait.st @@ -4,9 +4,9 @@ ### Other | Relation | Origin | Opposite | Type | Comment | -| `caughtExceptions` | `FamixTWithExceptions` | `catchingEntities` | `FamixTException` | The exceptions caught by the method| -| `declaredExceptions` | `FamixTWithExceptions` | `declaringEntities` | `FamixTException` | The exceptions declared by the method| -| `thrownExceptions` | `FamixTWithExceptions` | `throwingEntities` | `FamixTException` | The exceptions thrown by the method| +| `caughtExceptions` | `FamixTWithExceptions` | `catchingEntities` | `FamixTThrowable` | The exceptions caught by the method| +| `declaredExceptions` | `FamixTWithExceptions` | `declaringEntities` | `FamixTThrowable` | The exceptions declared by the method| +| `thrownExceptions` | `FamixTWithExceptions` | `throwingEntities` | `FamixTThrowable` | The exceptions thrown by the method| @@ -14,9 +14,9 @@ Trait { #name : #FamixTWithExceptions, #instVars : [ - '#caughtExceptions => FMMany type: #FamixTException opposite: #catchingEntities', - '#declaredExceptions => FMMany type: #FamixTException opposite: #declaringEntities', - '#thrownExceptions => FMMany type: #FamixTException opposite: #throwingEntities' + '#caughtExceptions => FMMany type: #FamixTThrowable opposite: #catchingEntities', + '#declaredExceptions => FMMany type: #FamixTThrowable opposite: #declaringEntities', + '#thrownExceptions => FMMany type: #FamixTThrowable opposite: #throwingEntities' ], #category : #'Famix-Traits-Exception' } @@ -50,7 +50,7 @@ FamixTWithExceptions >> addThrownException: anObject [ { #category : #accessing } FamixTWithExceptions >> caughtExceptions [ - "Relation named: #caughtExceptions type: #FamixTException opposite: #catchingEntities" + "Relation named: #caughtExceptions type: #FamixTThrowable opposite: #catchingEntities" @@ -66,7 +66,7 @@ FamixTWithExceptions >> caughtExceptions: anObject [ { #category : #accessing } FamixTWithExceptions >> declaredExceptions [ - "Relation named: #declaredExceptions type: #FamixTException opposite: #declaringEntities" + "Relation named: #declaredExceptions type: #FamixTThrowable opposite: #declaringEntities" @@ -82,7 +82,7 @@ FamixTWithExceptions >> declaredExceptions: anObject [ { #category : #accessing } FamixTWithExceptions >> thrownExceptions [ - "Relation named: #thrownExceptions type: #FamixTException opposite: #throwingEntities" + "Relation named: #thrownExceptions type: #FamixTThrowable opposite: #throwingEntities" diff --git a/src/Famix-Traits/FamixTWithParameterizedTypeUsers.trait.st b/src/Famix-Traits/FamixTWithParameterizedTypeUsers.trait.st deleted file mode 100644 index c3522423a..000000000 --- a/src/Famix-Traits/FamixTWithParameterizedTypeUsers.trait.st +++ /dev/null @@ -1,51 +0,0 @@ -" -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `arguments` | `FamixTWithParameterizedTypeUsers` | `argumentsInParameterizedTypes` | `FamixTParameterizedTypeUser` | | - - - -" -Trait { - #name : #FamixTWithParameterizedTypeUsers, - #instVars : [ - '#arguments => FMMany type: #FamixTParameterizedTypeUser opposite: #argumentsInParameterizedTypes' - ], - #category : #'Famix-Traits-ParameterizedTypeUser' -} - -{ #category : #meta } -FamixTWithParameterizedTypeUsers classSide >> annotation [ - - - - - ^ self -] - -{ #category : #accessing } -FamixTWithParameterizedTypeUsers >> addArgument: anObject [ - - arguments add: anObject. - self resetMooseName. - -] - -{ #category : #accessing } -FamixTWithParameterizedTypeUsers >> arguments [ - "Relation named: #arguments type: #FamixTParameterizedTypeUser opposite: #argumentsInParameterizedTypes" - - - ^ arguments -] - -{ #category : #accessing } -FamixTWithParameterizedTypeUsers >> arguments: anObject [ - - arguments value: anObject. - self resetMooseName. - -] diff --git a/src/Famix-Traits/FamixTWithParameterizedTypes.trait.st b/src/Famix-Traits/FamixTWithParameterizedTypes.trait.st deleted file mode 100644 index f3d24c57a..000000000 --- a/src/Famix-Traits/FamixTWithParameterizedTypes.trait.st +++ /dev/null @@ -1,49 +0,0 @@ -" -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -| `parameterizedTypes` | `FamixTWithParameterizedTypes` | `parameterizableClass` | `FamixTParameterizedType` | | - - - -" -Trait { - #name : #FamixTWithParameterizedTypes, - #instVars : [ - '#parameterizedTypes => FMMany type: #FamixTParameterizedType opposite: #parameterizableClass' - ], - #category : #'Famix-Traits-ParameterizedType' -} - -{ #category : #meta } -FamixTWithParameterizedTypes classSide >> annotation [ - - - - - ^ self -] - -{ #category : #accessing } -FamixTWithParameterizedTypes >> addParameterizedType: anObject [ - parameterizedTypes add: anObject - -] - -{ #category : #accessing } -FamixTWithParameterizedTypes >> parameterizedTypes [ - "Relation named: #parameterizedTypes type: #FamixTParameterizedType opposite: #parameterizableClass" - - - - ^ parameterizedTypes -] - -{ #category : #accessing } -FamixTWithParameterizedTypes >> parameterizedTypes: anObject [ - - - parameterizedTypes value: anObject -] diff --git a/src/Famix-Traits/MooseAbstractGroup.extension.st b/src/Famix-Traits/MooseAbstractGroup.extension.st index 45b3b2844..aa93d6ac0 100644 --- a/src/Famix-Traits/MooseAbstractGroup.extension.st +++ b/src/Famix-Traits/MooseAbstractGroup.extension.st @@ -191,21 +191,7 @@ MooseAbstractGroup >> allPackages [ MooseAbstractGroup >> allParameterTypes [ - ^ self allUsing: FamixTParameterType -] - -{ #category : #'*Famix-Traits' } -MooseAbstractGroup >> allParameterizableClasses [ - - - ^ self allUsing: FamixTWithParameterizedTypes -] - -{ #category : #'*Famix-Traits' } -MooseAbstractGroup >> allParameterizedTypes [ - - - ^ self allUsing: FamixTParameterizedType + ^ self allUsing: FamixTParameter ] { #category : #'*Famix-Traits' } @@ -215,6 +201,13 @@ MooseAbstractGroup >> allParameters [ ^self allUsing: FamixTParameter ] +{ #category : #'*Famix-Traits' } +MooseAbstractGroup >> allParametricEntities [ + + + ^ self allUsing: FamixTParametricEntity +] + { #category : #'*Famix-Traits' } MooseAbstractGroup >> allPrimitiveTypes [ diff --git a/src/Moose-Core-Tests/FamixLintRuleTest.class.st b/src/Moose-Core-Tests/FAMIXLintRuleTest.class.st similarity index 100% rename from src/Moose-Core-Tests/FamixLintRuleTest.class.st rename to src/Moose-Core-Tests/FAMIXLintRuleTest.class.st diff --git a/src/Moose-Core/FamixMetaModelClassesNotDeclaredInFameRule.class.st b/src/Moose-Core/FAMIXMetaModelClassesNotDeclaredInFameRule.class.st similarity index 100% rename from src/Moose-Core/FamixMetaModelClassesNotDeclaredInFameRule.class.st rename to src/Moose-Core/FAMIXMetaModelClassesNotDeclaredInFameRule.class.st diff --git a/src/Moose-Core/FamixMetaModelClassesShouldNotOverrideRule.class.st b/src/Moose-Core/FAMIXMetaModelClassesShouldNotOverrideRule.class.st similarity index 100% rename from src/Moose-Core/FamixMetaModelClassesShouldNotOverrideRule.class.st rename to src/Moose-Core/FAMIXMetaModelClassesShouldNotOverrideRule.class.st diff --git a/src/Moose-Query-Test/MooseQueryTest.class.st b/src/Moose-Query-Test/MooseQueryTest.class.st index d29308ad3..6b7debf92 100644 --- a/src/Moose-Query-Test/MooseQueryTest.class.st +++ b/src/Moose-Query-Test/MooseQueryTest.class.st @@ -545,7 +545,8 @@ MooseQueryTest >> testIncomingAssociationTypes [ hasSameElements: { FamixTInheritance. FamixTReference. - FamixTImport }. + FamixTImport. + FamixTParameterConcretisation }. self assertCollection: method1 incomingAssociationTypes hasSameElements: {