Class EMFHelper
- java.lang.Object
-
- org.palladiosimulator.reliability.helper.EMFHelper
-
public class EMFHelper extends Object
Provides utility functions for EMF models.
-
-
Constructor Summary
Constructors Constructor Description EMFHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EList<EObject>getElements(EObject root, EClass type)Retrieves all model elements of a given EMF type under some root element.static EObjectloadFromXMIFile(String fileName)static EObjectloadFromXMIFile(String fileName, String eNamespaceURI, EPackage ePackage)static voidsaveToXMIFile(EObject modelToSave, String fileName)Save the given EObject to the file given by filename.
-
-
-
Method Detail
-
getElements
public EList<EObject> getElements(EObject root, EClass type)
Retrieves all model elements of a given EMF type under some root element.- Parameters:
root- the root elementtype- the type of objects to find- Returns:
- all objects of the given type or a sub type
-
saveToXMIFile
public static void saveToXMIFile(EObject modelToSave, String fileName)
Save the given EObject to the file given by filename.- Parameters:
modelToSave- The EObject to savefileName- The filename where to save.
-
loadFromXMIFile
public static EObject loadFromXMIFile(String fileName, String eNamespaceURI, EPackage ePackage)
- Parameters:
fileName-eNamespaceURI-ePackage-- Returns:
-
-