From fabfd427c1101c8664d58fb2c63b1f7b354fe98e Mon Sep 17 00:00:00 2001 From: Gabriel Darbord Date: Wed, 4 Sep 2024 16:48:24 +0200 Subject: [PATCH] Change `ClassReference` to `TypeReference` --- .../FamixTType.extension.st | 4 +- .../FamixValueOfClosure.extension.st | 4 +- .../FamixValueOfCollection.extension.st | 8 +- ...FamixValueOfCollectionElement.extension.st | 4 +- .../FamixValueOfDictionary.extension.st | 8 +- ...xValueOfDictionaryAssociation.extension.st | 4 +- .../FamixValueOfObject.extension.st | 12 +-- .../FamixValueOfObjectAttribute.extension.st | 6 +- .../FamixValueOfPrimitiveType.extension.st | 4 +- .../FamixValueOfType.extension.st | 20 ++--- .../FamixValueUnknownType.extension.st | 26 ++---- .../package.st | 2 +- .../FamixTAttribute.extension.st | 6 +- .../FamixTClass.extension.st | 19 ----- .../FamixTEnumValue.extension.st | 6 +- .../FamixTType.extension.st | 24 +++++- .../FamixTTypedEntity.extension.st | 6 +- .../FamixValueEntity.class.st | 50 +++++------ .../FamixValueModel.class.st | 12 +-- .../FamixValueOfClassReference.class.st | 51 ------------ .../FamixValueOfClosure.class.st | 22 ++--- .../FamixValueOfClosureVariable.class.st | 24 +++--- .../FamixValueOfCollection.class.st | 18 ++-- .../FamixValueOfCollectionElement.class.st | 18 ++-- .../FamixValueOfDictionary.class.st | 18 ++-- ...FamixValueOfDictionaryAssociation.class.st | 22 ++--- .../FamixValueOfEnum.class.st | 16 ++-- .../FamixValueOfObject.class.st | 18 ++-- .../FamixValueOfObjectAttribute.class.st | 22 ++--- .../FamixValueOfPrimitiveType.class.st | 12 +-- .../FamixValueOfType.class.st | 52 ++++++------ .../FamixValueOfTypeReference.class.st | 53 ++++++++++++ .../FamixValueOfUnknownType.class.st | 12 +-- .../FamixValueTEntityCreator.trait.st | 48 +++++------ .../FamixValueTWithValueProperty.trait.st | 12 +-- .../FamixValueUnknownType.class.st | 13 +-- src/Famix-Value-Entities/package.st | 2 +- src/Famix-Value-Exporter/Boolean.extension.st | 4 +- src/Famix-Value-Exporter/FASTBuilder.class.st | 14 ++-- .../FASTJavaBuilder.class.st | 24 +++--- .../FASTJavaFieldAccess.extension.st | 6 +- .../FASTJavaParameter.extension.st | 4 +- .../FASTJavaVariableExpression.extension.st | 6 +- .../FamixJavaAttribute.extension.st | 6 +- .../FamixJavaClass.extension.st | 4 +- .../FamixJavaMethod.extension.st | 4 +- .../FamixJavaParameter.extension.st | 4 +- .../FamixJavaParameterType.extension.st | 4 +- .../FamixJavaParametricClass.extension.st | 4 +- .../FamixJavaParametricInterface.extension.st | 4 +- .../FamixJavaPrimitiveType.extension.st | 8 +- .../FamixJavaType.extension.st | 20 ++--- .../FamixStMethod.extension.st | 6 +- .../FamixTClass.extension.st | 8 +- .../FamixTMethod.extension.st | 10 +-- .../FamixTParametricEntity.extension.st | 10 +-- .../FamixTType.extension.st | 6 +- .../FamixTTypedEntity.extension.st | 4 +- .../FamixValue2ASTVisitor.class.st | 38 +++++---- .../FamixValue2FASTJavaVisitor.class.st | 82 ++++++++++--------- .../FamixValue2PharoVisitor.class.st | 52 ++++++------ ...ValueAbstractObjectExportStrategy.class.st | 16 ++-- ...ixValueHelperObjectExportStrategy.class.st | 26 +++--- ...ixValueInlineObjectExportStrategy.class.st | 12 +-- .../FamixValueOfClassReference.extension.st | 15 ---- .../FamixValueOfClosure.extension.st | 6 +- .../FamixValueOfCollection.extension.st | 8 +- .../FamixValueOfDictionary.extension.st | 6 +- ...xValueOfDictionaryAssociation.extension.st | 6 +- .../FamixValueOfEnum.extension.st | 6 +- .../FamixValueOfObject.extension.st | 8 +- .../FamixValueOfPrimitiveType.extension.st | 8 +- .../FamixValueOfType.extension.st | 16 ++-- .../FamixValueOfTypeReference.extension.st | 15 ++++ .../FamixValueOfUnknownType.extension.st | 6 +- .../FamixValueUnknownType.extension.st | 6 +- src/Famix-Value-Exporter/Float.extension.st | 4 +- src/Famix-Value-Exporter/Integer.extension.st | 4 +- .../RBAssignmentNode.extension.st | 4 +- src/Famix-Value-Exporter/String.extension.st | 6 +- .../UndefinedObject.extension.st | 4 +- src/Famix-Value-Exporter/package.st | 2 +- .../FamixValueGenerator.class.st | 40 ++++----- src/Famix-Value-Generator/package.st | 2 +- .../Association.extension.st | 6 +- src/Famix-Value-Importer/Boolean.extension.st | 8 +- .../Character.extension.st | 6 +- .../Collection.extension.st | 10 +-- .../Dictionary.extension.st | 8 +- .../FamixEntityFinder.class.st | 39 ++++----- .../FamixJavaClass.extension.st | 4 +- .../FamixJavaEntityFinder.class.st | 19 +++-- .../FamixJavaMethod.extension.st | 6 +- .../FamixJavaType.extension.st | 4 +- .../FamixStMethod.extension.st | 4 +- .../FamixTClass.extension.st | 6 +- .../FamixTMethod.extension.st | 4 +- .../FamixValueAbstractImporter.class.st | 57 ++++++------- .../FamixValueJavaJacksonImporter.class.st | 55 +++++++------ .../FamixValuePharoJacksonImporter.class.st | 74 ++++++++--------- .../FamixValuePharoSTONImporter.class.st | 15 ++-- .../FamixValueUnknownType.extension.st | 4 +- src/Famix-Value-Importer/Float.extension.st | 4 +- src/Famix-Value-Importer/Integer.extension.st | 4 +- src/Famix-Value-Importer/Number.extension.st | 6 +- src/Famix-Value-Importer/Object.extension.st | 6 +- .../OrderedDictionary.extension.st | 8 +- .../RunArray.extension.st | 6 +- src/Famix-Value-Importer/String.extension.st | 12 +-- src/Famix-Value-Importer/Text.extension.st | 6 +- .../UndefinedObject.extension.st | 8 +- src/Famix-Value-Importer/package.st | 2 +- 112 files changed, 826 insertions(+), 781 deletions(-) delete mode 100644 src/Famix-Value-Entities/FamixTClass.extension.st delete mode 100644 src/Famix-Value-Entities/FamixValueOfClassReference.class.st create mode 100644 src/Famix-Value-Entities/FamixValueOfTypeReference.class.st delete mode 100644 src/Famix-Value-Exporter/FamixValueOfClassReference.extension.st create mode 100644 src/Famix-Value-Exporter/FamixValueOfTypeReference.extension.st diff --git a/src/Famix-Value-Entities-Extensions/FamixTType.extension.st b/src/Famix-Value-Entities-Extensions/FamixTType.extension.st index db93e6b..7f6f7ba 100644 --- a/src/Famix-Value-Entities-Extensions/FamixTType.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixTType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTType } +Extension { #name : 'FamixTType' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixTType >> isUnknownType [ ^ false diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfClosure.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfClosure.extension.st index a0182a0..4e905eb 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfClosure.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfClosure.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueOfClosure } +Extension { #name : 'FamixValueOfClosure' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfClosure >> mooseNameOn: aStream [ sourceCode diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfCollection.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfCollection.extension.st index c1e3cbe..c98b719 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfCollection.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfCollection.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #FamixValueOfCollection } +Extension { #name : 'FamixValueOfCollection' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfCollection >> containsCollection [ ^ true ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfCollection >> containsObject [ ^ value anySatisfy: [ :element | element value containsObject ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfCollection >> printValueOn: aStream [ aStream << $[ << self value size asString << ' element'. diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfCollectionElement.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfCollectionElement.extension.st index 046b9c4..7faa2b1 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfCollectionElement.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfCollectionElement.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueOfCollectionElement } +Extension { #name : 'FamixValueOfCollectionElement' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfCollectionElement >> mooseNameOn: aStream [ aStream nextPut: $[. diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfDictionary.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfDictionary.extension.st index 3124d71..a72eda6 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfDictionary.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfDictionary.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueOfDictionary } +Extension { #name : 'FamixValueOfDictionary' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfDictionary >> containsCollection [ ^ true ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfDictionary >> containsObject [ ^ value anySatisfy: [ :association | @@ -14,7 +14,7 @@ FamixValueOfDictionary >> containsObject [ association value containsObject ] ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfDictionary >> printValueOn: aStream [ aStream << ${ << self value size asString << ' association'. diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfDictionaryAssociation.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfDictionaryAssociation.extension.st index cb29834..47795e0 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfDictionaryAssociation.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfDictionaryAssociation.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueOfDictionaryAssociation } +Extension { #name : 'FamixValueOfDictionaryAssociation' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfDictionaryAssociation >> mooseNameOn: aStream [ aStream << (key ifNotNil: [ key type name ] ifNil: [ '' ]) diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfObject.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfObject.extension.st index a008f3c..cc9360e 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfObject.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfObject.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueOfObject } +Extension { #name : 'FamixValueOfObject' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObject >> constructorSignature [ ^ String streamContents: [ :s | @@ -11,20 +11,20 @@ FamixValueOfObject >> constructorSignature [ s nextPut: $) ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObject >> containsCollection [ ^ value anySatisfy: [ :attribute | attribute value containsCollection ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObject >> containsObject [ ^ true ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObject >> printValueOn: aStream [ aStream << ${ << self value size asString << ' attribute'. @@ -32,7 +32,7 @@ FamixValueOfObject >> printValueOn: aStream [ aStream nextPut: $} ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObject >> relevantAttributes [ ^ value reject: [ :attribute | diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfObjectAttribute.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfObjectAttribute.extension.st index 9d6b4c4..4c5e02c 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfObjectAttribute.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfObjectAttribute.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueOfObjectAttribute } +Extension { #name : 'FamixValueOfObjectAttribute' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObjectAttribute >> mooseNameOn: aStream [ value printTypeOn: aStream. @@ -10,7 +10,7 @@ FamixValueOfObjectAttribute >> mooseNameOn: aStream [ value printValueOn: aStream ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfObjectAttribute >> varName [ ^ self attribute diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfPrimitiveType.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfPrimitiveType.extension.st index b0bc70e..e761816 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfPrimitiveType.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfPrimitiveType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueOfPrimitiveType } +Extension { #name : 'FamixValueOfPrimitiveType' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfPrimitiveType >> printValueOn: aStream [ aStream nextPutAll: (value printStringLimitedTo: 50) diff --git a/src/Famix-Value-Entities-Extensions/FamixValueOfType.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueOfType.extension.st index 7867c7f..0901432 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueOfType.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueOfType.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #FamixValueOfType } +Extension { #name : 'FamixValueOfType' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> containsCollection [ ^ false ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> containsObject [ ^ false ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> isReferencedInLoop [ | count | @@ -20,14 +20,14 @@ FamixValueOfType >> isReferencedInLoop [ ^ count > 1 or: [ count = 1 and: [ self isRoot ] ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> isRoot [ ^ self argumentInSpans isEmpty or: [ self resultInSpan isNotNil or: [ self receiverInSpan isNotNil ] ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> mooseNameOn: aStream [ self printTypeOn: aStream. @@ -37,7 +37,7 @@ FamixValueOfType >> mooseNameOn: aStream [ self printValueOn: aStream ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> printTypeOn: aStream [ self type @@ -48,13 +48,13 @@ FamixValueOfType >> printTypeOn: aStream [ ifNil: [ aStream nextPutAll: '' ] ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> printValueOn: aStream [ self value printOn: aStream ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> referenceCount [ ^ attributeInObjects size + elementInCollections size @@ -62,7 +62,7 @@ FamixValueOfType >> referenceCount [ + variableInClosures size ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueOfType >> varName [ "Basic variable name of a value." diff --git a/src/Famix-Value-Entities-Extensions/FamixValueUnknownType.extension.st b/src/Famix-Value-Entities-Extensions/FamixValueUnknownType.extension.st index a857f57..f2b5372 100644 --- a/src/Famix-Value-Entities-Extensions/FamixValueUnknownType.extension.st +++ b/src/Famix-Value-Entities-Extensions/FamixValueUnknownType.extension.st @@ -1,49 +1,37 @@ -Extension { #name : #FamixValueUnknownType } +Extension { #name : 'FamixValueUnknownType' } -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueUnknownType >> acceptValueVisitor: visitor forObject: object [ self error: 'Exporting an unknown type is not (yet?) supported.' ] -{ #category : #'*Famix-Value-Entities-Extensions' } -FamixValueUnknownType >> baseName [ - - ^ name -] - -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueUnknownType >> concreteTypeName [ ^ name ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueUnknownType >> isParametricEntity [ ^ false ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueUnknownType >> isPrimitiveType [ ^ false ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueUnknownType >> methods [ ^ { } ] -{ #category : #'*Famix-Value-Entities-Extensions' } +{ #category : '*Famix-Value-Entities-Extensions' } FamixValueUnknownType >> typeName [ ^ name ] - -{ #category : #'*Famix-Value-Entities-Extensions' } -FamixValueUnknownType >> typeNameOn: stream [ - - stream nextPutAll: name -] diff --git a/src/Famix-Value-Entities-Extensions/package.st b/src/Famix-Value-Entities-Extensions/package.st index e5477b0..c15b7eb 100644 --- a/src/Famix-Value-Entities-Extensions/package.st +++ b/src/Famix-Value-Entities-Extensions/package.st @@ -1 +1 @@ -Package { #name : #'Famix-Value-Entities-Extensions' } +Package { #name : 'Famix-Value-Entities-Extensions' } diff --git a/src/Famix-Value-Entities/FamixTAttribute.extension.st b/src/Famix-Value-Entities/FamixTAttribute.extension.st index be91aad..778bade 100644 --- a/src/Famix-Value-Entities/FamixTAttribute.extension.st +++ b/src/Famix-Value-Entities/FamixTAttribute.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTAttribute } +Extension { #name : 'FamixTAttribute' } -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTAttribute >> valueInObjects [ "Relation named: #valueInObjects type: #FamixValueOfObjectAttribute opposite: #attribute" @@ -11,7 +11,7 @@ FamixTAttribute >> valueInObjects [ ^ self attributeAt: #valueInObjects ifAbsentPut: [ FMMultivalueLink on: self opposite: #attribute: ] ] -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTAttribute >> valueInObjects: anObject [ diff --git a/src/Famix-Value-Entities/FamixTClass.extension.st b/src/Famix-Value-Entities/FamixTClass.extension.st deleted file mode 100644 index 5418eb8..0000000 --- a/src/Famix-Value-Entities/FamixTClass.extension.st +++ /dev/null @@ -1,19 +0,0 @@ -Extension { #name : #FamixTClass } - -{ #category : #'*Famix-Value-Entities-accessing' } -FamixTClass >> valueReferences [ - "Relation named: #valueReferences type: #FamixValueOfClassReference opposite: #value" - - - - - - ^ self attributeAt: #valueReferences ifAbsentPut: [ FMMultivalueLink on: self opposite: #value: ] -] - -{ #category : #'*Famix-Value-Entities-accessing' } -FamixTClass >> valueReferences: anObject [ - - - self valueReferences value: anObject -] diff --git a/src/Famix-Value-Entities/FamixTEnumValue.extension.st b/src/Famix-Value-Entities/FamixTEnumValue.extension.st index 0bb1731..1a50f66 100644 --- a/src/Famix-Value-Entities/FamixTEnumValue.extension.st +++ b/src/Famix-Value-Entities/FamixTEnumValue.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTEnumValue } +Extension { #name : 'FamixTEnumValue' } -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTEnumValue >> valueReferences [ "Relation named: #valueReferences type: #FamixValueOfEnum opposite: #value" @@ -11,7 +11,7 @@ FamixTEnumValue >> valueReferences [ ^ self attributeAt: #valueReferences ifAbsentPut: [ FMMultivalueLink on: self opposite: #value: ] ] -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTEnumValue >> valueReferences: anObject [ diff --git a/src/Famix-Value-Entities/FamixTType.extension.st b/src/Famix-Value-Entities/FamixTType.extension.st index 33286b9..c598ce5 100644 --- a/src/Famix-Value-Entities/FamixTType.extension.st +++ b/src/Famix-Value-Entities/FamixTType.extension.st @@ -1,6 +1,24 @@ -Extension { #name : #FamixTType } +Extension { #name : 'FamixTType' } -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } +FamixTType >> valueReferences [ + "Relation named: #valueReferences type: #FamixValueOfTypeReference opposite: #value" + + + + + + ^ self attributeAt: #valueReferences ifAbsentPut: [ FMMultivalueLink on: self opposite: #value: ] +] + +{ #category : '*Famix-Value-Entities-accessing' } +FamixTType >> valueReferences: anObject [ + + + self valueReferences value: anObject +] + +{ #category : '*Famix-Value-Entities-accessing' } FamixTType >> values [ "Relation named: #values type: #FamixValueOfType opposite: #type" @@ -11,7 +29,7 @@ FamixTType >> values [ ^ self attributeAt: #values ifAbsentPut: [ FMMultivalueLink on: self opposite: #type: ] ] -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTType >> values: anObject [ diff --git a/src/Famix-Value-Entities/FamixTTypedEntity.extension.st b/src/Famix-Value-Entities/FamixTTypedEntity.extension.st index 7d99de0..f95fc88 100644 --- a/src/Famix-Value-Entities/FamixTTypedEntity.extension.st +++ b/src/Famix-Value-Entities/FamixTTypedEntity.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTTypedEntity } +Extension { #name : 'FamixTTypedEntity' } -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTTypedEntity >> values [ "Relation named: #values type: #FamixValueOfType opposite: #typedEntity" @@ -11,7 +11,7 @@ FamixTTypedEntity >> values [ ^ self attributeAt: #values ifAbsentPut: [ FMMultivalueLink on: self opposite: #typedEntity: ] ] -{ #category : #'*Famix-Value-Entities-accessing' } +{ #category : '*Famix-Value-Entities-accessing' } FamixTTypedEntity >> values: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueEntity.class.st b/src/Famix-Value-Entities/FamixValueEntity.class.st index af9a97e..479c25d 100644 --- a/src/Famix-Value-Entities/FamixValueEntity.class.st +++ b/src/Famix-Value-Entities/FamixValueEntity.class.st @@ -1,10 +1,12 @@ Class { - #name : #FamixValueEntity, - #superclass : #MooseEntity, - #category : #'Famix-Value-Entities-Entities' + #name : 'FamixValueEntity', + #superclass : 'MooseEntity', + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueEntity class >> annotation [ @@ -14,98 +16,98 @@ FamixValueEntity class >> annotation [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity class >> isAbstract [ ^ self == FamixValueEntity ] -{ #category : #meta } +{ #category : 'meta' } FamixValueEntity class >> metamodel [ ^ FamixValueModel metamodel ] -{ #category : #testing } -FamixValueEntity >> isOfClassReference [ - - - ^ false -] - -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfClosure [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfCollection [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfDictionary [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfEnum [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfObject [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfPrimitiveType [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isOfType [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } +FamixValueEntity >> isOfTypeReference [ + + + ^ false +] + +{ #category : 'testing' } FamixValueEntity >> isOfUnknownType [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isQueryable [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isType [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } FamixValueEntity >> isUnknownType [ diff --git a/src/Famix-Value-Entities/FamixValueModel.class.st b/src/Famix-Value-Entities/FamixValueModel.class.st index f3e0ff7..ec82315 100644 --- a/src/Famix-Value-Entities/FamixValueModel.class.st +++ b/src/Famix-Value-Entities/FamixValueModel.class.st @@ -1,18 +1,20 @@ Class { - #name : #FamixValueModel, - #superclass : #MooseModel, + #name : 'FamixValueModel', + #superclass : 'MooseModel', #traits : 'FamixValueTEntityCreator', #classTraits : 'FamixValueTEntityCreator classTrait', - #category : #'Famix-Value-Entities-Model' + #category : 'Famix-Value-Entities-Model', + #package : 'Famix-Value-Entities', + #tag : 'Model' } -{ #category : #accessing } +{ #category : 'accessing' } FamixValueModel class >> allSubmetamodelsPackagesNames [ ^ #(#'Moose-Query' #'Famix-Traits') ] -{ #category : #meta } +{ #category : 'meta' } FamixValueModel class >> annotation [ diff --git a/src/Famix-Value-Entities/FamixValueOfClassReference.class.st b/src/Famix-Value-Entities/FamixValueOfClassReference.class.st deleted file mode 100644 index a5f24ee..0000000 --- a/src/Famix-Value-Entities/FamixValueOfClassReference.class.st +++ /dev/null @@ -1,51 +0,0 @@ -" -A reference to a class. - -## Relations -====================== - -### Other -| Relation | Origin | Opposite | Type | Comment | -|---| -| `value` | `FamixValueOfClassReference` | `valueReferences` | `FamixTClass` | | - - - -" -Class { - #name : #FamixValueOfClassReference, - #superclass : #FamixValueOfType, - #category : #'Famix-Value-Entities-Entities' -} - -{ #category : #meta } -FamixValueOfClassReference class >> annotation [ - - - - - ^ self -] - -{ #category : #testing } -FamixValueOfClassReference >> isOfClassReference [ - - - ^ true -] - -{ #category : #accessing } -FamixValueOfClassReference >> value [ - "Relation named: #value type: #FamixTClass opposite: #valueReferences" - - - - ^ self attributeAt: #value ifAbsent: [ nil ] -] - -{ #category : #accessing } -FamixValueOfClassReference >> value: anObject [ - - - self attributeAt: #value put: (FMMultivalueLink on: self update: #valueReferences from: self value to: anObject). -] diff --git a/src/Famix-Value-Entities/FamixValueOfClosure.class.st b/src/Famix-Value-Entities/FamixValueOfClosure.class.st index 74afa41..c41a72b 100644 --- a/src/Famix-Value-Entities/FamixValueOfClosure.class.st +++ b/src/Famix-Value-Entities/FamixValueOfClosure.class.st @@ -19,16 +19,18 @@ A lexical closure. " Class { - #name : #FamixValueOfClosure, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfClosure', + #superclass : 'FamixValueOfType', #instVars : [ '#sourceCode => FMProperty', '#variables => FMMany type: #FamixValueOfClosureVariable opposite: #closure' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfClosure class >> annotation [ @@ -37,20 +39,20 @@ FamixValueOfClosure class >> annotation [ ^ self ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfClosure >> addVariable: anObject [ ^ self variables add: anObject ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfClosure >> isOfClosure [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosure >> sourceCode [ @@ -59,13 +61,13 @@ FamixValueOfClosure >> sourceCode [ ^ sourceCode ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosure >> sourceCode: anObject [ sourceCode := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosure >> variables [ "Relation named: #variables type: #FamixValueOfClosureVariable opposite: #closure" @@ -74,7 +76,7 @@ FamixValueOfClosure >> variables [ ^ variables ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosure >> variables: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfClosureVariable.class.st b/src/Famix-Value-Entities/FamixValueOfClosureVariable.class.st index 6b3e3f6..5649d20 100644 --- a/src/Famix-Value-Entities/FamixValueOfClosureVariable.class.st +++ b/src/Famix-Value-Entities/FamixValueOfClosureVariable.class.st @@ -20,17 +20,19 @@ A variable binding in a lexical closure. " Class { - #name : #FamixValueOfClosureVariable, - #superclass : #FamixValueEntity, + #name : 'FamixValueOfClosureVariable', + #superclass : 'FamixValueEntity', #instVars : [ '#name => FMProperty', '#closure => FMOne type: #FamixValueOfClosure opposite: #variables', '#value => FMOne type: #FamixValueOfType opposite: #variableInClosures' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfClosureVariable class >> annotation [ @@ -39,7 +41,7 @@ FamixValueOfClosureVariable class >> annotation [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosureVariable >> closure [ "Relation named: #closure type: #FamixValueOfClosure opposite: #variables" @@ -47,14 +49,14 @@ FamixValueOfClosureVariable >> closure [ ^ closure ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosureVariable >> closure: anObject [ closure := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosureVariable >> name [ @@ -63,13 +65,13 @@ FamixValueOfClosureVariable >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosureVariable >> name: anObject [ name := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosureVariable >> value [ "Relation named: #value type: #FamixValueOfType opposite: #variableInClosures" @@ -77,14 +79,14 @@ FamixValueOfClosureVariable >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfClosureVariable >> value: anObject [ value := anObject ] -{ #category : #generate } +{ #category : 'generate' } FamixValueOfClosureVariable >> varName [ ^ name diff --git a/src/Famix-Value-Entities/FamixValueOfCollection.class.st b/src/Famix-Value-Entities/FamixValueOfCollection.class.st index 97ee143..162e12d 100644 --- a/src/Famix-Value-Entities/FamixValueOfCollection.class.st +++ b/src/Famix-Value-Entities/FamixValueOfCollection.class.st @@ -13,15 +13,17 @@ A value of a collection type. " Class { - #name : #FamixValueOfCollection, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfCollection', + #superclass : 'FamixValueOfType', #instVars : [ '#value => FMMany type: #FamixValueOfCollectionElement opposite: #collection' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfCollection class >> annotation [ @@ -30,20 +32,20 @@ FamixValueOfCollection class >> annotation [ ^ self ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfCollection >> addValue: anObject [ ^ self value add: anObject ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfCollection >> isOfCollection [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfCollection >> value [ "Relation named: #value type: #FamixValueOfCollectionElement opposite: #collection" @@ -52,7 +54,7 @@ FamixValueOfCollection >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfCollection >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfCollectionElement.class.st b/src/Famix-Value-Entities/FamixValueOfCollectionElement.class.st index 2e6bf46..474460f 100644 --- a/src/Famix-Value-Entities/FamixValueOfCollectionElement.class.st +++ b/src/Famix-Value-Entities/FamixValueOfCollectionElement.class.st @@ -14,16 +14,18 @@ An element belonging to a collection. " Class { - #name : #FamixValueOfCollectionElement, - #superclass : #FamixValueEntity, + #name : 'FamixValueOfCollectionElement', + #superclass : 'FamixValueEntity', #instVars : [ '#collection => FMOne type: #FamixValueOfCollection opposite: #value', '#value => FMOne type: #FamixValueOfType opposite: #elementInCollections' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfCollectionElement class >> annotation [ @@ -32,7 +34,7 @@ FamixValueOfCollectionElement class >> annotation [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfCollectionElement >> collection [ "Relation named: #collection type: #FamixValueOfCollection opposite: #value" @@ -40,14 +42,14 @@ FamixValueOfCollectionElement >> collection [ ^ collection ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfCollectionElement >> collection: anObject [ collection := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfCollectionElement >> value [ "Relation named: #value type: #FamixValueOfType opposite: #elementInCollections" @@ -55,7 +57,7 @@ FamixValueOfCollectionElement >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfCollectionElement >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfDictionary.class.st b/src/Famix-Value-Entities/FamixValueOfDictionary.class.st index 3958259..63b2761 100644 --- a/src/Famix-Value-Entities/FamixValueOfDictionary.class.st +++ b/src/Famix-Value-Entities/FamixValueOfDictionary.class.st @@ -13,15 +13,17 @@ A value of a dictionary type. " Class { - #name : #FamixValueOfDictionary, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfDictionary', + #superclass : 'FamixValueOfType', #instVars : [ '#value => FMMany type: #FamixValueOfDictionaryAssociation opposite: #dictionary' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfDictionary class >> annotation [ @@ -30,20 +32,20 @@ FamixValueOfDictionary class >> annotation [ ^ self ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfDictionary >> addValue: anObject [ ^ self value add: anObject ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfDictionary >> isOfDictionary [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionary >> value [ "Relation named: #value type: #FamixValueOfDictionaryAssociation opposite: #dictionary" @@ -52,7 +54,7 @@ FamixValueOfDictionary >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionary >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfDictionaryAssociation.class.st b/src/Famix-Value-Entities/FamixValueOfDictionaryAssociation.class.st index db4b3c8..325c456 100644 --- a/src/Famix-Value-Entities/FamixValueOfDictionaryAssociation.class.st +++ b/src/Famix-Value-Entities/FamixValueOfDictionaryAssociation.class.st @@ -15,17 +15,19 @@ A key-value pair belonging to a dictionary. " Class { - #name : #FamixValueOfDictionaryAssociation, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfDictionaryAssociation', + #superclass : 'FamixValueOfType', #instVars : [ '#dictionary => FMOne type: #FamixValueOfDictionary opposite: #value', '#key => FMOne type: #FamixValueOfType opposite: #keyInDictionaries', '#value => FMOne type: #FamixValueOfType opposite: #valueInDictionaries' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfDictionaryAssociation class >> annotation [ @@ -34,7 +36,7 @@ FamixValueOfDictionaryAssociation class >> annotation [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionaryAssociation >> dictionary [ "Relation named: #dictionary type: #FamixValueOfDictionary opposite: #value" @@ -42,14 +44,14 @@ FamixValueOfDictionaryAssociation >> dictionary [ ^ dictionary ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionaryAssociation >> dictionary: anObject [ dictionary := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionaryAssociation >> key [ "Relation named: #key type: #FamixValueOfType opposite: #keyInDictionaries" @@ -57,14 +59,14 @@ FamixValueOfDictionaryAssociation >> key [ ^ key ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionaryAssociation >> key: anObject [ key := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionaryAssociation >> value [ "Relation named: #value type: #FamixValueOfType opposite: #valueInDictionaries" @@ -72,7 +74,7 @@ FamixValueOfDictionaryAssociation >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfDictionaryAssociation >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfEnum.class.st b/src/Famix-Value-Entities/FamixValueOfEnum.class.st index a319ae2..3b007a9 100644 --- a/src/Famix-Value-Entities/FamixValueOfEnum.class.st +++ b/src/Famix-Value-Entities/FamixValueOfEnum.class.st @@ -13,12 +13,14 @@ A value of an enumeration. " Class { - #name : #FamixValueOfEnum, - #superclass : #FamixValueOfType, - #category : #'Famix-Value-Entities-Entities' + #name : 'FamixValueOfEnum', + #superclass : 'FamixValueOfType', + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfEnum class >> annotation [ @@ -27,14 +29,14 @@ FamixValueOfEnum class >> annotation [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfEnum >> isOfEnum [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfEnum >> value [ "Relation named: #value type: #FamixTEnumValue opposite: #valueReferences" @@ -43,7 +45,7 @@ FamixValueOfEnum >> value [ ^ self attributeAt: #value ifAbsent: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfEnum >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfObject.class.st b/src/Famix-Value-Entities/FamixValueOfObject.class.st index d6a79bd..76bcbc8 100644 --- a/src/Famix-Value-Entities/FamixValueOfObject.class.st +++ b/src/Famix-Value-Entities/FamixValueOfObject.class.st @@ -13,15 +13,17 @@ A value of an object. " Class { - #name : #FamixValueOfObject, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfObject', + #superclass : 'FamixValueOfType', #instVars : [ '#value => FMMany type: #FamixValueOfObjectAttribute opposite: #object' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfObject class >> annotation [ @@ -30,20 +32,20 @@ FamixValueOfObject class >> annotation [ ^ self ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfObject >> addValue: anObject [ ^ self value add: anObject ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfObject >> isOfObject [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObject >> value [ "Relation named: #value type: #FamixValueOfObjectAttribute opposite: #object" @@ -52,7 +54,7 @@ FamixValueOfObject >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObject >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfObjectAttribute.class.st b/src/Famix-Value-Entities/FamixValueOfObjectAttribute.class.st index 7322d5f..e78bcab 100644 --- a/src/Famix-Value-Entities/FamixValueOfObjectAttribute.class.st +++ b/src/Famix-Value-Entities/FamixValueOfObjectAttribute.class.st @@ -15,16 +15,18 @@ An attribute belonging to an object. " Class { - #name : #FamixValueOfObjectAttribute, - #superclass : #FamixValueEntity, + #name : 'FamixValueOfObjectAttribute', + #superclass : 'FamixValueEntity', #instVars : [ '#object => FMOne type: #FamixValueOfObject opposite: #value', '#value => FMOne type: #FamixValueOfType opposite: #attributeInObjects' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfObjectAttribute class >> annotation [ @@ -33,7 +35,7 @@ FamixValueOfObjectAttribute class >> annotation [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObjectAttribute >> attribute [ "Relation named: #attribute type: #FamixTAttribute opposite: #valueInObjects" @@ -42,14 +44,14 @@ FamixValueOfObjectAttribute >> attribute [ ^ self attributeAt: #attribute ifAbsent: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObjectAttribute >> attribute: anObject [ self attributeAt: #attribute put: (FMMultivalueLink on: self update: #valueInObjects from: self attribute to: anObject). ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObjectAttribute >> object [ "Relation named: #object type: #FamixValueOfObject opposite: #value" @@ -57,14 +59,14 @@ FamixValueOfObjectAttribute >> object [ ^ object ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObjectAttribute >> object: anObject [ object := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObjectAttribute >> value [ "Relation named: #value type: #FamixValueOfType opposite: #attributeInObjects" @@ -72,7 +74,7 @@ FamixValueOfObjectAttribute >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfObjectAttribute >> value: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfPrimitiveType.class.st b/src/Famix-Value-Entities/FamixValueOfPrimitiveType.class.st index edb3bbd..da4e131 100644 --- a/src/Famix-Value-Entities/FamixValueOfPrimitiveType.class.st +++ b/src/Famix-Value-Entities/FamixValueOfPrimitiveType.class.st @@ -10,14 +10,16 @@ A value of a primitive type. " Class { - #name : #FamixValueOfPrimitiveType, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfPrimitiveType', + #superclass : 'FamixValueOfType', #traits : 'FamixValueTWithValueProperty', #classTraits : 'FamixValueTWithValueProperty classTrait', - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfPrimitiveType class >> annotation [ @@ -26,7 +28,7 @@ FamixValueOfPrimitiveType class >> annotation [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfPrimitiveType >> isOfPrimitiveType [ diff --git a/src/Famix-Value-Entities/FamixValueOfType.class.st b/src/Famix-Value-Entities/FamixValueOfType.class.st index 290670a..037fafb 100644 --- a/src/Famix-Value-Entities/FamixValueOfType.class.st +++ b/src/Famix-Value-Entities/FamixValueOfType.class.st @@ -19,8 +19,8 @@ Abstract superclass of all ValueOf_Type_ entities. " Class { - #name : #FamixValueOfType, - #superclass : #FamixValueEntity, + #name : 'FamixValueOfType', + #superclass : 'FamixValueEntity', #instVars : [ '#attributeInObjects => FMMany type: #FamixValueOfObjectAttribute opposite: #value', '#elementInCollections => FMMany type: #FamixValueOfCollectionElement opposite: #value', @@ -28,10 +28,12 @@ Class { '#valueInDictionaries => FMMany type: #FamixValueOfDictionaryAssociation opposite: #value', '#variableInClosures => FMMany type: #FamixValueOfClosureVariable opposite: #value' ], - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfType class >> annotation [ @@ -41,44 +43,44 @@ FamixValueOfType class >> annotation [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfType class >> isAbstract [ ^ self == FamixValueOfType ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfType >> addAttributeInObject: anObject [ ^ self attributeInObjects add: anObject ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfType >> addElementInCollection: anObject [ ^ self elementInCollections add: anObject ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfType >> addKeyInDictionary: anObject [ ^ self keyInDictionaries add: anObject ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfType >> addValueInDictionary: anObject [ ^ self valueInDictionaries add: anObject ] -{ #category : #adding } +{ #category : 'adding' } FamixValueOfType >> addVariableInClosure: anObject [ ^ self variableInClosures add: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> attributeInObjects [ "Relation named: #attributeInObjects type: #FamixValueOfObjectAttribute opposite: #value" @@ -87,14 +89,14 @@ FamixValueOfType >> attributeInObjects [ ^ attributeInObjects ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> attributeInObjects: anObject [ attributeInObjects value: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> elementInCollections [ "Relation named: #elementInCollections type: #FamixValueOfCollectionElement opposite: #value" @@ -103,21 +105,21 @@ FamixValueOfType >> elementInCollections [ ^ elementInCollections ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> elementInCollections: anObject [ elementInCollections value: anObject ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfType >> isOfType [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> keyInDictionaries [ "Relation named: #keyInDictionaries type: #FamixValueOfDictionaryAssociation opposite: #key" @@ -126,14 +128,14 @@ FamixValueOfType >> keyInDictionaries [ ^ keyInDictionaries ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> keyInDictionaries: anObject [ keyInDictionaries value: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> type [ "Relation named: #type type: #FamixTType opposite: #values" @@ -142,14 +144,14 @@ FamixValueOfType >> type [ ^ self attributeAt: #type ifAbsent: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> type: anObject [ self attributeAt: #type put: (FMMultivalueLink on: self update: #values from: self type to: anObject). ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> typedEntity [ "Relation named: #typedEntity type: #FamixTTypedEntity opposite: #values" @@ -158,14 +160,14 @@ FamixValueOfType >> typedEntity [ ^ self attributeAt: #typedEntity ifAbsent: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> typedEntity: anObject [ self attributeAt: #typedEntity put: (FMMultivalueLink on: self update: #values from: self typedEntity to: anObject). ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> valueInDictionaries [ "Relation named: #valueInDictionaries type: #FamixValueOfDictionaryAssociation opposite: #value" @@ -174,14 +176,14 @@ FamixValueOfType >> valueInDictionaries [ ^ valueInDictionaries ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> valueInDictionaries: anObject [ valueInDictionaries value: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> variableInClosures [ "Relation named: #variableInClosures type: #FamixValueOfClosureVariable opposite: #value" @@ -190,7 +192,7 @@ FamixValueOfType >> variableInClosures [ ^ variableInClosures ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueOfType >> variableInClosures: anObject [ diff --git a/src/Famix-Value-Entities/FamixValueOfTypeReference.class.st b/src/Famix-Value-Entities/FamixValueOfTypeReference.class.st new file mode 100644 index 0000000..a3f4ee7 --- /dev/null +++ b/src/Famix-Value-Entities/FamixValueOfTypeReference.class.st @@ -0,0 +1,53 @@ +" +A reference to a type. + +## Relations +====================== + +### Other +| Relation | Origin | Opposite | Type | Comment | +|---| +| `value` | `FamixValueOfTypeReference` | `valueReferences` | `FamixTType` | | + + + +" +Class { + #name : 'FamixValueOfTypeReference', + #superclass : 'FamixValueOfType', + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' +} + +{ #category : 'meta' } +FamixValueOfTypeReference class >> annotation [ + + + + + ^ self +] + +{ #category : 'testing' } +FamixValueOfTypeReference >> isOfTypeReference [ + + + ^ true +] + +{ #category : 'accessing' } +FamixValueOfTypeReference >> value [ + "Relation named: #value type: #FamixTType opposite: #valueReferences" + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FamixValueOfTypeReference >> value: anObject [ + + + self attributeAt: #value put: (FMMultivalueLink on: self update: #valueReferences from: self value to: anObject). +] diff --git a/src/Famix-Value-Entities/FamixValueOfUnknownType.class.st b/src/Famix-Value-Entities/FamixValueOfUnknownType.class.st index c40e0c2..78a5212 100644 --- a/src/Famix-Value-Entities/FamixValueOfUnknownType.class.st +++ b/src/Famix-Value-Entities/FamixValueOfUnknownType.class.st @@ -10,14 +10,16 @@ A value of an unknwon type. " Class { - #name : #FamixValueOfUnknownType, - #superclass : #FamixValueOfType, + #name : 'FamixValueOfUnknownType', + #superclass : 'FamixValueOfType', #traits : 'FamixValueTWithValueProperty', #classTraits : 'FamixValueTWithValueProperty classTrait', - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueOfUnknownType class >> annotation [ @@ -26,7 +28,7 @@ FamixValueOfUnknownType class >> annotation [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } FamixValueOfUnknownType >> isOfUnknownType [ diff --git a/src/Famix-Value-Entities/FamixValueTEntityCreator.trait.st b/src/Famix-Value-Entities/FamixValueTEntityCreator.trait.st index b875965..482fea5 100644 --- a/src/Famix-Value-Entities/FamixValueTEntityCreator.trait.st +++ b/src/Famix-Value-Entities/FamixValueTEntityCreator.trait.st @@ -5,11 +5,13 @@ It provides an API for creating entities and adding them to the model. " Trait { - #name : #FamixValueTEntityCreator, - #category : #'Famix-Value-Entities-Model' + #name : 'FamixValueTEntityCreator', + #category : 'Famix-Value-Entities-Model', + #package : 'Famix-Value-Entities', + #tag : 'Model' } -{ #category : #meta } +{ #category : 'meta' } FamixValueTEntityCreator classSide >> annotation [ @@ -18,98 +20,98 @@ FamixValueTEntityCreator classSide >> annotation [ ^ self ] -{ #category : #'entity creation' } -FamixValueTEntityCreator >> newOfClassReference [ - - - ^ self add: FamixValueOfClassReference new -] - -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfClosure [ ^ self add: FamixValueOfClosure new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfClosureVariable [ ^ self add: FamixValueOfClosureVariable new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfCollection [ ^ self add: FamixValueOfCollection new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfCollectionElement [ ^ self add: FamixValueOfCollectionElement new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfDictionary [ ^ self add: FamixValueOfDictionary new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfDictionaryAssociation [ ^ self add: FamixValueOfDictionaryAssociation new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfEnum [ ^ self add: FamixValueOfEnum new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfObject [ ^ self add: FamixValueOfObject new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfObjectAttribute [ ^ self add: FamixValueOfObjectAttribute new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfPrimitiveType [ ^ self add: FamixValueOfPrimitiveType new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } +FamixValueTEntityCreator >> newOfTypeReference [ + + + ^ self add: FamixValueOfTypeReference new +] + +{ #category : 'entity creation' } FamixValueTEntityCreator >> newOfUnknownType [ ^ self add: FamixValueOfUnknownType new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newUnknownType [ ^ self add: FamixValueUnknownType new ] -{ #category : #'entity creation' } +{ #category : 'entity creation' } FamixValueTEntityCreator >> newUnknownTypeNamed: aName [ diff --git a/src/Famix-Value-Entities/FamixValueTWithValueProperty.trait.st b/src/Famix-Value-Entities/FamixValueTWithValueProperty.trait.st index e5d24c7..dd1cead 100644 --- a/src/Famix-Value-Entities/FamixValueTWithValueProperty.trait.st +++ b/src/Famix-Value-Entities/FamixValueTWithValueProperty.trait.st @@ -10,14 +10,16 @@ My users have the value data represented by a Smalltalk object as a property. " Trait { - #name : #FamixValueTWithValueProperty, + #name : 'FamixValueTWithValueProperty', #instVars : [ '#value => FMProperty' ], - #category : #'Famix-Value-Entities-Traits' + #category : 'Famix-Value-Entities-Traits', + #package : 'Famix-Value-Entities', + #tag : 'Traits' } -{ #category : #meta } +{ #category : 'meta' } FamixValueTWithValueProperty classSide >> annotation [ @@ -26,7 +28,7 @@ FamixValueTWithValueProperty classSide >> annotation [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueTWithValueProperty >> value [ @@ -35,7 +37,7 @@ FamixValueTWithValueProperty >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueTWithValueProperty >> value: anObject [ value := anObject diff --git a/src/Famix-Value-Entities/FamixValueUnknownType.class.st b/src/Famix-Value-Entities/FamixValueUnknownType.class.st index b4f1bd9..4552b23 100644 --- a/src/Famix-Value-Entities/FamixValueUnknownType.class.st +++ b/src/Famix-Value-Entities/FamixValueUnknownType.class.st @@ -19,6 +19,7 @@ An unknown type. |---| | `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| +| `valueReferences` | `FamixTType` | `value` | `FamixValueOfTypeReference` | | | `values` | `FamixTType` | `type` | `FamixValueOfType` | | @@ -32,14 +33,16 @@ An unknown type. " Class { - #name : #FamixValueUnknownType, - #superclass : #FamixValueEntity, + #name : 'FamixValueUnknownType', + #superclass : 'FamixValueEntity', #traits : 'FamixTType', #classTraits : 'FamixTType classTrait', - #category : #'Famix-Value-Entities-Entities' + #category : 'Famix-Value-Entities-Entities', + #package : 'Famix-Value-Entities', + #tag : 'Entities' } -{ #category : #meta } +{ #category : 'meta' } FamixValueUnknownType class >> annotation [ @@ -48,7 +51,7 @@ FamixValueUnknownType class >> annotation [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } FamixValueUnknownType >> isUnknownType [ diff --git a/src/Famix-Value-Entities/package.st b/src/Famix-Value-Entities/package.st index 008f836..93c5a46 100644 --- a/src/Famix-Value-Entities/package.st +++ b/src/Famix-Value-Entities/package.st @@ -1 +1 @@ -Package { #name : #'Famix-Value-Entities' } +Package { #name : 'Famix-Value-Entities' } diff --git a/src/Famix-Value-Exporter/Boolean.extension.st b/src/Famix-Value-Exporter/Boolean.extension.st index 3ca24a3..94baf4c 100644 --- a/src/Famix-Value-Exporter/Boolean.extension.st +++ b/src/Famix-Value-Exporter/Boolean.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Boolean } +Extension { #name : 'Boolean' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } Boolean >> asFASTJavaExpressionOn: visitor of: type [ ^ visitor model newBooleanLiteral primitiveValue: self asString diff --git a/src/Famix-Value-Exporter/FASTBuilder.class.st b/src/Famix-Value-Exporter/FASTBuilder.class.st index d469115..e07431c 100644 --- a/src/Famix-Value-Exporter/FASTBuilder.class.st +++ b/src/Famix-Value-Exporter/FASTBuilder.class.st @@ -2,27 +2,29 @@ I am a helper for the `FamixValue2ASTVisitor` hierarchy of classes to build AST. " Class { - #name : #FASTBuilder, - #superclass : #Object, + #name : 'FASTBuilder', + #superclass : 'Object', #instVars : [ 'model' ], - #category : #'Famix-Value-Exporter-Helpers' + #category : 'Famix-Value-Exporter-Helpers', + #package : 'Famix-Value-Exporter', + #tag : 'Helpers' } -{ #category : #testing } +{ #category : 'testing' } FASTBuilder class >> isAbstract [ ^ self == FASTBuilder ] -{ #category : #accessing } +{ #category : 'accessing' } FASTBuilder >> model [ ^ model ifNil: [ model := FASTJavaModel new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FASTBuilder >> model: aFASTModel [ model := aFASTModel diff --git a/src/Famix-Value-Exporter/FASTJavaBuilder.class.st b/src/Famix-Value-Exporter/FASTJavaBuilder.class.st index dbc29e5..5119680 100644 --- a/src/Famix-Value-Exporter/FASTJavaBuilder.class.st +++ b/src/Famix-Value-Exporter/FASTJavaBuilder.class.st @@ -2,15 +2,17 @@ I am used to handle Java type references and imports. " Class { - #name : #FASTJavaBuilder, - #superclass : #FASTBuilder, + #name : 'FASTJavaBuilder', + #superclass : 'FASTBuilder', #instVars : [ 'typeNameDictionary' ], - #category : #'Famix-Value-Exporter-Helpers' + #category : 'Famix-Value-Exporter-Helpers', + #package : 'Famix-Value-Exporter', + #tag : 'Helpers' } -{ #category : #ast } +{ #category : 'ast' } FASTJavaBuilder >> fullyQualifiedPackageNameFor: aFamixJavaPackage [ ^ aFamixJavaPackage parentPackage @@ -21,7 +23,7 @@ FASTJavaBuilder >> fullyQualifiedPackageNameFor: aFamixJavaPackage [ namespace: (self fullyQualifiedPackageNameFor: parentPackage) ] ] -{ #category : #ast } +{ #category : 'ast' } FASTJavaBuilder >> fullyQualifiedTypeNameFor: aFamixJavaType [ ^ self model newQualifiedTypeName @@ -30,20 +32,20 @@ FASTJavaBuilder >> fullyQualifiedTypeNameFor: aFamixJavaType [ (self fullyQualifiedPackageNameFor: aFamixJavaType typeContainer) ] -{ #category : #initialization } +{ #category : 'initialization' } FASTJavaBuilder >> initialize [ typeNameDictionary := Dictionary new ] -{ #category : #ast } +{ #category : 'ast' } FASTJavaBuilder >> makeImportDeclaration: aFamixType [ ^ self model newImportDeclaration qualifiedName: (model newQualifiedName name: aFamixType mooseNameWithDots) ] -{ #category : #ast } +{ #category : 'ast' } FASTJavaBuilder >> makeImportDeclarations [ "Make an import declaration for each type processed by this builder." @@ -51,7 +53,7 @@ FASTJavaBuilder >> makeImportDeclarations [ self makeImportDeclaration: type ] ] -{ #category : #ast } +{ #category : 'ast' } FASTJavaBuilder >> makeImportDeclarations: anEntity [ "Make import declarations for all types related to the given entity." @@ -60,7 +62,7 @@ FASTJavaBuilder >> makeImportDeclarations: anEntity [ as: OrderedCollection ] -{ #category : #processing } +{ #category : 'processing' } FASTJavaBuilder >> processType: aFamixType [ "Process the given type and its related types, for example if it has concrete type parameters. This lets the builder know how to refer to the type. @@ -77,7 +79,7 @@ FASTJavaBuilder >> processType: aFamixType [ typeNameDictionary at: type name ifAbsentPut: type ] ] -{ #category : #processing } +{ #category : 'processing' } FASTJavaBuilder >> referType: aFamixType [ "Process a type and return a FAST expression to reference it. Use its unqualified name when importing the type, otherwise use its fully qualified name." diff --git a/src/Famix-Value-Exporter/FASTJavaFieldAccess.extension.st b/src/Famix-Value-Exporter/FASTJavaFieldAccess.extension.st index 1ff336d..41845cd 100644 --- a/src/Famix-Value-Exporter/FASTJavaFieldAccess.extension.st +++ b/src/Famix-Value-Exporter/FASTJavaFieldAccess.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FASTJavaFieldAccess } +Extension { #name : 'FASTJavaFieldAccess' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FASTJavaFieldAccess >> accessedAttributeName [ ^ fieldName ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FASTJavaFieldAccess >> accessedAttributesOf: aFamixJavaClass [ "TODO: ensure 'this' is of the given class..." diff --git a/src/Famix-Value-Exporter/FASTJavaParameter.extension.st b/src/Famix-Value-Exporter/FASTJavaParameter.extension.st index e9977f6..2d53ca4 100644 --- a/src/Famix-Value-Exporter/FASTJavaParameter.extension.st +++ b/src/Famix-Value-Exporter/FASTJavaParameter.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FASTJavaParameter } +Extension { #name : 'FASTJavaParameter' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FASTJavaParameter >> accessedAttributesOf: aFamixJavaClass [ ^ { } diff --git a/src/Famix-Value-Exporter/FASTJavaVariableExpression.extension.st b/src/Famix-Value-Exporter/FASTJavaVariableExpression.extension.st index f042093..2f55cb0 100644 --- a/src/Famix-Value-Exporter/FASTJavaVariableExpression.extension.st +++ b/src/Famix-Value-Exporter/FASTJavaVariableExpression.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FASTJavaVariableExpression } +Extension { #name : 'FASTJavaVariableExpression' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FASTJavaVariableExpression >> accessedAttributeName [ ^ name ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FASTJavaVariableExpression >> accessedAttributesOf: aFamixJavaClass [ self javaAssignmentExpressionOwner ifNotNil: [ :assign | diff --git a/src/Famix-Value-Exporter/FamixJavaAttribute.extension.st b/src/Famix-Value-Exporter/FamixJavaAttribute.extension.st index 7d71795..078a64b 100644 --- a/src/Famix-Value-Exporter/FamixJavaAttribute.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaAttribute.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaAttribute } +Extension { #name : 'FamixJavaAttribute' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaAttribute >> initializerMatchesValues: objectAttributes [ "Assume I have a source and an initializer expression. Return whether the representations of primitive objects, given as argument, match those of my initializer expression, regardless of order. @@ -21,7 +21,7 @@ FamixJavaAttribute >> initializerMatchesValues: objectAttributes [ ^ toFind isEmpty ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaAttribute >> isStaticConstant [ "Public static attribute with an initializer." diff --git a/src/Famix-Value-Exporter/FamixJavaClass.extension.st b/src/Famix-Value-Exporter/FamixJavaClass.extension.st index 2390af7..2456471 100644 --- a/src/Famix-Value-Exporter/FamixJavaClass.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaClass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaClass } +Extension { #name : 'FamixJavaClass' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaClass >> asFASTJavaDefaultValueOn: aFASTJavaModel [ ^ aFASTJavaModel newNullLiteral diff --git a/src/Famix-Value-Exporter/FamixJavaMethod.extension.st b/src/Famix-Value-Exporter/FamixJavaMethod.extension.st index 5edeabd..1037339 100644 --- a/src/Famix-Value-Exporter/FamixJavaMethod.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaMethod.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaMethod } +Extension { #name : 'FamixJavaMethod' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaMethod >> isSetterLax [ "Name begins with set AND Has 1 parameter AND diff --git a/src/Famix-Value-Exporter/FamixJavaParameter.extension.st b/src/Famix-Value-Exporter/FamixJavaParameter.extension.st index e198f3d..53b60fc 100644 --- a/src/Famix-Value-Exporter/FamixJavaParameter.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaParameter.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaParameter } +Extension { #name : 'FamixJavaParameter' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaParameter >> allAccessedAttributesOf: aFamixJavaClass [ aFamixJavaClass generateFastIfNotDoneAndBind. "need to bind at class level" diff --git a/src/Famix-Value-Exporter/FamixJavaParameterType.extension.st b/src/Famix-Value-Exporter/FamixJavaParameterType.extension.st index 7642c33..cdab85b 100644 --- a/src/Famix-Value-Exporter/FamixJavaParameterType.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaParameterType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaParameterType } +Extension { #name : 'FamixJavaParameterType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaParameterType >> needsJavaImport [ ^ false diff --git a/src/Famix-Value-Exporter/FamixJavaParametricClass.extension.st b/src/Famix-Value-Exporter/FamixJavaParametricClass.extension.st index 6f1c2c7..d68b37d 100644 --- a/src/Famix-Value-Exporter/FamixJavaParametricClass.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaParametricClass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaParametricClass } +Extension { #name : 'FamixJavaParametricClass' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaParametricClass >> concreteTypeNameOn: stream [ stream nextPutAll: name. diff --git a/src/Famix-Value-Exporter/FamixJavaParametricInterface.extension.st b/src/Famix-Value-Exporter/FamixJavaParametricInterface.extension.st index 3e7bece..965ae8e 100644 --- a/src/Famix-Value-Exporter/FamixJavaParametricInterface.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaParametricInterface.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaParametricInterface } +Extension { #name : 'FamixJavaParametricInterface' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaParametricInterface >> concreteTypeNameOn: stream [ (#( Map Set ) includes: name) diff --git a/src/Famix-Value-Exporter/FamixJavaPrimitiveType.extension.st b/src/Famix-Value-Exporter/FamixJavaPrimitiveType.extension.st index 8eda615..394e521 100644 --- a/src/Famix-Value-Exporter/FamixJavaPrimitiveType.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaPrimitiveType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaPrimitiveType } +Extension { #name : 'FamixJavaPrimitiveType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaPrimitiveType >> asFASTJavaDefaultValueOn: model [ (#( int short byte ) includes: name) ifTrue: [ @@ -16,7 +16,7 @@ FamixJavaPrimitiveType >> asFASTJavaDefaultValueOn: model [ self error: 'Unknown primitive type:' , name ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaPrimitiveType >> asFASTJavaTypeExpressionOn: visitor [ | model | @@ -32,7 +32,7 @@ FamixJavaPrimitiveType >> asFASTJavaTypeExpressionOn: visitor [ self error: 'Unknown primitive type:' , name ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaPrimitiveType >> needsJavaImport [ ^ false diff --git a/src/Famix-Value-Exporter/FamixJavaType.extension.st b/src/Famix-Value-Exporter/FamixJavaType.extension.st index 073020e..e5b1149 100644 --- a/src/Famix-Value-Exporter/FamixJavaType.extension.st +++ b/src/Famix-Value-Exporter/FamixJavaType.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixJavaType } +Extension { #name : 'FamixJavaType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> acceptValueVisitor: visitor forCollection: collection [ ^ visitor visitCollectionOfRegularType: collection ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> acceptValueVisitor: visitor forObject: object [ ^ self isStub @@ -14,26 +14,26 @@ FamixJavaType >> acceptValueVisitor: visitor forObject: object [ ifFalse: [ visitor visitObjectOfRegularType: object ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> asFASTJavaTypeExpressionOn: visitor [ ^ visitor builder referType: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> concreteTypeName [ "Answer the type name of the most commonly used concrete class of this type, e.g. List -> ArrayList" ^ String streamContents: [ :stream | self concreteTypeNameOn: stream ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> concreteTypeNameOn: stream [ stream nextPutAll: name ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> decorate: aFamixJavaType asFASTJavaTypeExpressionOn: visitor [ "This method allows for more control by having access to both the static (argument) and dynamic (self) types of a value. The default behavior handles when the static type is a parameter type, then it uses the dynamic type. @@ -44,20 +44,20 @@ FamixJavaType >> decorate: aFamixJavaType asFASTJavaTypeExpressionOn: visitor [ ifFalse: [ aFamixJavaType asFASTJavaTypeExpressionOn: visitor ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> needsJavaImport [ ^ typeContainer mooseName ~= 'java::lang' ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> typeName [ "Includes type arguments, e.g. List>" ^ String streamContents: [ :stream | self typeNameOn: stream ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixJavaType >> value: value asFASTJavaExpressionOn: visitor [ "hook for types with a particular serialization format" diff --git a/src/Famix-Value-Exporter/FamixStMethod.extension.st b/src/Famix-Value-Exporter/FamixStMethod.extension.st index fd98995..898351b 100644 --- a/src/Famix-Value-Exporter/FamixStMethod.extension.st +++ b/src/Famix-Value-Exporter/FamixStMethod.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixStMethod } +Extension { #name : 'FamixStMethod' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixStMethod >> isSetterLax [ ^ self isSetter ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixStMethod >> varName [ | varName | diff --git a/src/Famix-Value-Exporter/FamixTClass.extension.st b/src/Famix-Value-Exporter/FamixTClass.extension.st index e15f6bb..59b977c 100644 --- a/src/Famix-Value-Exporter/FamixTClass.extension.st +++ b/src/Famix-Value-Exporter/FamixTClass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTClass } +Extension { #name : 'FamixTClass' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTClass >> constructorsOrderedByScore [ "Return the constructors ordered by an arbitrary score that determine their effectiveness. The score is roughly the ratio of attributes set over parameter count, see FamixTMethod>>#impactScore." @@ -9,7 +9,7 @@ FamixTClass >> constructorsOrderedByScore [ a constructorScore > b constructorScore ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTClass >> findSetterOf: aFamixAttribute [ (self isParametricEntity and: [ self isConcreteEntity ]) ifTrue: [ @@ -24,7 +24,7 @@ FamixTClass >> findSetterOf: aFamixAttribute [ superclass findSetterOf: aFamixAttribute ] ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTClass >> publicConstructorsWithMostImpact [ "Return the constructors that access the most attributes and have the most parameters." diff --git a/src/Famix-Value-Exporter/FamixTMethod.extension.st b/src/Famix-Value-Exporter/FamixTMethod.extension.st index 52f996a..3a45ec6 100644 --- a/src/Famix-Value-Exporter/FamixTMethod.extension.st +++ b/src/Famix-Value-Exporter/FamixTMethod.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTMethod } +Extension { #name : 'FamixTMethod' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTMethod >> allAccessedAttributes [ ^ self cacheAt: #allAccessedAttributes ifAbsentPut: [ @@ -9,7 +9,7 @@ FamixTMethod >> allAccessedAttributes [ seen: IdentitySet new ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTMethod >> allAccessedAttributesOn: collection seen: seen [ (seen includes: self) ifTrue: [ ^ collection ]. @@ -31,7 +31,7 @@ FamixTMethod >> allAccessedAttributesOn: collection seen: seen [ ^ collection ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTMethod >> constructorScore [ "Arbitrary score to evaluate the effectiveness of a constructor." @@ -44,7 +44,7 @@ FamixTMethod >> constructorScore [ parameterCount * self allAccessedAttributes size / parameterCount ] ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTMethod >> mapConstructorParametersToAttributes [ "Return the list of the attribute set by each of my parameters, e.g. if I were: MyClass(int theFoo, String someBar) { this.foo = theFoo; setBar(someBar); } diff --git a/src/Famix-Value-Exporter/FamixTParametricEntity.extension.st b/src/Famix-Value-Exporter/FamixTParametricEntity.extension.st index f317edc..a30c00a 100644 --- a/src/Famix-Value-Exporter/FamixTParametricEntity.extension.st +++ b/src/Famix-Value-Exporter/FamixTParametricEntity.extension.st @@ -1,19 +1,19 @@ -Extension { #name : #FamixTParametricEntity } +Extension { #name : 'FamixTParametricEntity' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTParametricEntity >> keyType [ ^ self allTypeParameters first ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTParametricEntity >> typeNameOn: stream [ stream nextPutAll: self name. self typeParameterNamesOn: stream ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTParametricEntity >> typeParameterNamesOn: stream [ stream nextPut: $<. @@ -32,7 +32,7 @@ FamixTParametricEntity >> typeParameterNamesOn: stream [ stream nextPut: $> ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTParametricEntity >> valueType [ | typeParameters | diff --git a/src/Famix-Value-Exporter/FamixTType.extension.st b/src/Famix-Value-Exporter/FamixTType.extension.st index f127bf8..1dfd6a7 100644 --- a/src/Famix-Value-Exporter/FamixTType.extension.st +++ b/src/Famix-Value-Exporter/FamixTType.extension.st @@ -1,13 +1,13 @@ -Extension { #name : #FamixTType } +Extension { #name : 'FamixTType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTType >> baseName [ "Without type arguments, e.g. List" ^ name ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTType >> typeNameOn: stream [ stream nextPutAll: name diff --git a/src/Famix-Value-Exporter/FamixTTypedEntity.extension.st b/src/Famix-Value-Exporter/FamixTTypedEntity.extension.st index 92c3fae..b53cff2 100644 --- a/src/Famix-Value-Exporter/FamixTTypedEntity.extension.st +++ b/src/Famix-Value-Exporter/FamixTTypedEntity.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTTypedEntity } +Extension { #name : 'FamixTTypedEntity' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixTTypedEntity >> varName [ ^ self name diff --git a/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st b/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st index 3d24a9d..4ebeb50 100644 --- a/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st +++ b/src/Famix-Value-Exporter/FamixValue2ASTVisitor.class.st @@ -2,67 +2,69 @@ My subclasses are used to generate the AST for the source code to instantiate a kind of `FamixValueOfType`. " Class { - #name : #FamixValue2ASTVisitor, - #superclass : #Object, + #name : 'FamixValue2ASTVisitor', + #superclass : 'Object', #instVars : [ 'model', 'varNameDict', 'id', 'statementBlock' ], - #category : #'Famix-Value-Exporter-Visitors' + #category : 'Famix-Value-Exporter-Visitors', + #package : 'Famix-Value-Exporter', + #tag : 'Visitors' } -{ #category : #testing } +{ #category : 'testing' } FamixValue2ASTVisitor class >> isAbstract [ ^ self == FamixValue2ASTVisitor ] -{ #category : #testing } +{ #category : 'testing' } FamixValue2ASTVisitor >> ensureVisited: value [ "Visit a value if I have not done it before" (self varNameDict includesKey: value) ifFalse: [ value accept: self ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2ASTVisitor >> model [ ^ model ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2ASTVisitor >> model: aModel [ model := aModel ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2ASTVisitor >> nextId [ ^ (id := (id ifNil: 0) + 1) - 1 ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2ASTVisitor >> statementBlock [ ^ statementBlock ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2ASTVisitor >> statementBlock: aStatementSequence [ statementBlock := aStatementSequence ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2ASTVisitor >> varNameDict [ ^ varNameDict ifNil: [ varNameDict := Dictionary new ] ] -{ #category : #naming } +{ #category : 'naming' } FamixValue2ASTVisitor >> varNameFor: value [ "IMPORTANT: a named value is considered already exported." @@ -71,37 +73,37 @@ FamixValue2ASTVisitor >> varNameFor: value [ ifAbsentPut: [ value varName , self nextId asString ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2ASTVisitor >> visitCollection: collection [ self subclassResponsibility ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2ASTVisitor >> visitDictionary: dictionary [ self subclassResponsibility ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2ASTVisitor >> visitEnumValue: enumValue [ self subclassResponsibility ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2ASTVisitor >> visitObject: object [ self subclassResponsibility ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2ASTVisitor >> visitPrimitive: primitive [ self subclassResponsibility ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2ASTVisitor >> visitValueOfUnknownType: value [ self subclassResponsibility diff --git a/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st b/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st index c493618..b6c9d5a 100644 --- a/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st +++ b/src/Famix-Value-Exporter/FamixValue2FASTJavaVisitor.class.st @@ -9,8 +9,8 @@ When exporting a `FamixValueOfObjectAttribute`, if the setter for its `FamixTAtt All attributes that fall into this category are added as `markedForReflection`. " Class { - #name : #FamixValue2FASTJavaVisitor, - #superclass : #FamixValue2ASTVisitor, + #name : 'FamixValue2FASTJavaVisitor', + #superclass : 'FamixValue2ASTVisitor', #instVars : [ 'builder', 'constructorCache', @@ -18,10 +18,12 @@ Class { 'objectExportStrategy', 'reflections' ], - #category : #'Famix-Value-Exporter-Visitors' + #category : 'Famix-Value-Exporter-Visitors', + #package : 'Famix-Value-Exporter', + #tag : 'Visitors' } -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> addAttributesFrom: object asArgumentsTo: invocation usingConstructor: constructor [ (constructorCache @@ -45,13 +47,13 @@ FamixValue2FASTJavaVisitor >> addAttributesFrom: object asArgumentsTo: invocatio self model ] ]) ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2FASTJavaVisitor >> builder [ ^ builder ifNil: [ builder := FASTJavaBuilder new model: self model ] ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> constructObject: object [ | constructor invocation | @@ -78,7 +80,7 @@ FamixValue2FASTJavaVisitor >> constructObject: object [ usingConstructor: constructor ] ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> ensureReflection [ "Ensure that the infrastructure needed to use reflection is generated. A static method called `initializeReflection` is created and will be populated by calls to `ensureReflectionField:` and `ensureReflectionConstructor:`. @@ -267,7 +269,7 @@ FamixValue2FASTJavaVisitor >> ensureReflection [ ^ initStatementBlock ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> ensureReflectionConstructor: aFamixJavaMethod [ | declarations initStatementBlock varName | @@ -321,7 +323,7 @@ FamixValue2FASTJavaVisitor >> ensureReflectionConstructor: aFamixJavaMethod [ arguments: { (model newBooleanLiteral primitiveValue: 'true') })) ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> ensureReflectionField: attribute [ "Ensure an attribute exists to hold the java.lang.reflect.Field for the given attribute." @@ -375,7 +377,7 @@ FamixValue2FASTJavaVisitor >> ensureReflectionField: attribute [ varName ] ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> filterAttributesToSet: attributes for: object [ "No need to set attributes that are set in the constructor." @@ -391,7 +393,7 @@ FamixValue2FASTJavaVisitor >> filterAttributesToSet: attributes for: object [ ifAbsent: [ attributes ] ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> findConstructorFor: object [ "Order all constructors according to attributes set and number of parameters, then choose best public one. If no constructor is explicitly declared, use the default constructor. Otherwise, rely on reflection." @@ -412,7 +414,7 @@ FamixValue2FASTJavaVisitor >> findConstructorFor: object [ constructor ] ] ] ] -{ #category : #private } +{ #category : 'private' } FamixValue2FASTJavaVisitor >> findStaticAttributeMatching: object [ "Only try to find static attributes for object composed of only primitive values, for now." @@ -437,21 +439,21 @@ FamixValue2FASTJavaVisitor >> findStaticAttributeMatching: object [ ifNone: nil ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValue2FASTJavaVisitor >> initialize [ constructorCache := IdentityDictionary new. staticAttributesCache := IdentityDictionary new ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeClassTypeExpression: typeName [ ^ self model newClassTypeExpression typeName: (model newTypeName name: typeName) ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeHelper [ "The helper should always be generated, regardless of strategy. This method must be called after all of the other value exports are done." @@ -477,7 +479,7 @@ FamixValue2FASTJavaVisitor >> makeHelper [ self objectExportStrategy addToHelper: helperClass ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeHelperClass [ "The helper class should not be instantiated so it has a private constructor." @@ -491,7 +493,7 @@ FamixValue2FASTJavaVisitor >> makeHelperClass [ yourself ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeNewExpression: object [ ^ self model newNewExpression type: @@ -499,7 +501,7 @@ FamixValue2FASTJavaVisitor >> makeNewExpression: object [ "(self makeClassTypeExpression: object type concreteTypeName)" ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeReflectionFieldGetter: attribute [ ^ self model newMethodInvocation @@ -513,7 +515,7 @@ FamixValue2FASTJavaVisitor >> makeReflectionFieldGetter: attribute [ yourself ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeReflectionSetterInvocation: attribute [ "Use reflection to set an attribute on an object." @@ -529,7 +531,7 @@ FamixValue2FASTJavaVisitor >> makeReflectionSetterInvocation: attribute [ (model newVariableExpression name: attribute value varName) })) ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeSetterInvocation: setter for: attribute [ self @@ -538,7 +540,7 @@ FamixValue2FASTJavaVisitor >> makeSetterInvocation: setter for: attribute [ named: (self varNameFor: attribute value) ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeSetterInvocation: setter for: attribute named: aString [ self statementBlock addStatement: @@ -550,7 +552,7 @@ FamixValue2FASTJavaVisitor >> makeSetterInvocation: setter for: attribute named: famixMethod: setter)) ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeVarDeclStatement: value [ ^ self model newVarDeclStatement @@ -559,7 +561,7 @@ FamixValue2FASTJavaVisitor >> makeVarDeclStatement: value [ yourself ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeVarDeclStatement: object usingStaticAttribute: attribute [ "Declare a variable for object, initialized with the value of the given static attribute. For example: MyClass myClass = MyClass.MY_STATIC_ATTRIBUTE;" @@ -574,7 +576,7 @@ FamixValue2FASTJavaVisitor >> makeVarDeclStatement: object usingStaticAttribute: yourself) ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeVariableDeclarator: value [ ^ self model newVariableDeclarator @@ -582,52 +584,52 @@ FamixValue2FASTJavaVisitor >> makeVariableDeclarator: value [ expression: (value asFASTJavaExpressionOn: self) ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2FASTJavaVisitor >> makeVariableExpression: value [ ^ self model newVariableExpression name: (self varNameFor: value) ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2FASTJavaVisitor >> model [ ^ model ifNil: [ model := FASTJavaModel new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2FASTJavaVisitor >> objectExportStrategy [ ^ objectExportStrategy ifNil: [ objectExportStrategy := FamixValueInlineObjectExportStrategy new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2FASTJavaVisitor >> objectExportStrategy: anObjectExportStrategy [ objectExportStrategy := anObjectExportStrategy ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2FASTJavaVisitor >> reflections [ ^ reflections ifNil: [ reflections := IdentityDictionary new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2FASTJavaVisitor >> statementBlock [ ^ statementBlock ifNil: [ statementBlock := self model newStatementBlock ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitCollection: collection [ "Dispatch to type to handle special cases" ^ collection type acceptValueVisitor: self forCollection: collection ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitCollectionOfRegularType: collection [ | varName | @@ -646,7 +648,7 @@ FamixValue2FASTJavaVisitor >> visitCollectionOfRegularType: collection [ ^ statementBlock ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitDictionary: dictionary [ | varName | @@ -667,7 +669,7 @@ FamixValue2FASTJavaVisitor >> visitDictionary: dictionary [ ^ statementBlock ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitEnumValue: enumValue [ ^ self statementBlock @@ -675,14 +677,14 @@ FamixValue2FASTJavaVisitor >> visitEnumValue: enumValue [ yourself ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitObject: object [ "Dispatch to type to handle special cases" ^ object type acceptValueVisitor: self forObject: object ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitObjectAttribute: attribute [ attribute attribute ifNil: [ "ignore unknown attributes" ^ self ]. @@ -692,7 +694,7 @@ FamixValue2FASTJavaVisitor >> visitObjectAttribute: attribute [ ifNil: [ self makeReflectionSetterInvocation: attribute ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitObjectOfRegularType: object [ "Dispatched here from #visitObject: if the object has a regular creation schema: use constructor, then setup each attribute and use setter or reflection." @@ -704,14 +706,14 @@ FamixValue2FASTJavaVisitor >> visitObjectOfRegularType: object [ ^ statementBlock ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitObjectStub: object [ "Previously tried to recreate stubs by deserializing their JSON representation, but getting a correct JSON string is a challenge." self shouldBeImplemented ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitPrimitive: primitive [ ^ self statementBlock @@ -719,7 +721,7 @@ FamixValue2FASTJavaVisitor >> visitPrimitive: primitive [ yourself ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2FASTJavaVisitor >> visitValueOfUnknownType: value [ ^ self statementBlock diff --git a/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st b/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st index 9e0aba4..d213952 100644 --- a/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st +++ b/src/Famix-Value-Exporter/FamixValue2PharoVisitor.class.st @@ -6,16 +6,18 @@ Collections are constructed using the `withAll:` class method. Dictionaries are constructed using the `newFrom:` class method. " Class { - #name : #FamixValue2PharoVisitor, - #superclass : #FamixValue2ASTVisitor, + #name : 'FamixValue2PharoVisitor', + #superclass : 'FamixValue2ASTVisitor', #instVars : [ 'definedValues', 'vars' ], - #category : #'Famix-Value-Exporter-Visitors' + #category : 'Famix-Value-Exporter-Visitors', + #package : 'Famix-Value-Exporter', + #tag : 'Visitors' } -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> addParenthesis: aNode [ "add parenthesis when the node as multiple references" @@ -28,7 +30,7 @@ FamixValue2PharoVisitor >> addParenthesis: aNode [ ^ newNode ] -{ #category : #testing } +{ #category : 'testing' } FamixValue2PharoVisitor >> ensureVisited: value [ value isOfPrimitiveType ifTrue: [ ^ value accept: self ]. @@ -40,7 +42,7 @@ FamixValue2PharoVisitor >> ensureVisited: value [ value accept: self ] ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValue2PharoVisitor >> initialize [ super initialize. @@ -49,7 +51,7 @@ FamixValue2PharoVisitor >> initialize [ vars := IdentityDictionary new ] -{ #category : #testing } +{ #category : 'testing' } FamixValue2PharoVisitor >> makeAssignmentFor: aVariableName and: aValue [ "^ RBAssignmentNode variable: (self makeVariableNamed: aVariableName) value: aValue" @@ -61,19 +63,19 @@ FamixValue2PharoVisitor >> makeAssignmentFor: aVariableName and: aValue [ aValue } ] -{ #category : #ast } +{ #category : 'ast' } FamixValue2PharoVisitor >> makeHelper [ ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> makeVariableExpression: value [ ^ RBVariableNode named: (self varNameFor: value) ] -{ #category : #testing } +{ #category : 'testing' } FamixValue2PharoVisitor >> makeVariableNamed: aString [ "^ RBVariableNode named: aString" @@ -83,19 +85,13 @@ FamixValue2PharoVisitor >> makeVariableNamed: aString [ arguments: { (RBLiteralNode value: aString) } ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValue2PharoVisitor >> statementBlock [ ^ statementBlock ifNil: [ statementBlock := RBSequenceNode new ] ] -{ #category : #visiting } -FamixValue2PharoVisitor >> visitClassReference: aFamixValueOfClassReference [ - - ^ RBVariableNode named: aFamixValueOfClassReference value name -] - -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitClosure: closure [ closure variables do: [ :var | self ensureVisited: var value ]. @@ -110,7 +106,7 @@ FamixValue2PharoVisitor >> visitClosure: closure [ error pass ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitCollection: collection [ | name isArrayed | @@ -146,7 +142,7 @@ FamixValue2PharoVisitor >> visitCollection: collection [ arguments: { elementNode } ]) ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitDictionary: dictionary [ self statementBlock addNode: (self @@ -161,7 +157,7 @@ FamixValue2PharoVisitor >> visitDictionary: dictionary [ self visitDictionaryAssociation: assoc ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitDictionaryAssociation: association [ | key value keyNode valueNode | @@ -182,13 +178,13 @@ FamixValue2PharoVisitor >> visitDictionaryAssociation: association [ ifFalse: [ self makeVariableNamed: (self varNameFor: value) ]) }) ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitEnumValue: enumValue [ self shouldNotImplement ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitObject: object [ self statementBlock addNode: (self @@ -200,7 +196,7 @@ FamixValue2PharoVisitor >> visitObject: object [ object value do: [ :attribute | self visitObjectAttribute: attribute ] ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitObjectAttribute: attribute [ | value attributeNode | @@ -227,8 +223,14 @@ FamixValue2PharoVisitor >> visitObjectAttribute: attribute [ attributeNode } ]) ] -{ #category : #visiting } +{ #category : 'visiting' } FamixValue2PharoVisitor >> visitPrimitive: primitive [ ^ RBLiteralValueNode value: primitive value ] + +{ #category : 'visiting' } +FamixValue2PharoVisitor >> visitTypeReference: aFamixValueOfTypeReference [ + + ^ RBVariableNode named: aFamixValueOfTypeReference value name +] diff --git a/src/Famix-Value-Exporter/FamixValueAbstractObjectExportStrategy.class.st b/src/Famix-Value-Exporter/FamixValueAbstractObjectExportStrategy.class.st index 108cdec..6852125 100644 --- a/src/Famix-Value-Exporter/FamixValueAbstractObjectExportStrategy.class.st +++ b/src/Famix-Value-Exporter/FamixValueAbstractObjectExportStrategy.class.st @@ -3,29 +3,31 @@ I am a strategy for exporting objects used by the `FamixValue2ASTVisitor` hierar Objects can be complex to recreate due to deep nesting and circular dependencies, resulting in a lot of code. My subclasses define where that code goes. " Class { - #name : #FamixValueAbstractObjectExportStrategy, - #superclass : #Object, - #category : #'Famix-Value-Exporter-Strategies' + #name : 'FamixValueAbstractObjectExportStrategy', + #superclass : 'Object', + #category : 'Famix-Value-Exporter-Strategies', + #package : 'Famix-Value-Exporter', + #tag : 'Strategies' } -{ #category : #testing } +{ #category : 'testing' } FamixValueAbstractObjectExportStrategy class >> isAbstract [ ^ self == FamixValueAbstractObjectExportStrategy ] -{ #category : #ast } +{ #category : 'ast' } FamixValueAbstractObjectExportStrategy >> addToHelper: helperClass [ "Hook to add strategy specifics to the helper class. By default, do nothing." ] -{ #category : #ast } +{ #category : 'ast' } FamixValueAbstractObjectExportStrategy >> dependencyImportsOn: aFASTModel [ ^ { } ] -{ #category : #exporting } +{ #category : 'exporting' } FamixValueAbstractObjectExportStrategy >> export: object on: visitor [ self subclassResponsibility diff --git a/src/Famix-Value-Exporter/FamixValueHelperObjectExportStrategy.class.st b/src/Famix-Value-Exporter/FamixValueHelperObjectExportStrategy.class.st index c807d6c..87fb5cd 100644 --- a/src/Famix-Value-Exporter/FamixValueHelperObjectExportStrategy.class.st +++ b/src/Famix-Value-Exporter/FamixValueHelperObjectExportStrategy.class.st @@ -3,15 +3,17 @@ I generate the code to recreate objects in helper functions. For each object, a dedicated function is generated that takes no arguments and returns the recreated object. " Class { - #name : #FamixValueHelperObjectExportStrategy, - #superclass : #FamixValueAbstractObjectExportStrategy, + #name : 'FamixValueHelperObjectExportStrategy', + #superclass : 'FamixValueAbstractObjectExportStrategy', #instVars : [ 'declarations' ], - #category : #'Famix-Value-Exporter-Strategies' + #category : 'Famix-Value-Exporter-Strategies', + #package : 'Famix-Value-Exporter', + #tag : 'Strategies' } -{ #category : #ast } +{ #category : 'ast' } FamixValueHelperObjectExportStrategy >> addToHelper: helperClass [ "Must be called when building the helper class to add the generated helper declarations." @@ -19,7 +21,7 @@ FamixValueHelperObjectExportStrategy >> addToHelper: helperClass [ helperClass addDeclaration: declaration ] ] -{ #category : #ast } +{ #category : 'ast' } FamixValueHelperObjectExportStrategy >> buildMethodFor: object withParametersFor: attributes on: visitor [ "Build the helper method to construct objects of the same type as the one given in argument. Use only the relevant attributes that are given, rather than all attributes." @@ -49,13 +51,13 @@ FamixValueHelperObjectExportStrategy >> buildMethodFor: object withParametersFor ^ helper ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValueHelperObjectExportStrategy >> declarations [ ^ declarations ] -{ #category : #ast } +{ #category : 'ast' } FamixValueHelperObjectExportStrategy >> dependencyImportsOn: aFASTModel [ ^ { ((aFASTModel newImportDeclaration qualifiedName: @@ -65,7 +67,7 @@ FamixValueHelperObjectExportStrategy >> dependencyImportsOn: aFASTModel [ isOnDemand: true) } ] -{ #category : #exporting } +{ #category : 'exporting' } FamixValueHelperObjectExportStrategy >> export: object on: visitor [ "Use a helper method to instantiate the object and set its attributes." @@ -98,13 +100,13 @@ FamixValueHelperObjectExportStrategy >> export: object on: visitor [ yourself) ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValueHelperObjectExportStrategy >> initialize [ declarations := Dictionary new ] -{ #category : #ast } +{ #category : 'ast' } FamixValueHelperObjectExportStrategy >> makeMethodFor: aFamixType withParametersFor: attributes on: visitor [ "Make the method entity, handles its signature and modifiers." @@ -130,7 +132,7 @@ FamixValueHelperObjectExportStrategy >> makeMethodFor: aFamixType withParameters statementBlock: visitor statementBlock ] -{ #category : #ast } +{ #category : 'ast' } FamixValueHelperObjectExportStrategy >> makeSetterInvocationsFor: attributes on: visitor [ "Build the helper method's body: set the value of each argument to the corresponding attribute using setters or reflection." @@ -146,7 +148,7 @@ FamixValueHelperObjectExportStrategy >> makeSetterInvocationsFor: attributes on: ifNil: [ visitor makeReflectionSetterInvocation: attribute ] ] ] -{ #category : #ast } +{ #category : 'ast' } FamixValueHelperObjectExportStrategy >> makeVariableExpression: value on: visitor [ "Used when constructing an object to correctly name the argument variable. For helpers, the var name is the same as the helper method parameter." diff --git a/src/Famix-Value-Exporter/FamixValueInlineObjectExportStrategy.class.st b/src/Famix-Value-Exporter/FamixValueInlineObjectExportStrategy.class.st index 2106171..8ad8070 100644 --- a/src/Famix-Value-Exporter/FamixValueInlineObjectExportStrategy.class.st +++ b/src/Famix-Value-Exporter/FamixValueInlineObjectExportStrategy.class.st @@ -3,12 +3,14 @@ I recreate objects inline. The context of the visitor will contain the code to recreate the objects. " Class { - #name : #FamixValueInlineObjectExportStrategy, - #superclass : #FamixValueAbstractObjectExportStrategy, - #category : #'Famix-Value-Exporter-Strategies' + #name : 'FamixValueInlineObjectExportStrategy', + #superclass : 'FamixValueAbstractObjectExportStrategy', + #category : 'Famix-Value-Exporter-Strategies', + #package : 'Famix-Value-Exporter', + #tag : 'Strategies' } -{ #category : #exporting } +{ #category : 'exporting' } FamixValueInlineObjectExportStrategy >> export: object on: visitor [ visitor constructObject: object. @@ -16,7 +18,7 @@ FamixValueInlineObjectExportStrategy >> export: object on: visitor [ do: [ :attribute | visitor visitObjectAttribute: attribute ] ] -{ #category : #ast } +{ #category : 'ast' } FamixValueInlineObjectExportStrategy >> makeVariableExpression: value on: visitor [ "Used when constructing an object to correctly name the argument variable. When inline, the visitor can handle naming the variable on its own." diff --git a/src/Famix-Value-Exporter/FamixValueOfClassReference.extension.st b/src/Famix-Value-Exporter/FamixValueOfClassReference.extension.st deleted file mode 100644 index 5e1f9a2..0000000 --- a/src/Famix-Value-Exporter/FamixValueOfClassReference.extension.st +++ /dev/null @@ -1,15 +0,0 @@ -Extension { #name : #FamixValueOfClassReference } - -{ #category : #'*Famix-Value-Exporter' } -FamixValueOfClassReference >> accept: visitor [ - - ^ visitor visitClassReference: self -] - -{ #category : #'*Famix-Value-Exporter' } -FamixValueOfClassReference >> asFASTJavaExpressionOn: visitor [ - - ^ visitor model newClassProperty - type: (visitor makeClassTypeExpression: self value); - fieldName: 'class' -] diff --git a/src/Famix-Value-Exporter/FamixValueOfClosure.extension.st b/src/Famix-Value-Exporter/FamixValueOfClosure.extension.st index d56e101..a5b05ed 100644 --- a/src/Famix-Value-Exporter/FamixValueOfClosure.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfClosure.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueOfClosure } +Extension { #name : 'FamixValueOfClosure' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfClosure >> accept: visitor [ ^ visitor visitClosure: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfClosure >> asFASTJavaExpressionOn: visitor [ self shouldBeImplemented diff --git a/src/Famix-Value-Exporter/FamixValueOfCollection.extension.st b/src/Famix-Value-Exporter/FamixValueOfCollection.extension.st index ebb0e02..0b738df 100644 --- a/src/Famix-Value-Exporter/FamixValueOfCollection.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfCollection.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #FamixValueOfCollection } +Extension { #name : 'FamixValueOfCollection' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfCollection >> accept: visitor [ ^ visitor visitCollection: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfCollection >> asFASTJavaExpressionOn: visitor [ ^ visitor makeNewExpression: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfCollection >> asPharoInitializationAST [ ^ RBMessageNode diff --git a/src/Famix-Value-Exporter/FamixValueOfDictionary.extension.st b/src/Famix-Value-Exporter/FamixValueOfDictionary.extension.st index b33d2c4..e08ae2c 100644 --- a/src/Famix-Value-Exporter/FamixValueOfDictionary.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfDictionary.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueOfDictionary } +Extension { #name : 'FamixValueOfDictionary' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfDictionary >> accept: visitor [ ^ visitor visitDictionary: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfDictionary >> asFASTJavaExpressionOn: visitor [ ^ visitor makeNewExpression: self diff --git a/src/Famix-Value-Exporter/FamixValueOfDictionaryAssociation.extension.st b/src/Famix-Value-Exporter/FamixValueOfDictionaryAssociation.extension.st index 5a300bb..c627bff 100644 --- a/src/Famix-Value-Exporter/FamixValueOfDictionaryAssociation.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfDictionaryAssociation.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueOfDictionaryAssociation } +Extension { #name : 'FamixValueOfDictionaryAssociation' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfDictionaryAssociation >> accept: visitor [ ^ visitor visitDictionaryAssociation: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfDictionaryAssociation >> asFASTJavaExpressionOn: visitor [ self shouldNotImplement diff --git a/src/Famix-Value-Exporter/FamixValueOfEnum.extension.st b/src/Famix-Value-Exporter/FamixValueOfEnum.extension.st index 6b9afb4..68a1b10 100644 --- a/src/Famix-Value-Exporter/FamixValueOfEnum.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfEnum.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueOfEnum } +Extension { #name : 'FamixValueOfEnum' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfEnum >> accept: visitor [ ^ visitor visitEnumValue: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfEnum >> asFASTJavaExpressionOn: visitor [ ^ visitor model newClassProperty diff --git a/src/Famix-Value-Exporter/FamixValueOfObject.extension.st b/src/Famix-Value-Exporter/FamixValueOfObject.extension.st index f1b198b..4503b67 100644 --- a/src/Famix-Value-Exporter/FamixValueOfObject.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfObject.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #FamixValueOfObject } +Extension { #name : 'FamixValueOfObject' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfObject >> accept: visitor [ ^ visitor visitObject: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfObject >> asFASTJavaExpressionOn: visitor [ ^ self type value: self asFASTJavaExpressionOn: visitor ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfObject >> asPharoInitializationAST [ ^ RBMessageNode diff --git a/src/Famix-Value-Exporter/FamixValueOfPrimitiveType.extension.st b/src/Famix-Value-Exporter/FamixValueOfPrimitiveType.extension.st index f9b4277..14258b7 100644 --- a/src/Famix-Value-Exporter/FamixValueOfPrimitiveType.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfPrimitiveType.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #FamixValueOfPrimitiveType } +Extension { #name : 'FamixValueOfPrimitiveType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfPrimitiveType >> accept: visitor [ ^ visitor visitPrimitive: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfPrimitiveType >> asFASTJavaExpressionOn: visitor [ ^ value asFASTJavaExpressionOn: visitor of: self type ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfPrimitiveType >> asPharoInitializationAST [ ^ RBLiteralNode value: self value diff --git a/src/Famix-Value-Exporter/FamixValueOfType.extension.st b/src/Famix-Value-Exporter/FamixValueOfType.extension.st index 0372b3a..9a48e22 100644 --- a/src/Famix-Value-Exporter/FamixValueOfType.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfType.extension.st @@ -1,24 +1,24 @@ -Extension { #name : #FamixValueOfType } +Extension { #name : 'FamixValueOfType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> accept: visitor [ self subclassResponsibility ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> asFASTJava [ ^ self accept: FamixValue2FASTJavaVisitor new ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> asFASTJavaExpressionOn: visitor [ self subclassResponsibility ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> asFASTJavaTypeExpressionOn: visitor [ ^ self type asFASTJavaTypeExpressionOn: visitor @@ -29,19 +29,19 @@ FamixValueOfType >> asFASTJavaTypeExpressionOn: visitor [ ifNil: [ self type typeName ])" ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> asJavaSourceCode [ ^ FASTJavaExportVisitor new export: self asFASTJava ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> asPharoAST [ ^ self accept: FamixValue2PharoVisitor new ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfType >> asPharoSourceCode [ ^ RBSimpleFormatter format: self asPharoAST diff --git a/src/Famix-Value-Exporter/FamixValueOfTypeReference.extension.st b/src/Famix-Value-Exporter/FamixValueOfTypeReference.extension.st new file mode 100644 index 0000000..16e0066 --- /dev/null +++ b/src/Famix-Value-Exporter/FamixValueOfTypeReference.extension.st @@ -0,0 +1,15 @@ +Extension { #name : 'FamixValueOfTypeReference' } + +{ #category : '*Famix-Value-Exporter' } +FamixValueOfTypeReference >> accept: visitor [ + + ^ visitor visitTypeReference: self +] + +{ #category : '*Famix-Value-Exporter' } +FamixValueOfTypeReference >> asFASTJavaExpressionOn: visitor [ + + ^ visitor model newClassProperty + type: (visitor makeClassTypeExpression: self value); + fieldName: 'class' +] diff --git a/src/Famix-Value-Exporter/FamixValueOfUnknownType.extension.st b/src/Famix-Value-Exporter/FamixValueOfUnknownType.extension.st index 29de6ed..1fec052 100644 --- a/src/Famix-Value-Exporter/FamixValueOfUnknownType.extension.st +++ b/src/Famix-Value-Exporter/FamixValueOfUnknownType.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueOfUnknownType } +Extension { #name : 'FamixValueOfUnknownType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfUnknownType >> accept: visitor [ ^ visitor visitValueOfUnknownType: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueOfUnknownType >> asFASTJavaExpressionOn: visitor [ ^ value asFASTJavaExpressionOn: visitor diff --git a/src/Famix-Value-Exporter/FamixValueUnknownType.extension.st b/src/Famix-Value-Exporter/FamixValueUnknownType.extension.st index d354e3b..b2ecc19 100644 --- a/src/Famix-Value-Exporter/FamixValueUnknownType.extension.st +++ b/src/Famix-Value-Exporter/FamixValueUnknownType.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixValueUnknownType } +Extension { #name : 'FamixValueUnknownType' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueUnknownType >> asFASTJavaTypeExpressionOn: visitor [ ^ visitor builder referType: self ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } FamixValueUnknownType >> needsJavaImport [ ^ ((name size = 6 or: [ diff --git a/src/Famix-Value-Exporter/Float.extension.st b/src/Famix-Value-Exporter/Float.extension.st index 2ae3d0e..d7a3557 100644 --- a/src/Famix-Value-Exporter/Float.extension.st +++ b/src/Famix-Value-Exporter/Float.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Float } +Extension { #name : 'Float' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } Float >> asFASTJavaExpressionOn: visitor of: type [ | typeName | diff --git a/src/Famix-Value-Exporter/Integer.extension.st b/src/Famix-Value-Exporter/Integer.extension.st index cd45a42..3737d90 100644 --- a/src/Famix-Value-Exporter/Integer.extension.st +++ b/src/Famix-Value-Exporter/Integer.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Integer } +Extension { #name : 'Integer' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } Integer >> asFASTJavaExpressionOn: visitor of: type [ | typeName | diff --git a/src/Famix-Value-Exporter/RBAssignmentNode.extension.st b/src/Famix-Value-Exporter/RBAssignmentNode.extension.st index d4d8f52..1e69251 100644 --- a/src/Famix-Value-Exporter/RBAssignmentNode.extension.st +++ b/src/Famix-Value-Exporter/RBAssignmentNode.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RBAssignmentNode } +Extension { #name : 'RBAssignmentNode' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } RBAssignmentNode >> addParenthesisToVariable [ "add parenthesis because the node as multiple references" diff --git a/src/Famix-Value-Exporter/String.extension.st b/src/Famix-Value-Exporter/String.extension.st index b6c3642..a8e093e 100644 --- a/src/Famix-Value-Exporter/String.extension.st +++ b/src/Famix-Value-Exporter/String.extension.st @@ -1,13 +1,13 @@ -Extension { #name : #String } +Extension { #name : 'String' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } String >> asFASTJavaExpressionOn: visitor of: type [ ^ visitor model newStringLiteral primitiveValue: (self copyReplaceAll: self class lf with: '\n') ] -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } String >> splitJavaArguments [ "Assume I represent a list of comma-separated Java arguments. Return that list." diff --git a/src/Famix-Value-Exporter/UndefinedObject.extension.st b/src/Famix-Value-Exporter/UndefinedObject.extension.st index c033e9c..03956aa 100644 --- a/src/Famix-Value-Exporter/UndefinedObject.extension.st +++ b/src/Famix-Value-Exporter/UndefinedObject.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #UndefinedObject } +Extension { #name : 'UndefinedObject' } -{ #category : #'*Famix-Value-Exporter' } +{ #category : '*Famix-Value-Exporter' } UndefinedObject >> asFASTJavaExpressionOn: visitor [ ^ visitor model newNullLiteral diff --git a/src/Famix-Value-Exporter/package.st b/src/Famix-Value-Exporter/package.st index 993e094..7ca148f 100644 --- a/src/Famix-Value-Exporter/package.st +++ b/src/Famix-Value-Exporter/package.st @@ -1 +1 @@ -Package { #name : #'Famix-Value-Exporter' } +Package { #name : 'Famix-Value-Exporter' } diff --git a/src/Famix-Value-Generator/FamixValueGenerator.class.st b/src/Famix-Value-Generator/FamixValueGenerator.class.st index a7138f9..8938d97 100644 --- a/src/Famix-Value-Generator/FamixValueGenerator.class.st +++ b/src/Famix-Value-Generator/FamixValueGenerator.class.st @@ -7,8 +7,8 @@ Each value entity has a relation with its type (`FamixTType` subtraits) and has They can also have a relation with a typed entity (`FamixTTypedEntity`) to represent an affectation. " Class { - #name : #FamixValueGenerator, - #superclass : #FamixMetamodelGenerator, + #name : 'FamixValueGenerator', + #superclass : 'FamixMetamodelGenerator', #instVars : [ 'value', 'primitive', @@ -23,34 +23,35 @@ Class { 'tType', 'collectionElement', 'objectAttribute', - 'classReference', 'closure', - 'closureVariable' + 'closureVariable', + 'typeReference' ], - #category : #'Famix-Value-Generator' + #category : 'Famix-Value-Generator', + #package : 'Famix-Value-Generator' } -{ #category : #accessing } +{ #category : 'accessing' } FamixValueGenerator class >> packageName [ ^ #'Famix-Value-Entities' ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueGenerator class >> prefix [ ^ #FamixValue ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueGenerator class >> submetamodels [ ^ { FamixGenerator } ] -{ #category : #definition } +{ #category : 'definition' } FamixValueGenerator >> defineClasses [ value := (builder @@ -85,9 +86,9 @@ FamixValueGenerator >> defineClasses [ newClassNamed: #OfDictionaryAssociation comment: 'A key-value pair belonging to a dictionary.'. - classReference := (builder - newClassNamed: #OfClassReference - comment: 'A reference to a class.') withTesting. + typeReference := (builder + newClassNamed: #OfTypeReference + comment: 'A reference to a type.') withTesting. closure := (builder newClassNamed: #OfClosure comment: 'A lexical closure.') withTesting. @@ -104,7 +105,7 @@ FamixValueGenerator >> defineClasses [ comment: 'An unknown type.') withTesting ] -{ #category : #definition } +{ #category : 'definition' } FamixValueGenerator >> defineHierarchy [ object --|> value. @@ -114,7 +115,7 @@ FamixValueGenerator >> defineHierarchy [ collection --|> value. dictionary --|> value. ofUnknownType --|> value. - classReference --|> value. + typeReference --|> value. dictionaryAssociation --|> value. primitive --|> tWithValueProperty. @@ -123,7 +124,7 @@ FamixValueGenerator >> defineHierarchy [ unknownType --|> tType ] -{ #category : #definition } +{ #category : 'definition' } FamixValueGenerator >> defineProperties [ (tWithValueProperty property: #value type: #Object) comment: @@ -135,7 +136,7 @@ FamixValueGenerator >> defineProperties [ 'Name of the variable bound to the closure.' ] -{ #category : #definition } +{ #category : 'definition' } FamixValueGenerator >> defineRelations [ value *- (tType property: #values). @@ -166,9 +167,8 @@ FamixValueGenerator >> defineRelations [ (dictionaryAssociation property: #value) *- (value property: #valueInDictionaries). - (classReference property: #value) - *- ((self remoteTrait: #TClass withPrefix: #Famix) property: - #valueReferences). + (typeReference property: #value) + *- (tType property: #valueReferences). (closure property: #variables) -* (closureVariable property: #closure). @@ -176,7 +176,7 @@ FamixValueGenerator >> defineRelations [ *- (value property: #variableInClosures) ] -{ #category : #definition } +{ #category : 'definition' } FamixValueGenerator >> defineTraits [ tWithValueProperty := builder diff --git a/src/Famix-Value-Generator/package.st b/src/Famix-Value-Generator/package.st index e0a8aea..239b5ad 100644 --- a/src/Famix-Value-Generator/package.st +++ b/src/Famix-Value-Generator/package.st @@ -1 +1 @@ -Package { #name : #'Famix-Value-Generator' } +Package { #name : 'Famix-Value-Generator' } diff --git a/src/Famix-Value-Importer/Association.extension.st b/src/Famix-Value-Importer/Association.extension.st index 33d8dbd..2c12201 100644 --- a/src/Famix-Value-Importer/Association.extension.st +++ b/src/Famix-Value-Importer/Association.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #Association } +Extension { #name : 'Association' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Association >> asPharoJacksonValueOn: importer [ ^ importer importAssociation: self ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Association >> asPharoSTONValueOn: importer [ ^ importer model newOfDictionaryAssociation diff --git a/src/Famix-Value-Importer/Boolean.extension.st b/src/Famix-Value-Importer/Boolean.extension.st index 9d7b85c..edc12a9 100644 --- a/src/Famix-Value-Importer/Boolean.extension.st +++ b/src/Famix-Value-Importer/Boolean.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #Boolean } +Extension { #name : 'Boolean' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Boolean >> asJavaJacksonValueOn: importer [ ^ importer importPrimitive: self of: 'boolean' ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Boolean >> asPharoJacksonValueOn: importer [ ^ importer importPrimitive: self of: self className ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Boolean >> asPharoSTONValueOn: importer [ ^ importer importPrimitive: self of: self className diff --git a/src/Famix-Value-Importer/Character.extension.st b/src/Famix-Value-Importer/Character.extension.st index f0f5c59..c407ec6 100644 --- a/src/Famix-Value-Importer/Character.extension.st +++ b/src/Famix-Value-Importer/Character.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #Character } +Extension { #name : 'Character' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Character >> asPharoJacksonValueOn: importer [ ^ importer importPrimitive: self of: self className ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Character >> asPharoSTONValueOn: importer [ ^ importer importPrimitive: self of: self className diff --git a/src/Famix-Value-Importer/Collection.extension.st b/src/Famix-Value-Importer/Collection.extension.st index 35f585a..9607815 100644 --- a/src/Famix-Value-Importer/Collection.extension.st +++ b/src/Famix-Value-Importer/Collection.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Collection } +Extension { #name : 'Collection' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Collection >> asJavaJacksonValueOn: importer [ "List values are serialized as an array containing [1] the type name and [2] the array of elements." @@ -23,7 +23,7 @@ Collection >> asJavaJacksonValueOn: importer [ ^ importer importValueFromList: self of: importer loadType ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Collection >> asPharoJacksonValueOn: importer [ ^ importer @@ -31,7 +31,7 @@ Collection >> asPharoJacksonValueOn: importer [ of: (importer loadTypeNamed: self className) ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Collection >> asPharoSTONValueOn: importer [ ^ importer @@ -39,7 +39,7 @@ Collection >> asPharoSTONValueOn: importer [ of: (importer loadTypeNamed: self className) ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Collection >> hasJavaJacksonTypeInformation [ ^ self size = 2 and: [ diff --git a/src/Famix-Value-Importer/Dictionary.extension.st b/src/Famix-Value-Importer/Dictionary.extension.st index 8fa2fcd..edd4140 100644 --- a/src/Famix-Value-Importer/Dictionary.extension.st +++ b/src/Famix-Value-Importer/Dictionary.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Dictionary } +Extension { #name : 'Dictionary' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Dictionary >> asPharoJacksonValueOn: importer [ ^ (importer getObjectType: self) @@ -8,7 +8,7 @@ Dictionary >> asPharoJacksonValueOn: importer [ className = 'Class' ifTrue: [ importer - importClassReference: self + importTypeReference: self of: (importer loadTypeNamed: className) ] ifFalse: [ importer @@ -23,7 +23,7 @@ Dictionary >> asPharoJacksonValueOn: importer [ ifNil: [ Error signal: 'Unknown state' ] ] ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Dictionary >> asPharoSTONValueOn: importer [ ^ (self removeKey: STON classNameKey ifAbsent: nil) diff --git a/src/Famix-Value-Importer/FamixEntityFinder.class.st b/src/Famix-Value-Importer/FamixEntityFinder.class.st index a3a04fe..e924ae8 100644 --- a/src/Famix-Value-Importer/FamixEntityFinder.class.st +++ b/src/Famix-Value-Importer/FamixEntityFinder.class.st @@ -2,35 +2,36 @@ An importer helper to find types in a Famix model, based on the usage of the `FamixTType` trait. " Class { - #name : #FamixEntityFinder, - #superclass : #Object, + #name : 'FamixEntityFinder', + #superclass : 'Object', #instVars : [ 'model', 'cache', 'replacements' ], - #category : #'Famix-Value-Importer' + #category : 'Famix-Value-Importer', + #package : 'Famix-Value-Importer' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } FamixEntityFinder class >> on: aModel [ ^ self new model: aModel ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEntityFinder >> cache [ ^ cache ifNil: [ cache := Dictionary new ] ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixEntityFinder >> detectType: block [ ^ self model allTypes detect: block ifNone: nil ] -{ #category : #API } +{ #category : 'API' } FamixEntityFinder >> findMethodWithSignature: signature in: class [ | candidates | @@ -53,13 +54,13 @@ FamixEntityFinder >> findMethodWithSignature: signature in: class [ self error: 'Found multiple methods matching signature: ' , signature ] -{ #category : #API } +{ #category : 'API' } FamixEntityFinder >> findMethodsWithName: name in: class [ ^ class methods select: [ :method | method name = name ] ] -{ #category : #API } +{ #category : 'API' } FamixEntityFinder >> findTypeNamed: name [ "Main API for finding a type, should not be overridden." @@ -72,62 +73,62 @@ FamixEntityFinder >> findTypeNamed: name [ ifFalse: [ type ] ] ] ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixEntityFinder >> findTypeWithMooseName: name [ ^ self detectType: [ :type | type mooseName = name ] ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixEntityFinder >> findTypeWithName: name [ ^ self detectType: [ :type | type name = name ] ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixEntityFinder >> methodNameFromSignature: signature [ ^ signature ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEntityFinder >> model [ ^ model ifNil: [ model := FamixModel new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEntityFinder >> model: aFamixModel [ model := aFamixModel ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixEntityFinder >> parseTypeName: name [ "This method can be overriden to modify how the search is executed." ^ self findTypeWithName: name ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEntityFinder >> replace: aTypeName with: anotherTypeName [ self replacements at: aTypeName put: anotherTypeName ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEntityFinder >> replacements [ ^ replacements ifNil: [ replacements := Dictionary new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixEntityFinder >> replacements: aDictionary [ replacements := aDictionary ] -{ #category : #matching } +{ #category : 'matching' } FamixEntityFinder >> signatureOf: method matches: signature [ ^ method signature = signature diff --git a/src/Famix-Value-Importer/FamixJavaClass.extension.st b/src/Famix-Value-Importer/FamixJavaClass.extension.st index 36633dc..519a5fe 100644 --- a/src/Famix-Value-Importer/FamixJavaClass.extension.st +++ b/src/Famix-Value-Importer/FamixJavaClass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaClass } +Extension { #name : 'FamixJavaClass' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixJavaClass >> isPrimitiveWrapper [ ^ #( Integer Float Double Long Short Byte Boolean Character ) diff --git a/src/Famix-Value-Importer/FamixJavaEntityFinder.class.st b/src/Famix-Value-Importer/FamixJavaEntityFinder.class.st index da00bab..d1c7bba 100644 --- a/src/Famix-Value-Importer/FamixJavaEntityFinder.class.st +++ b/src/Famix-Value-Importer/FamixJavaEntityFinder.class.st @@ -2,15 +2,16 @@ An importer helper for finding Java types represented by `FamixJavaType` and its subclasses in a FamixJava model. " Class { - #name : #FamixJavaEntityFinder, - #superclass : #FamixEntityFinder, + #name : 'FamixJavaEntityFinder', + #superclass : 'FamixEntityFinder', #classVars : [ 'FieldDescriptors' ], - #category : #'Famix-Value-Importer' + #category : 'Famix-Value-Importer', + #package : 'Famix-Value-Importer' } -{ #category : #'class initialization' } +{ #category : 'class initialization' } FamixJavaEntityFinder class >> initialize [ "See https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.3.2" @@ -26,13 +27,13 @@ FamixJavaEntityFinder class >> initialize [ at: $Z put: 'boolean' ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixJavaEntityFinder >> methodNameFromSignature: signature [ ^ signature copyUpTo: $( ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixJavaEntityFinder >> parseTypeName: name [ "The name may not be fully qualified. Even if we want to find a name in java.lang or java.util packages, we want to search using the mooseName if it is parameterized. @@ -54,7 +55,7 @@ FamixJavaEntityFinder >> parseTypeName: name [ (FamixValueJavaArray wrapping: type) dimensions: dimensions ] ] -{ #category : #matching } +{ #category : 'matching' } FamixJavaEntityFinder >> signatureOf: method matches: signature [ "Assume the signature includes the method name and the field descriptors of the parameters, e.g. `main([Ljava.lang.String;)`. Because Famix doesn't represent arrays, use the method's signature string which contains array information. @@ -75,7 +76,7 @@ FamixJavaEntityFinder >> signatureOf: method matches: signature [ stream nextPut: $) ]) ] -{ #category : #translating } +{ #category : 'translating' } FamixJavaEntityFinder >> translateFieldDescriptor: fieldDescriptor [ "Translate Java field descriptors to a type name used by Moose, e.g. '[I' -> 'int[]' See https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.3.2" @@ -99,7 +100,7 @@ FamixJavaEntityFinder >> translateFieldDescriptor: fieldDescriptor [ ^ typeName ] -{ #category : #matching } +{ #category : 'matching' } FamixJavaEntityFinder >> translateFieldDescriptors: parameters on: stream [ "Only keep the type's simple name, discard the qualifying prefix." diff --git a/src/Famix-Value-Importer/FamixJavaMethod.extension.st b/src/Famix-Value-Importer/FamixJavaMethod.extension.st index a8013fb..0ac1d0e 100644 --- a/src/Famix-Value-Importer/FamixJavaMethod.extension.st +++ b/src/Famix-Value-Importer/FamixJavaMethod.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #FamixJavaMethod } +Extension { #name : 'FamixJavaMethod' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixJavaMethod >> isProcedure [ ^ declaredType name = 'void' ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixJavaMethod >> signatureWithoutParameterTypes [ "Rewrite the method signature ignoring parameter types, e.g. f(List) => f(List)" diff --git a/src/Famix-Value-Importer/FamixJavaType.extension.st b/src/Famix-Value-Importer/FamixJavaType.extension.st index d7804b8..066f65f 100644 --- a/src/Famix-Value-Importer/FamixJavaType.extension.st +++ b/src/Famix-Value-Importer/FamixJavaType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixJavaType } +Extension { #name : 'FamixJavaType' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixJavaType >> isDictionaryType [ ^ #( 'Map' 'HashMap' 'LinkedHashMap' ) includes: self baseName diff --git a/src/Famix-Value-Importer/FamixStMethod.extension.st b/src/Famix-Value-Importer/FamixStMethod.extension.st index 0d009d2..7dc2862 100644 --- a/src/Famix-Value-Importer/FamixStMethod.extension.st +++ b/src/Famix-Value-Importer/FamixStMethod.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixStMethod } +Extension { #name : 'FamixStMethod' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixStMethod >> isProcedure [ ^ false diff --git a/src/Famix-Value-Importer/FamixTClass.extension.st b/src/Famix-Value-Importer/FamixTClass.extension.st index 721d099..8fc40a6 100644 --- a/src/Famix-Value-Importer/FamixTClass.extension.st +++ b/src/Famix-Value-Importer/FamixTClass.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTClass } +Extension { #name : 'FamixTClass' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixTClass >> findAttributeNamed: attributeName [ ^ (self cacheAt: #resolvedAttributes ifAbsentPut: [ Dictionary new ]) @@ -14,7 +14,7 @@ FamixTClass >> findAttributeNamed: attributeName [ ifNone: [ self findAttributeWithSetterNamed: attributeName ] ] ] ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixTClass >> findAttributeWithSetterNamed: attributeName [ "Useful when the serialized attribute's name does not exactly match the attribute name. I try to find the setter matching the former, then search for the attribute access." diff --git a/src/Famix-Value-Importer/FamixTMethod.extension.st b/src/Famix-Value-Importer/FamixTMethod.extension.st index ebb8390..9bfc5cf 100644 --- a/src/Famix-Value-Importer/FamixTMethod.extension.st +++ b/src/Famix-Value-Importer/FamixTMethod.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixTMethod } +Extension { #name : 'FamixTMethod' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixTMethod >> isProcedure [ ^ declaredType isNil diff --git a/src/Famix-Value-Importer/FamixValueAbstractImporter.class.st b/src/Famix-Value-Importer/FamixValueAbstractImporter.class.st index 69ec0e0..48a8b1f 100644 --- a/src/Famix-Value-Importer/FamixValueAbstractImporter.class.st +++ b/src/Famix-Value-Importer/FamixValueAbstractImporter.class.st @@ -4,49 +4,50 @@ My subclasses parse values and generate corresponding entities to represent runt The entities are linked with a Famix model to represent their type and their optional value holder (such as a variable). " Class { - #name : #FamixValueAbstractImporter, - #superclass : #Object, + #name : 'FamixValueAbstractImporter', + #superclass : 'Object', #instVars : [ 'model', 'typeInferences', 'objectDict', 'entityFinder' ], - #category : #'Famix-Value-Importer' + #category : 'Famix-Value-Importer', + #package : 'Famix-Value-Importer' } -{ #category : #accessing } +{ #category : 'accessing' } FamixValueAbstractImporter >> entityFinder [ ^ entityFinder ifNil: [ entityFinder := FamixEntityFinder new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueAbstractImporter >> entityFinder: anEntityFinder [ entityFinder := anEntityFinder ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> getDefaultUnknownType [ ^ self getUnknownTypeNamed: '' ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> getObjectFromIdentity: id ifAbsent: aBlock [ ^ objectDict at: id ifAbsent: aBlock ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> getObjectIdentity: rawObject [ "Subclasses should define unique identifier for objects." self subclassResponsibility ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> getUnknownTypeNamed: name [ Warning signal: 'Unknown type named ' , name. @@ -55,7 +56,7 @@ FamixValueAbstractImporter >> getUnknownTypeNamed: name [ ifNone: [ self model newUnknownTypeNamed: name ] ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importCollection: rawValue of: type [ "infer element types from type argument, e.g. List => String" @@ -72,7 +73,7 @@ FamixValueAbstractImporter >> importCollection: rawValue of: type [ ^ collection ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importDictionary: rawValue of: type [ "infer from type arguments, e.g. Map" @@ -95,7 +96,7 @@ FamixValueAbstractImporter >> importDictionary: rawValue of: type [ ^ dictionary ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importEnumValue: rawValue of: type [ ^ self model newOfEnum @@ -105,7 +106,7 @@ FamixValueAbstractImporter >> importEnumValue: rawValue of: type [ enumValue name = rawValue ]) ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importObject: rawObject of: type [ | object | @@ -118,7 +119,7 @@ FamixValueAbstractImporter >> importObject: rawObject of: type [ ^ object ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importObjectAttribute: rawValue of: type named: name [ | attribute | @@ -132,7 +133,7 @@ FamixValueAbstractImporter >> importObjectAttribute: rawValue of: type named: na attribute: attribute ] ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importPrimitive: rawValue of: typeName [ "Expect to be given a type name instead of a type!" @@ -141,27 +142,27 @@ FamixValueAbstractImporter >> importPrimitive: rawValue of: typeName [ type: (self loadTypeNamed: typeName) ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> importValue: rawValue [ "This method must figure out the rawValue's type and dispatch to the corresponding importing method." self subclassResponsibility ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValueAbstractImporter >> initialize [ self reset ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> loadType [ "Return the inferred type if it exists, otherwise the type is unknown." ^ self typeInference ifNil: [ self getDefaultUnknownType ] ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> loadTypeNamed: fullyQualifiedName [ "Try to find type in model with finder, or fallback to the inferred type, or type is unknown." @@ -170,25 +171,25 @@ FamixValueAbstractImporter >> loadTypeNamed: fullyQualifiedName [ self getUnknownTypeNamed: fullyQualifiedName ] ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueAbstractImporter >> model [ ^ model ifNil: [ model := FamixValueModel new ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueAbstractImporter >> model: aModel [ model := aModel ] -{ #category : #'private - utility' } +{ #category : 'private - utility' } FamixValueAbstractImporter >> newReader [ ^ NeoJSONReader new mapClass: OrderedDictionary ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> parametricTypeInferencesOf: type [ type isParametricEntity ifFalse: [ ^ { } ]. @@ -205,14 +206,14 @@ FamixValueAbstractImporter >> parametricTypeInferencesOf: type [ ifFalse: [ type allTypeParameters ] ] -{ #category : #parsing } +{ #category : 'parsing' } FamixValueAbstractImporter >> parseList: serializedValues [ "Reify the raw values from a serialized list, useful for iterating." ^ (self newReader on: serializedValues readStream) parseList ] -{ #category : #parsing } +{ #category : 'parsing' } FamixValueAbstractImporter >> parseValue: serializedValue [ "Parse and import a serialized value." @@ -220,7 +221,7 @@ FamixValueAbstractImporter >> parseValue: serializedValue [ (self newReader on: serializedValue readStream) next ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValueAbstractImporter >> reset [ "Forget type inferences and previous object identities." @@ -228,13 +229,13 @@ FamixValueAbstractImporter >> reset [ objectDict := Dictionary new ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueAbstractImporter >> typeInference [ ^ typeInferences ifEmpty: [ ] ifNotEmpty: [ typeInferences top ] ] -{ #category : #importing } +{ #category : 'importing' } FamixValueAbstractImporter >> withTypeInference: type do: block [ | result | diff --git a/src/Famix-Value-Importer/FamixValueJavaJacksonImporter.class.st b/src/Famix-Value-Importer/FamixValueJavaJacksonImporter.class.st index 06158f2..9dad0ad 100644 --- a/src/Famix-Value-Importer/FamixValueJavaJacksonImporter.class.st +++ b/src/Famix-Value-Importer/FamixValueJavaJacksonImporter.class.st @@ -12,23 +12,24 @@ new ObjectMapper().addMixIn(Object.class, MixIn.class); ``` " Class { - #name : #FamixValueJavaJacksonImporter, - #superclass : #FamixValueAbstractImporter, + #name : 'FamixValueJavaJacksonImporter', + #superclass : 'FamixValueAbstractImporter', #instVars : [ 'typeKey', 'idKey', 'specialTypes' ], - #category : #'Famix-Value-Importer' + #category : 'Famix-Value-Importer', + #package : 'Famix-Value-Importer' } -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueJavaJacksonImporter >> getDefaultUnknownType [ ^ self getUnknownTypeNamed: 'Object' ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueJavaJacksonImporter >> getObjectIdentity: rawObject [ "Keep track of objects by using the id given by Jackson. References to previously seen objects are serialized by using this id." @@ -36,35 +37,25 @@ FamixValueJavaJacksonImporter >> getObjectIdentity: rawObject [ ^ rawObject removeKey: self idKey ifAbsent: nil ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValueJavaJacksonImporter >> getObjectType: rawObject [ ^ rawObject removeKey: self typeKey ifAbsent: nil ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueJavaJacksonImporter >> idKey [ ^ idKey ifNil: [ idKey := '@id' ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueJavaJacksonImporter >> idKey: aString [ idKey := aString ] -{ #category : #importing } -FamixValueJavaJacksonImporter >> importClassReference: rawValue of: type [ - "The type has already been loaded during the inference. - The raw value contains the fully qualified name of the referenced class." - - ^ self model newOfClassReference - value: (self loadTypeNamed: rawValue); - type: type -] - -{ #category : #importing } +{ #category : 'importing' } FamixValueJavaJacksonImporter >> importObjectAttribute: rawValue of: type named: name [ | attribute | @@ -83,7 +74,7 @@ FamixValueJavaJacksonImporter >> importObjectAttribute: rawValue of: type named: attribute: attribute ] ] -{ #category : #importing } +{ #category : 'importing' } FamixValueJavaJacksonImporter >> importSpecialObject: rawValue of: type [ "Some objects have special rules for serialization. They should have a corresponding type wrapper that knows how to handle them." @@ -95,7 +86,17 @@ FamixValueJavaJacksonImporter >> importSpecialObject: rawValue of: type [ ^ nil ] -{ #category : #importing } +{ #category : 'importing' } +FamixValueJavaJacksonImporter >> importTypeReference: rawValue of: type [ + "The type has already been loaded during the inference. + The raw value contains the fully qualified name of the referenced class." + + ^ self model newOfTypeReference + value: (self loadTypeNamed: rawValue); + type: type +] + +{ #category : 'importing' } FamixValueJavaJacksonImporter >> importValue: rawValue [ "Import a raw value, which has been parsed from JSON in Jackson format. It can be: nil, boolean, integer, string, array or dictionary." @@ -103,7 +104,7 @@ FamixValueJavaJacksonImporter >> importValue: rawValue [ ^ rawValue asJavaJacksonValueOn: self ] -{ #category : #importing } +{ #category : 'importing' } FamixValueJavaJacksonImporter >> importValueFromList: rawValue of: type [ "Jackson can serialize different types of values in a list, so we need to find out which it is." @@ -125,14 +126,14 @@ FamixValueJavaJacksonImporter >> importValueFromList: rawValue of: type [ self error: 'Unknown type: ' , type mooseNameWithDots ] -{ #category : #'private - utility' } +{ #category : 'private - utility' } FamixValueJavaJacksonImporter >> isPrimitiveType: type [ ^ type isPrimitiveType or: [ "Classes wrapping primitives are also considered primitives." type isPrimitiveWrapper ] ] -{ #category : #parsing } +{ #category : 'parsing' } FamixValueJavaJacksonImporter >> parseList: serializedValues [ | rawValues | @@ -143,7 +144,7 @@ FamixValueJavaJacksonImporter >> parseList: serializedValues [ ifFalse: [ rawValues ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueJavaJacksonImporter >> specialTypes [ ^ specialTypes ifNil: [ @@ -154,13 +155,13 @@ FamixValueJavaJacksonImporter >> specialTypes [ yourself ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueJavaJacksonImporter >> typeKey [ ^ typeKey ifNil: [ typeKey := '@type' ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValueJavaJacksonImporter >> typeKey: aString [ typeKey := aString diff --git a/src/Famix-Value-Importer/FamixValuePharoJacksonImporter.class.st b/src/Famix-Value-Importer/FamixValuePharoJacksonImporter.class.st index 6eaf50d..abbdf41 100644 --- a/src/Famix-Value-Importer/FamixValuePharoJacksonImporter.class.st +++ b/src/Famix-Value-Importer/FamixValuePharoJacksonImporter.class.st @@ -1,6 +1,6 @@ Class { - #name : #FamixValuePharoJacksonImporter, - #superclass : #FamixValueAbstractImporter, + #name : 'FamixValuePharoJacksonImporter', + #superclass : 'FamixValueAbstractImporter', #instVars : [ 'typeKey', 'idKey', @@ -8,16 +8,17 @@ Class { 'specialTypes', 'closureSources' ], - #category : #'Famix-Value-Importer' + #category : 'Famix-Value-Importer', + #package : 'Famix-Value-Importer' } -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValuePharoJacksonImporter >> getDefaultUnknownType [ ^ self getUnknownTypeNamed: 'Object' ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValuePharoJacksonImporter >> getObjectIdentity: rawObject [ "Keep track of objects by using the id given by Jackson. References to previously seen objects are serialized by using this id." @@ -25,31 +26,31 @@ FamixValuePharoJacksonImporter >> getObjectIdentity: rawObject [ ^ rawObject removeKey: self idKey ifAbsent: nil ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValuePharoJacksonImporter >> getObjectReference: rawObject [ ^ rawObject removeKey: self refKey ifAbsent: nil ] -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValuePharoJacksonImporter >> getObjectType: rawObject [ ^ rawObject removeKey: self typeKey ifAbsent: nil ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> idKey [ ^ idKey ifNil: [ idKey := '@id' ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> idKey: aString [ idKey := aString ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importArray: rawValue of: type [ ^ objectDict @@ -58,7 +59,7 @@ FamixValuePharoJacksonImporter >> importArray: rawValue of: type [ super importCollection: rawValue allButFirst of: type ] ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importAssociation: rawValue of: type [ | association | @@ -69,23 +70,13 @@ FamixValuePharoJacksonImporter >> importAssociation: rawValue of: type [ ^ association ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importCharacter: value of: type [ ^ self importPrimitive: (value at: 'value') asCharacter of: type name ] -{ #category : #importing } -FamixValuePharoJacksonImporter >> importClassReference: rawValue of: type [ - "The type has already been loaded during the inference. - The raw value contains the fully qualified name of the referenced class." - - ^ self model newOfClassReference - value: (self loadTypeNamed: (rawValue at: 'name')); - type: type -] - -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importClosure: value of: type [ | closure compiledBlock source | @@ -108,11 +99,10 @@ FamixValuePharoJacksonImporter >> importClosure: value of: type [ ^ closure ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importCollection: rawValue of: type [ | collection | - type name = 'Array2D' ifTrue: [ self halt ]. collection := self model newOfCollection type: type. objectDict at: (self getObjectIdentity: rawValue) put: collection. (rawValue at: '@') do: [ :rawElement | @@ -121,7 +111,7 @@ FamixValuePharoJacksonImporter >> importCollection: rawValue of: type [ ^ collection ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importDictionary: rawValue of: type [ | dictionary | @@ -132,7 +122,7 @@ FamixValuePharoJacksonImporter >> importDictionary: rawValue of: type [ ^ dictionary ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importObject: rawObject of: type [ self specialTypes @@ -141,7 +131,7 @@ FamixValuePharoJacksonImporter >> importObject: rawObject of: type [ ^ super importObject: rawObject of: type ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importSymbol: rawObject of: type [ ^ objectDict @@ -151,13 +141,23 @@ FamixValuePharoJacksonImporter >> importSymbol: rawObject of: type [ type: type) ] -{ #category : #importing } +{ #category : 'importing' } +FamixValuePharoJacksonImporter >> importTypeReference: rawValue of: type [ + "The type has already been loaded during the inference. + The raw value contains the fully qualified name of the referenced class." + + ^ self model newOfTypeReference + value: (self loadTypeNamed: (rawValue at: 'name')); + type: type +] + +{ #category : 'importing' } FamixValuePharoJacksonImporter >> importValue: rawValue [ ^ rawValue asPharoJacksonValueOn: self ] -{ #category : #initialization } +{ #category : 'initialization' } FamixValuePharoJacksonImporter >> initialize [ super initialize. @@ -165,33 +165,33 @@ FamixValuePharoJacksonImporter >> initialize [ closureSources := Dictionary new ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoJacksonImporter >> newReader [ ^ super newReader. "^ STONReader new acceptUnknownClasses: true" ] -{ #category : #parsing } +{ #category : 'parsing' } FamixValuePharoJacksonImporter >> parseList: serializedValues [ "Ignore first element which is the id of the array." ^ (super parseList: serializedValues) allButFirst ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> refKey [ ^ refKey ifNil: [ refKey := '@ref' ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> refKey: aString [ refKey := aString ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> specialTypes [ ^ specialTypes ifNil: [ @@ -231,13 +231,13 @@ FamixValuePharoJacksonImporter >> specialTypes [ specialTypes ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> typeKey [ ^ typeKey ifNil: [ typeKey := '@type' ] ] -{ #category : #accessing } +{ #category : 'accessing' } FamixValuePharoJacksonImporter >> typeKey: aString [ typeKey := aString diff --git a/src/Famix-Value-Importer/FamixValuePharoSTONImporter.class.st b/src/Famix-Value-Importer/FamixValuePharoSTONImporter.class.st index 12de6d2..ac7d2a8 100644 --- a/src/Famix-Value-Importer/FamixValuePharoSTONImporter.class.st +++ b/src/Famix-Value-Importer/FamixValuePharoSTONImporter.class.st @@ -1,16 +1,17 @@ Class { - #name : #FamixValuePharoSTONImporter, - #superclass : #FamixValueAbstractImporter, - #category : #'Famix-Value-Importer' + #name : 'FamixValuePharoSTONImporter', + #superclass : 'FamixValueAbstractImporter', + #category : 'Famix-Value-Importer', + #package : 'Famix-Value-Importer' } -{ #category : #enumerating } +{ #category : 'enumerating' } FamixValuePharoSTONImporter >> getObjectIdentity: rawObject [ ^ rawObject identityHash ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoSTONImporter >> importObject: rawObject of: type [ "STON objects are fully deserialized, so there is no way of knowing if an object has already been imported without remembering all objects. If a serialized object doesn't have its class loaded in the image, it is reified as a dictionary. @@ -30,13 +31,13 @@ FamixValuePharoSTONImporter >> importObject: rawObject of: type [ ^ super importObject: dictionary of: type ] -{ #category : #importing } +{ #category : 'importing' } FamixValuePharoSTONImporter >> importValue: rawValue [ ^ rawValue asPharoSTONValueOn: self ] -{ #category : #'private - utility' } +{ #category : 'private - utility' } FamixValuePharoSTONImporter >> newReader [ ^ STONReader new acceptUnknownClasses: true diff --git a/src/Famix-Value-Importer/FamixValueUnknownType.extension.st b/src/Famix-Value-Importer/FamixValueUnknownType.extension.st index 7b9f562..4139f21 100644 --- a/src/Famix-Value-Importer/FamixValueUnknownType.extension.st +++ b/src/Famix-Value-Importer/FamixValueUnknownType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #FamixValueUnknownType } +Extension { #name : 'FamixValueUnknownType' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } FamixValueUnknownType >> findAttributeNamed: attributeName [ Warning signal: diff --git a/src/Famix-Value-Importer/Float.extension.st b/src/Famix-Value-Importer/Float.extension.st index 86f6dbd..6e5a3cf 100644 --- a/src/Famix-Value-Importer/Float.extension.st +++ b/src/Famix-Value-Importer/Float.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Float } +Extension { #name : 'Float' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Float >> asJavaJacksonValueOn: importer [ ^ importer importPrimitive: self of: 'double' diff --git a/src/Famix-Value-Importer/Integer.extension.st b/src/Famix-Value-Importer/Integer.extension.st index 581dec5..c8d3071 100644 --- a/src/Famix-Value-Importer/Integer.extension.st +++ b/src/Famix-Value-Importer/Integer.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Integer } +Extension { #name : 'Integer' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Integer >> asJavaJacksonValueOn: importer [ | typeInference | diff --git a/src/Famix-Value-Importer/Number.extension.st b/src/Famix-Value-Importer/Number.extension.st index 2b0c786..179d846 100644 --- a/src/Famix-Value-Importer/Number.extension.st +++ b/src/Famix-Value-Importer/Number.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #Number } +Extension { #name : 'Number' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Number >> asPharoJacksonValueOn: importer [ ^ importer importPrimitive: self of: self className ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Number >> asPharoSTONValueOn: importer [ ^ importer importPrimitive: self of: self className diff --git a/src/Famix-Value-Importer/Object.extension.st b/src/Famix-Value-Importer/Object.extension.st index a092875..fa802a4 100644 --- a/src/Famix-Value-Importer/Object.extension.st +++ b/src/Famix-Value-Importer/Object.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Object } +Extension { #name : 'Object' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Object >> asPharoJacksonValueOn: importer [ ^ importer @@ -8,7 +8,7 @@ Object >> asPharoJacksonValueOn: importer [ of: (importer loadTypeNamed: self className) ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Object >> asPharoSTONValueOn: importer [ ^ importer diff --git a/src/Famix-Value-Importer/OrderedDictionary.extension.st b/src/Famix-Value-Importer/OrderedDictionary.extension.st index 3093c87..426a509 100644 --- a/src/Famix-Value-Importer/OrderedDictionary.extension.st +++ b/src/Famix-Value-Importer/OrderedDictionary.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #OrderedDictionary } +Extension { #name : 'OrderedDictionary' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } OrderedDictionary >> asJavaJacksonValueOn: importer [ | type | @@ -14,7 +14,7 @@ OrderedDictionary >> asJavaJacksonValueOn: importer [ ifFalse: [ importer importObject: self of: type ] ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } OrderedDictionary >> asPharoJacksonValueOn: importer [ ^ (importer getObjectType: self) @@ -22,7 +22,7 @@ OrderedDictionary >> asPharoJacksonValueOn: importer [ className = 'Class' ifTrue: [ importer - importClassReference: self + importTypeReference: self of: (importer loadTypeNamed: className) ] ifFalse: [ importer diff --git a/src/Famix-Value-Importer/RunArray.extension.st b/src/Famix-Value-Importer/RunArray.extension.st index 1a9c37c..210b843 100644 --- a/src/Famix-Value-Importer/RunArray.extension.st +++ b/src/Famix-Value-Importer/RunArray.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #RunArray } +Extension { #name : 'RunArray' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } RunArray >> asPharoJacksonValueOn: importer [ ^ importer @@ -8,7 +8,7 @@ RunArray >> asPharoJacksonValueOn: importer [ of: (importer loadTypeNamed: self className) ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } RunArray >> asPharoSTONValueOn: importer [ ^ importer diff --git a/src/Famix-Value-Importer/String.extension.st b/src/Famix-Value-Importer/String.extension.st index 8a86cd5..2aa74b3 100644 --- a/src/Famix-Value-Importer/String.extension.st +++ b/src/Famix-Value-Importer/String.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #String } +Extension { #name : 'String' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } String >> asJavaJacksonValueOn: importer [ | typeInference | typeInference := importer typeInference. ^ (typeInference isNotNil and: [ typeInference name = 'Class' ]) - ifTrue: [ importer importClassReference: self of: typeInference ] + ifTrue: [ importer importTypeReference: self of: typeInference ] ifFalse: [ "import regular string, escape special characters" importer importPrimitive: (self @@ -15,19 +15,19 @@ String >> asJavaJacksonValueOn: importer [ of: 'java.lang.String' ] ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } String >> asPharoJacksonValueOn: importer [ ^ importer importPrimitive: self of: self className ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } String >> asPharoSTONValueOn: importer [ ^ importer importPrimitive: self of: self className ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } String >> findClosing: close startingAt: startIndex [ "Assume the opening character is given at startIndex. Find the matching closing character, taking nesting into account." diff --git a/src/Famix-Value-Importer/Text.extension.st b/src/Famix-Value-Importer/Text.extension.st index 048fa08..6f728c6 100644 --- a/src/Famix-Value-Importer/Text.extension.st +++ b/src/Famix-Value-Importer/Text.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Text } +Extension { #name : 'Text' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Text >> asPharoJacksonValueOn: importer [ ^ importer @@ -8,7 +8,7 @@ Text >> asPharoJacksonValueOn: importer [ of: (importer loadTypeNamed: self className) ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } Text >> asPharoSTONValueOn: importer [ ^ importer diff --git a/src/Famix-Value-Importer/UndefinedObject.extension.st b/src/Famix-Value-Importer/UndefinedObject.extension.st index 70ee0a7..64e44a6 100644 --- a/src/Famix-Value-Importer/UndefinedObject.extension.st +++ b/src/Famix-Value-Importer/UndefinedObject.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #UndefinedObject } +Extension { #name : 'UndefinedObject' } -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } UndefinedObject >> asJavaJacksonValueOn: importer [ ^ importer model newOfUnknownType @@ -9,13 +9,13 @@ UndefinedObject >> asJavaJacksonValueOn: importer [ (importer typeInference ifNil: [ importer getDefaultUnknownType ]) ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } UndefinedObject >> asPharoJacksonValueOn: importer [ ^ importer importPrimitive: self of: self className ] -{ #category : #'*Famix-Value-Importer' } +{ #category : '*Famix-Value-Importer' } UndefinedObject >> asPharoSTONValueOn: importer [ ^ importer importPrimitive: self of: self className diff --git a/src/Famix-Value-Importer/package.st b/src/Famix-Value-Importer/package.st index a65ccd3..5bea594 100644 --- a/src/Famix-Value-Importer/package.st +++ b/src/Famix-Value-Importer/package.st @@ -1 +1 @@ -Package { #name : #'Famix-Value-Importer' } +Package { #name : 'Famix-Value-Importer' }