org.milyn.ect.ecore
Class ECoreConversionUtils

java.lang.Object
  extended by org.milyn.ect.ecore.ECoreConversionUtils

public class ECoreConversionUtils
extends Object

Utility class that convert EDI model to ECore model elements

Author:
zubairov

Constructor Summary
ECoreConversionUtils()
           
 
Method Summary
static org.eclipse.emf.ecore.EClass createDocumentRoot(org.eclipse.emf.ecore.EClass rootClass)
          Creates a droot root class
static org.eclipse.emf.ecore.EAttribute fieldToEAttribute(Field field)
          Converting a Field to EAttribute Works only for Field where Field.getComponents() is empty
static org.eclipse.emf.ecore.EReference fieldToEReference(Field field, Map<String,org.eclipse.emf.ecore.EClass> classes)
          This method creates a new EReference to the Field that contains multiple Component.
static org.eclipse.emf.ecore.EPackage mappingModelToEPackage(Edimap mapModel)
          This method transforms Edimap to EPackage where classes related to this Edimap will be stored
static org.eclipse.emf.ecore.EClass segmentGroupToEClass(SegmentGroup grp)
          Converting SegmentGroup to EClass
static org.eclipse.emf.ecore.EReference segmentGroupToEReference(SegmentGroup grp, org.eclipse.emf.ecore.EClass refClass)
          Convert SegmentGroup into EReference to the given EClass
static org.eclipse.emf.ecore.EClass segmentToEClass(Segment segment)
          Converting Segment to EClass
static org.eclipse.emf.ecore.EReference segmentToEReference(Segment segment, org.eclipse.emf.ecore.EClass refClass)
          Converts Segment to EReference
static String toJavaName(String name, boolean className)
          Convert tricky names to JavaNames with CamelCase etc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECoreConversionUtils

public ECoreConversionUtils()
Method Detail

segmentToEClass

public static org.eclipse.emf.ecore.EClass segmentToEClass(Segment segment)
Converting Segment to EClass

Parameters:
segment -
Returns:

mappingModelToEPackage

public static org.eclipse.emf.ecore.EPackage mappingModelToEPackage(Edimap mapModel)
This method transforms Edimap to EPackage where classes related to this Edimap will be stored

Parameters:
mapModel -
Returns:

segmentToEReference

public static org.eclipse.emf.ecore.EReference segmentToEReference(Segment segment,
                                                                   org.eclipse.emf.ecore.EClass refClass)
Converts Segment to EReference

Parameters:
segment -
refClass -
Returns:

segmentGroupToEClass

public static org.eclipse.emf.ecore.EClass segmentGroupToEClass(SegmentGroup grp)
Converting SegmentGroup to EClass

Parameters:
grp -
Returns:

segmentGroupToEReference

public static org.eclipse.emf.ecore.EReference segmentGroupToEReference(SegmentGroup grp,
                                                                        org.eclipse.emf.ecore.EClass refClass)
Convert SegmentGroup into EReference to the given EClass

Parameters:
grp -
refClass -
Returns:

fieldToEAttribute

public static org.eclipse.emf.ecore.EAttribute fieldToEAttribute(Field field)
Converting a Field to EAttribute Works only for Field where Field.getComponents() is empty

Parameters:
field -
Returns:

fieldToEReference

public static org.eclipse.emf.ecore.EReference fieldToEReference(Field field,
                                                                 Map<String,org.eclipse.emf.ecore.EClass> classes)
This method creates a new EReference to the Field that contains multiple Component. For that purpose new EClass will be created and EReference will refer to it

Parameters:
field -
classes -
Returns:

toJavaName

public static String toJavaName(String name,
                                boolean className)
Convert tricky names to JavaNames with CamelCase etc

Parameters:
name -
Returns:

createDocumentRoot

public static org.eclipse.emf.ecore.EClass createDocumentRoot(org.eclipse.emf.ecore.EClass rootClass)
Creates a droot root class

Parameters:
rootClass -
Returns:


Copyright © 2014. All Rights Reserved.