public final class EMFUtil extends Object
Modifier and Type | Class and Description |
---|---|
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. |
Modifier and Type | Field and Description |
---|---|
static Predicate<EStructuralFeature> |
ATTRIBUTES |
static String |
CDO_ANNOTATION_KEY_PERSISTENT |
static String |
CDO_ANNOTATION_SOURCE |
static Predicate<EStructuralFeature> |
CONTAINER_REFERENCES |
static Predicate<EStructuralFeature> |
CONTAINMENT_REFERENCES |
static Predicate<EStructuralFeature> |
CROSS_REFERENCES |
static EReference |
ECLASS_EGENERIC_SUPER_TYPES |
static EReference |
ECLASS_ESUPER_TYPES |
static EAttribute |
ECLASSIFIER_INSTANCE_CLASS_NAME |
static EAttribute |
ECLASSIFIER_INSTANCE_TYPE_NAME |
static EReference |
EOPERATION_EEXCEPTIONS |
static EReference |
EOPERATION_EGENERIC_EXCEPTIONS |
static EReference |
ETYPED_ELEMENT_EGENERIC_TYPE |
static EReference |
ETYPED_ELEMENT_ETYPE |
static Predicate<EStructuralFeature> |
REFERENCES |
Modifier and Type | Method and Description |
---|---|
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 <T> T |
getAdapter(Notifier notifier,
Class<T> type) |
static EPackage[] |
getAllPackages(EPackage ePackage) |
static EClass[] |
getConcreteClasses(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)
Deprecated.
This method is expensive and will be removed in the future.
|
static URI |
getPositionalURI(InternalEObject internalEObject) |
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)
Returns
true if CDO considers the given feature persistent, false otherwise. |
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) |
public static final String CDO_ANNOTATION_SOURCE
public static final String CDO_ANNOTATION_KEY_PERSISTENT
public static final EReference EOPERATION_EEXCEPTIONS
public static final EReference ETYPED_ELEMENT_ETYPE
public static final EReference ECLASS_ESUPER_TYPES
public static final EAttribute ECLASSIFIER_INSTANCE_CLASS_NAME
public static final EReference EOPERATION_EGENERIC_EXCEPTIONS
public static final EReference ETYPED_ELEMENT_EGENERIC_TYPE
public static final EReference ECLASS_EGENERIC_SUPER_TYPES
public static final EAttribute ECLASSIFIER_INSTANCE_TYPE_NAME
public static final Predicate<EStructuralFeature> ATTRIBUTES
public static final Predicate<EStructuralFeature> REFERENCES
public static final Predicate<EStructuralFeature> CONTAINER_REFERENCES
public static final Predicate<EStructuralFeature> CROSS_REFERENCES
public static final Predicate<EStructuralFeature> CONTAINMENT_REFERENCES
public static URI getPositionalURI(InternalEObject internalEObject)
public static Map.Entry<String,Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry)
public static EPackage createEPackage(String name, String nsPrefix, String nsURI)
public static EClass createEClass(EPackage ePackage, String name, boolean isAbstract, boolean isInterface)
public static EAttribute createEAttribute(EClass eClass, String name, EClassifier type)
public static EReference createEReference(EClass eClass, String name, EClassifier type, boolean isRequired, boolean isMany)
@Deprecated public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures)
isPersistent(EStructuralFeature)
public static boolean isPersistent(EStructuralFeature feature)
true
if CDO considers the given feature persistent, false
otherwise.
Note that CDO persistent is not identical to non-transient
because that can be
overridden with CDO_ANNOTATION_KEY_PERSISTENT
. Another reason for possible deviations is that CDO considers transient
references
persistent if they have a persistent opposite
.
Note also that the checks for the aforementioned deviations from EStructuralFeature.isTransient()
make this method somewhat
expensive. Whenever possible CDOClassInfo.isPersistent()
should be called instead.
public static boolean isDynamicEPackage(Object value)
public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
public static byte[] getEPackageBytes(EPackage ePackage, boolean zipped, EPackage.Registry packageRegistry)
public static EPackage createEPackage(String uri, byte[] bytes, boolean zipped, ResourceSet resourceSet, boolean lookForResource)
public static String getQualifiedName(EClassifier classifier, String separator)
public static ResourceSet newResourceSet(Resource.Factory resourceFactory)
public static ResourceSet newEcoreResourceSet(EPackage.Registry packageRegistry)
public static ResourceSet newEcoreResourceSet()
public static EObject safeResolve(EObject proxy, ResourceSet resourceSet)
public static void safeResolveAll(ResourceSet resourceSet)
public static EMFUtil.ExtResourceSet createExtResourceSet(InternalCDOPackageRegistry packageRegistry, boolean delegating, boolean demandLoading)
EMFUtil.ExtResourceSet
Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.