public final class EMFUtil
extends java.lang.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 | Method and Description |
---|---|
static void |
addAdapter(Notifier notifier,
Adapter adapter) |
static EAttribute |
createEAttribute(EClass eClass,
java.lang.String name,
EClassifier type) |
static EClass |
createEClass(EPackage ePackage,
java.lang.String name,
boolean isAbstract,
boolean isInterface) |
static EPackage |
createEPackage(java.lang.String uri,
byte[] bytes,
boolean zipped,
ResourceSet resourceSet,
boolean lookForResource) |
static EPackage |
createEPackage(java.lang.String name,
java.lang.String nsPrefix,
java.lang.String nsURI) |
static EReference |
createEReference(EClass eClass,
java.lang.String name,
EClassifier type,
boolean isRequired,
boolean isMany) |
static EMFUtil.ExtResourceSet |
createExtResourceSet(InternalCDOPackageRegistry packageRegistry,
boolean delegating,
boolean demandLoading) |
static <T> T |
getAdapter(Notifier notifier,
java.lang.Class<T> type) |
static EPackage[] |
getAllPackages(EPackage ePackage) |
static EList<EAnnotation> |
getAnnotations(EClass eClass,
java.lang.String sourceURI) |
static EClass[] |
getConcreteClasses(EPackage ePackage) |
static byte[] |
getEPackageBytes(EPackage ePackage,
boolean zipped,
EPackage.Registry packageRegistry) |
static EPackage |
getGeneratedEPackage(EPackage ePackage) |
static java.lang.String |
getParentURI(EPackage ePackage) |
static EClass[] |
getPersistentClasses(EPackage ePackage) |
static java.util.List<EStructuralFeature> |
getPersistentFeatures(EList<EStructuralFeature> eFeatures)
Deprecated.
This method is expensive and will be removed in the future.
|
static URI |
getPositionalURI(InternalEObject internalEObject) |
static java.lang.String |
getQualifiedName(EClassifier classifier,
java.lang.String separator) |
static java.lang.String |
getQualifiedName(EPackage ePackage,
java.lang.String separator) |
static java.util.Map.Entry<java.lang.String,java.lang.Object>[] |
getSortedRegistryEntries(EPackage.Registry packageRegistry) |
static EPackage |
getTopLevelPackage(EPackage ePackage) |
static boolean |
isDynamicEPackage(java.lang.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 java.lang.String CDO_ANNOTATION_SOURCE
public static final java.lang.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
@Deprecated public static final Predicate<EStructuralFeature> ATTRIBUTES
EMFPredicates.ATTRIBUTES
.@Deprecated public static final Predicate<EStructuralFeature> REFERENCES
EMFPredicates.REFERENCES
.@Deprecated public static final Predicate<EStructuralFeature> CONTAINER_REFERENCES
EMFPredicates.CONTAINER_REFERENCES
.@Deprecated public static final Predicate<EStructuralFeature> CROSS_REFERENCES
EMFPredicates.CROSS_REFERENCES
.@Deprecated public static final Predicate<EStructuralFeature> CONTAINMENT_REFERENCES
EMFPredicates.CONTAINMENT_REFERENCES
.public static URI getPositionalURI(InternalEObject internalEObject)
public static java.util.Map.Entry<java.lang.String,java.lang.Object>[] getSortedRegistryEntries(EPackage.Registry packageRegistry)
public static EList<EAnnotation> getAnnotations(EClass eClass, java.lang.String sourceURI)
public static EPackage createEPackage(java.lang.String name, java.lang.String nsPrefix, java.lang.String nsURI)
public static EClass createEClass(EPackage ePackage, java.lang.String name, boolean isAbstract, boolean isInterface)
public static EAttribute createEAttribute(EClass eClass, java.lang.String name, EClassifier type)
public static EReference createEReference(EClass eClass, java.lang.String name, EClassifier type, boolean isRequired, boolean isMany)
@Deprecated public static java.util.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(java.lang.Object value)
public static java.lang.String getParentURI(EPackage ePackage)
public static void registerPackage(EPackage ePackage, EPackage.Registry... packageRegistries)
public static byte[] getEPackageBytes(EPackage ePackage, boolean zipped, EPackage.Registry packageRegistry)
public static EPackage createEPackage(java.lang.String uri, byte[] bytes, boolean zipped, ResourceSet resourceSet, boolean lookForResource)
public static <T> T getAdapter(Notifier notifier, java.lang.Class<T> type)
public static java.lang.String getQualifiedName(EPackage ePackage, java.lang.String separator)
public static java.lang.String getQualifiedName(EClassifier classifier, java.lang.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) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html