public class AnnotationHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
AKA_TAG
Tag used for the annotation of the a.k.a. found elements
This annotation allows tracking the set of names used for an attribute/reference/class
|
private static java.lang.String |
COVERAGE_TAG
Tag used for referring to the coverage
The value indicates the number of clases including such attribute/reference
|
private static java.lang.String |
FOUND_IN_TAG
Tag used to keep track on where an elements has been found
|
static AnnotationHelper |
INSTANCE
AnnotationHelper is used as singleton, this is the instance |
private static java.lang.String |
RATIO_TOTAL_FOUND_TAG
Tag used for the annotation related to the ratio of total found
This value is the ratio version of the
TOTAL_FOUND_TAG |
private static java.lang.String |
SOURCE_NAME_TAG
Tag used to keep track of which source the element has been found
|
private static java.lang.String |
TOTAL_FOUND_TAG
Tag used for the total number of found elements
Added to each attribute/reference to count the times it has been found
|
Modifier | Constructor and Description |
---|---|
private |
AnnotationHelper()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateCoverage(org.eclipse.emf.ecore.EPackage ePackage)
Calculate the value for the annotation
RATIO_TOTAL_FOUND_TAG . |
org.eclipse.emf.ecore.EPackage |
cleanAnnotations(org.eclipse.emf.ecore.EPackage ePackage)
Remove all the annotations.
|
java.util.List<java.lang.String> |
getAka(org.eclipse.emf.ecore.EModelElement modelElement)
Obtains the list of
String s with all the a.k.a. values for a EModelElement |
org.eclipse.emf.ecore.EAnnotation |
getAkaAnnotation(org.eclipse.emf.ecore.EModelElement modelElement)
Access to the annotation for
AKA_TAG . |
org.eclipse.emf.ecore.EAnnotation |
getCoverageAnnotation(org.eclipse.emf.ecore.EModelElement modelElement)
Access to the annotation for
COVERAGE_TAG . |
org.eclipse.emf.ecore.EAnnotation |
getFoundInAnnotation(org.eclipse.emf.ecore.EModelElement modelElement)
Access to the annotation for
FOUND_IN_TAG . |
double |
getRatioTotalFound(org.eclipse.emf.ecore.EModelElement modelElement)
Access to the annotation for
RATIO_TOTAL_FOUND_TAG . |
java.lang.String |
getSourceName(org.eclipse.emf.ecore.EClass modelElement)
Obtains the value of the
SOURCE_NAME_TAG tag, which keeps track of the
name of the JSON source |
int |
getTotalFound(org.eclipse.emf.ecore.EModelElement modelElement)
Access to the annotation for
TOTAL_FOUND_TAG . |
void |
increaseTotalFound(org.eclipse.emf.ecore.EModelElement modelElement)
Accesses to the annotation for
TOTAL_FOUND_TAG and increases it. |
void |
registerInclusion(org.eclipse.emf.ecore.EModelElement modelElement,
java.lang.String name)
Keeps track of where an attribute/reference has been found
This situation arises when two classes have been merged and therefore their attributes as well.
|
void |
registerName(org.eclipse.emf.ecore.EModelElement modelElement,
java.lang.String name)
Register a new name for a
EModelElement . |
void |
registerSourceName(org.eclipse.emf.ecore.EClass modelElement,
java.lang.String name)
Set the value for the
SOURCE_NAME_TAG tag, which keeps track of the
name of the JSON source |
public static AnnotationHelper INSTANCE
AnnotationHelper
is used as singleton, this is the instanceprivate static final java.lang.String TOTAL_FOUND_TAG
Added to each attribute/reference to count the times it has been found
private static final java.lang.String COVERAGE_TAG
The value indicates the number of clases including such attribute/reference
private static final java.lang.String RATIO_TOTAL_FOUND_TAG
This value is the ratio version of the TOTAL_FOUND_TAG
private static final java.lang.String AKA_TAG
This annotation allows tracking the set of names used for an attribute/reference/class
private static final java.lang.String FOUND_IN_TAG
private static final java.lang.String SOURCE_NAME_TAG
private AnnotationHelper()
public org.eclipse.emf.ecore.EAnnotation getCoverageAnnotation(org.eclipse.emf.ecore.EModelElement modelElement)
COVERAGE_TAG
. To be edited afterwards.modelElement
- The model element from which the annotation has to be retrievedEAnnotation
elementpublic org.eclipse.emf.ecore.EAnnotation getFoundInAnnotation(org.eclipse.emf.ecore.EModelElement modelElement)
FOUND_IN_TAG
. To be edited afterwards.modelElement
- The model element from which the annotation has to be retrievedEAnnotation
elementpublic org.eclipse.emf.ecore.EAnnotation getAkaAnnotation(org.eclipse.emf.ecore.EModelElement modelElement)
AKA_TAG
. To be edited afterwards.modelElement
- The model element from which the annotation has to be retrievedEAnnotation
elementpublic void increaseTotalFound(org.eclipse.emf.ecore.EModelElement modelElement)
TOTAL_FOUND_TAG
and increases it.modelElement
- The model element from which the annotation has to be retrievedpublic void calculateCoverage(org.eclipse.emf.ecore.EPackage ePackage)
RATIO_TOTAL_FOUND_TAG
.ePackage
- The model element from which the annotation has to be retrievedpublic void registerInclusion(org.eclipse.emf.ecore.EModelElement modelElement, java.lang.String name)
This situation arises when two classes have been merged and therefore their attributes as well. To keep track of from where each atribute is coming, the tag indicates the name of the origin class
modelElement
- The model element from which the annotation has to be retrievedname
- The name of the containing classpublic void registerName(org.eclipse.emf.ecore.EModelElement modelElement, java.lang.String name)
EModelElement
.
This is used when, in a discovery process, two clases/attributes/references are considered similar and merged. This tag helps keeping track of all the names of the model element.
modelElement
- The model element from which the annotation has to be retrievedname
- The extra name of the elementpublic int getTotalFound(org.eclipse.emf.ecore.EModelElement modelElement)
TOTAL_FOUND_TAG
. To be edited afterwards.modelElement
- The model element from which the annotation has to be retrievedEAnnotation
elementpublic double getRatioTotalFound(org.eclipse.emf.ecore.EModelElement modelElement)
RATIO_TOTAL_FOUND_TAG
. To be edited afterwards.modelElement
- The model element from which the annotation has to be retrievedEAnnotation
elementpublic java.util.List<java.lang.String> getAka(org.eclipse.emf.ecore.EModelElement modelElement)
String
s with all the a.k.a. values for a EModelElement
modelElement
- The model element to queryString
spublic void registerSourceName(org.eclipse.emf.ecore.EClass modelElement, java.lang.String name)
SOURCE_NAME_TAG
tag, which keeps track of the
name of the JSON sourcemodelElement
- The model element to setname
- The name of the JSON sourcepublic java.lang.String getSourceName(org.eclipse.emf.ecore.EClass modelElement)
SOURCE_NAME_TAG
tag, which keeps track of the
name of the JSON sourcemodelElement
- The model element to setSOURCE_NAME_TAG
tagpublic org.eclipse.emf.ecore.EPackage cleanAnnotations(org.eclipse.emf.ecore.EPackage ePackage)
ePackage
- The metamodel to clean (as EPackage
EPackage