de.tu_berlin.cs.tfs.muvitorkit.ui.utils
Class EMFModelManager

java.lang.Object
  extended by de.tu_berlin.cs.tfs.muvitorkit.ui.utils.EMFModelManager

public class EMFModelManager
extends Object

Manager for persistence operations on an EMF model.

Rating red

Constructor Summary
EMFModelManager(String extension)
          This constructor initializes the EMF model package and registers a file extension.
 
Method Summary
 List<EObject> load(IPath path, List<EObject> defaultModels)
          Loads the model from the file.
 void save(IPath path)
          Saves the content of the model to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EMFModelManager

public EMFModelManager(String extension)
This constructor initializes the EMF model package and registers a file extension.

Parameters:
extension - The file extension
Method Detail

load

public List<EObject> load(IPath path,
                          List<EObject> defaultModels)
Loads the model from the file. It this fails then the passed list of default models will be set in the resource for saving later with save(IPath). Return the loaded or the default models, respectively.

Parameters:
path - A IPath to a file containing a Resource.
defaultModels - a list of default models to use when loading fails
Returns:
the loaded models or the default models

save

public void save(IPath path)
          throws IOException
Saves the content of the model to the file.

Throws:
IOException