org.eclipse.xtend.typesystem.emf
Class EcoreUtil2

java.lang.Object
  extended by org.eclipse.xtend.typesystem.emf.EcoreUtil2

public class EcoreUtil2
extends java.lang.Object

Provides useful functions for usage of EMF.

Since:
4.0

Constructor Summary
EcoreUtil2()
           
 
Method Summary
static java.util.Collection<org.eclipse.emf.ecore.EObject> allContents(org.eclipse.emf.ecore.EObject modelElement)
           
static java.util.List clone(org.eclipse.emf.common.util.EList list)
          Clones a list.
static java.util.Set<org.eclipse.emf.ecore.EObject> findAllByType(java.util.Iterator<?> iter, java.lang.Class<?> type)
          Finds all elements within a collection of a specific type.
static org.eclipse.emf.ecore.EPackage getEPackage(java.lang.String pathToEcoreFile)
           
static org.eclipse.emf.ecore.EPackage getEPackageByClassName(java.lang.String ePackage)
          Finds an EMF EPackage instance by its class name.
static org.eclipse.emf.ecore.EPackage getEPackageByDescriptorClassName(java.lang.String ePackageDescriptor)
          Finds an EPackage by the class name of the Package Descriptor.
static org.eclipse.emf.common.util.URI getURI(java.lang.String file)
          Creates an URI from a file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EcoreUtil2

public EcoreUtil2()
Method Detail

getEPackage

public static final org.eclipse.emf.ecore.EPackage getEPackage(java.lang.String pathToEcoreFile)

findAllByType

public static java.util.Set<org.eclipse.emf.ecore.EObject> findAllByType(java.util.Iterator<?> iter,
                                                                         java.lang.Class<?> type)
Finds all elements within a collection of a specific type.

Parameters:
iter - An iterator over the source collection.
type - The type which should be selected.
Returns:
A set with all elements of the specified type.

clone

public static java.util.List clone(org.eclipse.emf.common.util.EList list)
Clones a list.

Parameters:
list - The list that should be cloned.
Returns:
A copy of the original list

getEPackageByClassName

public static org.eclipse.emf.ecore.EPackage getEPackageByClassName(java.lang.String ePackage)
                                                             throws org.eclipse.emf.mwe.core.ConfigurationException
Finds an EMF EPackage instance by its class name. The EPackage class must be loadable by the ResourceLoader

Parameters:
ePackage - The class name of the EPackage interface
Returns:
The EPackage instance. Returns null if any exception occurs after the class was successfully loaded.
Throws:
org.eclipse.emf.mwe.core.ConfigurationException - If the class specified by ePackage cannot be loaded.

getEPackageByDescriptorClassName

public static org.eclipse.emf.ecore.EPackage getEPackageByDescriptorClassName(java.lang.String ePackageDescriptor)
Finds an EPackage by the class name of the Package Descriptor.

Parameters:
ePackageDescriptor - The Package Descriptor's classname
Returns:
The EPackage instance. Returns null on any exception occuring while retrieval.

getURI

public static org.eclipse.emf.common.util.URI getURI(java.lang.String file)
Creates an URI from a file name.

Parameters:
file - The file's path
Returns:
The URI representing the file

allContents

public static java.util.Collection<org.eclipse.emf.ecore.EObject> allContents(org.eclipse.emf.ecore.EObject modelElement)