Package org.eclipse.emf.cdo.common.model
Class EMFUtil
java.lang.Object
org.eclipse.emf.cdo.common.model.EMFUtil
Various static helper methods for dealing with EMF meta models.
- Since:
- 2.0
- Author:
- Eike Stepper
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An extension ofResourceSetImpl
that allows demandLoading of resources and delegation of resource lookups, to be switched on/off as desired. -
Field Summary
Modifier and TypeFieldDescriptionstatic final org.eclipse.net4j.util.Predicate<EStructuralFeature>
Deprecated.static final String
static final String
static final org.eclipse.net4j.util.Predicate<EStructuralFeature>
Deprecated.As of 4.9 useEMFPredicates.CONTAINER_REFERENCES
.static final org.eclipse.net4j.util.Predicate<EStructuralFeature>
Deprecated.As of 4.9 useEMFPredicates.CONTAINMENT_REFERENCES
.static final org.eclipse.net4j.util.Predicate<EStructuralFeature>
Deprecated.As of 4.9 useEMFPredicates.CROSS_REFERENCES
.static final EReference
static final EReference
static final EAttribute
static final EAttribute
static final EReference
static final EReference
static final EReference
static final EReference
static final org.eclipse.net4j.util.Predicate<EStructuralFeature>
Deprecated.As of 4.9 useEMFPredicates.REFERENCES
. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 void
forAllConcreteClasses
(EPackage ePackage, boolean includeSubPackages, Consumer<EClass> consumer) static <T> T
getAdapter
(Notifier notifier, Class<T> type) static EPackage[]
getAllPackages
(EPackage ePackage) static EList<EAnnotation>
getAnnotations
(EClass eClass, String sourceURI) static EClass
getAnyConcreteEClass
(EPackage ePackage, boolean includeSubPackages) static EClass[]
getConcreteClasses
(EPackage ePackage) static EClass[]
getConcreteClasses
(EPackage ePackage, boolean includeSubPackages) 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) getSortedRegistryEntries
(EPackage.Registry packageRegistry) static EPackage
getTopLevelPackage
(EPackage ePackage) static boolean
isDynamicEPackage
(Object value) static boolean
isPersistent
(EStructuralFeature feature) Returnstrue
if CDO considers the given feature persistent,false
otherwise.static ResourceSet
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)
-
Field Details
-
CDO_ANNOTATION_SOURCE
- Since:
- 3.0
- See Also:
-
CDO_ANNOTATION_KEY_PERSISTENT
- Since:
- 3.0
- See Also:
-
EOPERATION_EEXCEPTIONS
- Since:
- 4.2
-
ETYPED_ELEMENT_ETYPE
- Since:
- 4.2
-
ECLASS_ESUPER_TYPES
- Since:
- 4.2
-
ECLASSIFIER_INSTANCE_CLASS_NAME
- Since:
- 4.2
-
EOPERATION_EGENERIC_EXCEPTIONS
- Since:
- 4.2
-
ETYPED_ELEMENT_EGENERIC_TYPE
- Since:
- 4.2
-
ECLASS_EGENERIC_SUPER_TYPES
- Since:
- 4.2
-
ECLASSIFIER_INSTANCE_TYPE_NAME
- Since:
- 4.2
-
ATTRIBUTES
Deprecated.As of 4.9 useEMFPredicates.ATTRIBUTES
.- Since:
- 4.2
-
REFERENCES
Deprecated.As of 4.9 useEMFPredicates.REFERENCES
.- Since:
- 4.2
-
CONTAINER_REFERENCES
@Deprecated public static final org.eclipse.net4j.util.Predicate<EStructuralFeature> CONTAINER_REFERENCESDeprecated.As of 4.9 useEMFPredicates.CONTAINER_REFERENCES
.- Since:
- 4.2
-
CROSS_REFERENCES
@Deprecated public static final org.eclipse.net4j.util.Predicate<EStructuralFeature> CROSS_REFERENCESDeprecated.As of 4.9 useEMFPredicates.CROSS_REFERENCES
.- Since:
- 4.2
-
CONTAINMENT_REFERENCES
@Deprecated public static final org.eclipse.net4j.util.Predicate<EStructuralFeature> CONTAINMENT_REFERENCESDeprecated.As of 4.9 useEMFPredicates.CONTAINMENT_REFERENCES
.- Since:
- 4.2
-
-
Method Details
-
getPositionalURI
- Since:
- 4.2
-
getGeneratedEPackage
-
getSortedRegistryEntries
public static Map.Entry<String,Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry) -
getAnnotations
- Since:
- 4.6
-
getTopLevelPackage
-
createEPackage
- Since:
- 2.0
-
createEClass
public static EClass createEClass(EPackage ePackage, String name, boolean isAbstract, boolean isInterface) - Since:
- 2.0
-
createEAttribute
- Since:
- 2.0
-
createEReference
public static EReference createEReference(EClass eClass, String name, EClassifier type, boolean isRequired, boolean isMany) - Since:
- 2.0
-
getConcreteClasses
- Since:
- 4.2
-
getConcreteClasses
- Since:
- 4.10
-
forAllConcreteClasses
public static void forAllConcreteClasses(EPackage ePackage, boolean includeSubPackages, Consumer<EClass> consumer) - Since:
- 4.10
-
getAnyConcreteEClass
- Since:
- 4.13
-
getPersistentClasses
-
getPersistentFeatures
@Deprecated public static List<EStructuralFeature> getPersistentFeatures(EList<EStructuralFeature> eFeatures) Deprecated.This method is expensive and will be removed in the future.- Since:
- 3.0
- See Also:
-
isPersistent
Returnstrue
if CDO considers the given feature persistent,false
otherwise.Note that CDO persistent is not identical to
non-transient
because that can be overridden withCDO_ANNOTATION_KEY_PERSISTENT
. Another reason for possible deviations is that CDO considers transientreferences
persistent if they have a persistentopposite
.Note also that the checks for the aforementioned deviations from
EStructuralFeature.isTransient()
make this method somewhat expensive. Whenever possibleCDOClassInfo.isPersistent()
should be called instead.- Since:
- 3.0
-
isDynamicEPackage
-
getParentURI
-
registerPackage
-
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
-
getAdapter
- Since:
- 4.2
-
addAdapter
-
getAllPackages
-
getQualifiedName
-
getQualifiedName
-
newResourceSet
-
newEcoreResourceSet
-
newEcoreResourceSet
-
safeResolve
- Since:
- 3.0
-
safeResolveAll
- Since:
- 3.0
-
createExtResourceSet
public static EMFUtil.ExtResourceSet createExtResourceSet(InternalCDOPackageRegistry packageRegistry, boolean delegating, boolean demandLoading) - Since:
- 4.0
- See Also:
-
EMFPredicates.ATTRIBUTES
.