org.eclipse.emf.cdo.common.model
Class EMFUtil

java.lang.Object
  extended by org.eclipse.emf.cdo.common.model.EMFUtil

public final class EMFUtil
extends Object

Various static helper methods for dealing with EMF meta models.

Since:
2.0

Nested Class Summary
static class EMFUtil.ExtResourceSet
          An extension of ResourceSetImpl that allows demandLoading of resources and delegation of resource lookups, to be switched on/off as desired.
 
Field Summary
static String CDO_ANNOTATION_KEY_PERSISTENT
           
static String CDO_ANNOTATION_SOURCE
           
 
Method Summary
static void addAdapter(Notifier notifier, Adapter adapter)
           
static EAttribute createEAttribute(EClass eClass, String name, EClassifier type)
           
static EClass createEClass(EPackage ePackage, String name, boolean isAbstract, boolean isInterface)
           
static EPackage createEPackage(String uri, byte[] bytes, boolean zipped, ResourceSet resourceSet, boolean lookForResource)
           
static EPackage createEPackage(String name, String nsPrefix, String nsURI)
           
static EReference createEReference(EClass eClass, String name, EClassifier type, boolean isRequired, boolean isMany)
           
static EMFUtil.ExtResourceSet createExtResourceSet(InternalCDOPackageRegistry packageRegistry, boolean delegating, boolean demandLoading)
           
static EPackage[] getAllPackages(EPackage ePackage)
           
static byte[] getEPackageBytes(EPackage ePackage, boolean zipped, EPackage.Registry packageRegistry)
           
static EPackage getGeneratedEPackage(EPackage ePackage)
           
static String getParentURI(EPackage ePackage)
           
static EClass[] getPersistentClasses(EPackage ePackage)
           
static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures)
           
static String getQualifiedName(EClassifier classifier, String separator)
           
static String getQualifiedName(EPackage ePackage, String separator)
           
static Map.Entry<String,Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry)
           
static EPackage getTopLevelPackage(EPackage ePackage)
           
static boolean isDynamicEPackage(Object value)
           
static boolean isPersistent(EStructuralFeature feature)
           
static ResourceSet newEcoreResourceSet()
           
static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
           
static ResourceSet newResourceSet(Resource.Factory resourceFactory)
           
static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
           
static EObject safeResolve(EObject proxy, ResourceSet resourceSet)
           
static void safeResolveAll(ResourceSet resourceSet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CDO_ANNOTATION_SOURCE

public static final String CDO_ANNOTATION_SOURCE
Since:
3.0
See Also:
Constant Field Values

CDO_ANNOTATION_KEY_PERSISTENT

public static final String CDO_ANNOTATION_KEY_PERSISTENT
Since:
3.0
See Also:
Constant Field Values
Method Detail

getGeneratedEPackage

public static EPackage getGeneratedEPackage(EPackage ePackage)

getSortedRegistryEntries

public static Map.Entry<String,Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry)

getTopLevelPackage

public static EPackage getTopLevelPackage(EPackage ePackage)

createEPackage

public static EPackage createEPackage(String name,
                                      String nsPrefix,
                                      String nsURI)
Since:
2.0

createEClass

public static EClass createEClass(EPackage ePackage,
                                  String name,
                                  boolean isAbstract,
                                  boolean isInterface)
Since:
2.0

createEAttribute

public static EAttribute createEAttribute(EClass eClass,
                                          String name,
                                          EClassifier type)
Since:
2.0

createEReference

public static EReference createEReference(EClass eClass,
                                          String name,
                                          EClassifier type,
                                          boolean isRequired,
                                          boolean isMany)
Since:
2.0

getPersistentClasses

public static EClass[] getPersistentClasses(EPackage ePackage)

getPersistentFeatures

public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures)
Since:
3.0

isPersistent

public static boolean isPersistent(EStructuralFeature feature)
Since:
3.0

isDynamicEPackage

public static boolean isDynamicEPackage(Object value)

getParentURI

public static String getParentURI(EPackage ePackage)

registerPackage

public static void registerPackage(EPackage ePackage,
                                   EPackage.Registry... packageRegistries)

getEPackageBytes

public static byte[] getEPackageBytes(EPackage ePackage,
                                      boolean zipped,
                                      EPackage.Registry packageRegistry)

createEPackage

public static EPackage createEPackage(String uri,
                                      byte[] bytes,
                                      boolean zipped,
                                      ResourceSet resourceSet,
                                      boolean lookForResource)
Since:
3.0

addAdapter

public static void addAdapter(Notifier notifier,
                              Adapter adapter)

getAllPackages

public static EPackage[] getAllPackages(EPackage ePackage)

getQualifiedName

public static String getQualifiedName(EPackage ePackage,
                                      String separator)

getQualifiedName

public static String getQualifiedName(EClassifier classifier,
                                      String separator)

newResourceSet

public static ResourceSet newResourceSet(Resource.Factory resourceFactory)

newEcoreResourceSet

public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)

newEcoreResourceSet

public static ResourceSet newEcoreResourceSet()

safeResolve

public static EObject safeResolve(EObject proxy,
                                  ResourceSet resourceSet)
Since:
3.0

safeResolveAll

public static void safeResolveAll(ResourceSet resourceSet)
Since:
3.0

createExtResourceSet

public static EMFUtil.ExtResourceSet createExtResourceSet(InternalCDOPackageRegistry packageRegistry,
                                                          boolean delegating,
                                                          boolean demandLoading)
Since:
4.0
See Also:
EMFUtil.ExtResourceSet


Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.