org.eclipse.emf.compare.util
Class EclipseModelUtils

java.lang.Object
  extended by org.eclipse.emf.compare.util.EclipseModelUtils

public final class EclipseModelUtils
extends java.lang.Object

Utility class for model loading/saving and serialization within Eclipse.

Since:
0.8

Method Summary
static org.eclipse.emf.ecore.EObject load(org.eclipse.core.resources.IFile file, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Loads a model from an IFile in a given ResourceSet.
static org.eclipse.emf.ecore.EObject load(org.eclipse.core.runtime.IPath path, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Loads a model from an IPath in a given ResourceSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public static org.eclipse.emf.ecore.EObject load(org.eclipse.core.resources.IFile file,
                                                 org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
                                          throws java.io.IOException
Loads a model from an IFile in a given ResourceSet.

This will return the first root of the loaded model, other roots can be accessed via the resource's content.

Parameters:
file - IFile containing the model to be loaded.
resourceSet - The ResourceSet to load the model in.
Returns:
The model loaded from the file.
Throws:
java.io.IOException - If the given file does not exist.

load

public static org.eclipse.emf.ecore.EObject load(org.eclipse.core.runtime.IPath path,
                                                 org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
                                          throws java.io.IOException
Loads a model from an IPath in a given ResourceSet.

This will return the first root of the loaded model, other roots can be accessed via the resource's content.

Parameters:
path - IPath where the model lies.
resourceSet - The ResourceSet to load the model in.
Returns:
The model loaded from the path.
Throws:
java.io.IOException - If the given file does not exist.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.