public class JsonComposer
extends java.lang.Object
 Although some of the calculations done here could be applied in a more-general process 
 of composing any ecore model, the current implementation is coupled to the data/structure 
 of the ecore models discovered by the JsonAdvancedDiscoverer. 
 
 In the context of the JSON discoverer, the JsonComposer is used to
 discover the metamodel out of a set of JSON-based APIs
 
| Modifier and Type | Field and Description | 
|---|---|
| private static double | ATTRIBUTE_MATCHING_THRESHOLDThreshold to consider when two attributes. | 
| private static double | CLASS_MATCHING_THRESHOLDThreshold to consider when two metamodel classes are similar. | 
| private static java.util.logging.Logger | LOGGERUsed to log all the activity | 
| private java.util.List<JsonSourceSet> | sourceSetsThe set of  JsonSourceSets to use in the discovery process | 
| Constructor and Description | 
|---|
| JsonComposer(java.util.List<JsonSourceSet> sourceSets)Constructs a new  JsonComposerwith a list ofJsonSourceSets | 
| Modifier and Type | Method and Description | 
|---|---|
| org.eclipse.emf.ecore.EPackage | compose()Compose the sourceSet's received in the constructor and returns the composed metamodel. | 
| org.eclipse.emf.ecore.EPackage | compose(java.io.File resultPath)Compose the sourceSet's received in the constructor and returns the composed metamodel. | 
| private boolean | isSimilar(org.eclipse.emf.ecore.EClass sourceEClass,
         org.eclipse.emf.ecore.EClass targetEClass)Compares if two metamodel classes (as  EClasselements) are similar. | 
| private boolean | nameIsSimilar(java.util.List<java.lang.String> sourceNames,
             java.util.List<java.lang.String> targetNames)Compares two list of  Stringand returns true when two similarStrings
 are found. | 
private java.util.List<JsonSourceSet> sourceSets
JsonSourceSets to use in the discovery processprivate static final java.util.logging.Logger LOGGER
private static final double ATTRIBUTE_MATCHING_THRESHOLD
To calculate the ratio, the number of matching attributes in the two metamodel classes are compared. Thus, two metamodel classes with matching attributes will give a ratio of 1
private static final double CLASS_MATCHING_THRESHOLD
To calculate the ratio, the number of matching attributes/refereces in the two metamodel classes are compared. Thus, two metamodel classes with matching attributes/references will give a ratio of 1
public JsonComposer(java.util.List<JsonSourceSet> sourceSets)
JsonComposer with a list of JsonSourceSetssourceSets - A list of JsonSourceSetspublic org.eclipse.emf.ecore.EPackage compose(java.io.File resultPath)
                                       throws java.io.FileNotFoundException
resultPath - The path where the resulting metamodel will be storedjava.io.FileNotFoundException - There is no file to read frompublic org.eclipse.emf.ecore.EPackage compose()
private boolean isSimilar(org.eclipse.emf.ecore.EClass sourceEClass,
                          org.eclipse.emf.ecore.EClass targetEClass)
EClass elements) are similar. 
 
 The comparison takes into consideration the names of attributes/refrences and counts 
 the ones that are similar. The ratio of similar vs. different is calculated and if it higher
 that ATTRIBUTE_MATCHING_THRESHOLD, the two classes are considered similar
sourceEClass - The source EClasstargetEClass - The target EClassprivate boolean nameIsSimilar(java.util.List<java.lang.String> sourceNames,
                              java.util.List<java.lang.String> targetNames)
String and returns true when two similar Strings
 are found.sourceNames - Source list of StringtargetNames - Target list of StringStrings (one in each list) are found.