public class EcoreUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static ILabelGenerator.Registry |
QUALIFIED_NAME_REGISTRY
The global QUALIFIED_NAME_REGISTRY is used by qualifiedNameFor to generate qualified names
for objects; typically a :: separted hierarchical name.
|
static ILabelGenerator.Registry |
SIMPLE_NAME_REGISTRY
The global SIMPLE_NAME_REGISTRY is used by simpleNameFor to generate simple names
for objects; typically the name property.
|
| Constructor and Description |
|---|
EcoreUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <E extends org.eclipse.emf.ecore.EObject> |
copy(E newObject) |
static java.lang.String |
diagnoseUnresolvedProxies(org.eclipse.emf.common.util.URI contextURI,
java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting>> map)
Convert the map return from EcoreUtil.UnresolvedProxyCrossReferencer.find(xx)
into a textual diagnosis.
|
static java.lang.String |
formatMultiplicity(org.eclipse.emf.ecore.ETypedElement typedElement) |
static java.lang.String |
formatOrdered(org.eclipse.emf.ecore.ETypedElement typedElement) |
static java.lang.String |
formatString(java.lang.String name) |
static java.lang.String |
formatUnique(org.eclipse.emf.ecore.ETypedElement typedElement) |
static <T extends org.eclipse.emf.common.notify.Adapter> |
getAdapter(java.util.List<org.eclipse.emf.common.notify.Adapter> eAdapters,
java.lang.Class<T> adapterClass) |
static <T extends org.eclipse.emf.common.notify.Adapter> |
getAdapter(org.eclipse.emf.common.notify.Notifier notifier,
java.lang.Class<T> adapterClass) |
static java.util.Map.Entry<java.lang.String,java.lang.String> |
getEAnnotationDetail(Constraint constraint)
Return the Ecore EStringToStringMapEntry that realises a given Constraint.
|
static org.eclipse.emf.ecore.EOperation |
getEcoreInvariant(org.eclipse.emf.ecore.EClass eClass,
java.lang.String name)
Return the EOperation that realises the name invariant for eClass.
|
static org.eclipse.emf.ecore.EClassifier |
getEType(org.eclipse.emf.ecore.EObject sourceObject,
org.eclipse.emf.ecore.EStructuralFeature feature)
Return the specialised value of feature.getEType() resolving any type parameters
from the specialised type of the sourceObject of the feature.
|
static <T> int |
getFeatureID(org.eclipse.emf.common.notify.Notification notification,
T expectedNotifier,
java.lang.Class<T> featureClass) |
static <T extends org.eclipse.emf.ecore.ENamedElement> |
getNamedElement(java.util.Collection<T> elements,
java.lang.String name) |
static <T extends org.eclipse.emf.ecore.ENamedElement,R extends T> |
getNamedElement(java.util.Collection<T> elements,
java.lang.String name,
java.lang.Class<R> returnClass) |
static java.lang.String |
qualifiedNameFor(java.lang.Object object)
Return a qualified name for object using the label generators registered
in the QUALIFIED_NAME_REGISTRY.
|
static java.lang.String |
simpleNameFor(java.lang.Object object)
Return a simple name for object using the label generators registered
in the SIMPLE_NAME_REGISTRY.
|
public static ILabelGenerator.Registry SIMPLE_NAME_REGISTRY
public static ILabelGenerator.Registry QUALIFIED_NAME_REGISTRY
public static <E extends org.eclipse.emf.ecore.EObject> E copy(E newObject)
public static java.lang.String diagnoseUnresolvedProxies(org.eclipse.emf.common.util.URI contextURI,
java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting>> map)
public static java.lang.String formatMultiplicity(org.eclipse.emf.ecore.ETypedElement typedElement)
public static java.lang.String formatOrdered(org.eclipse.emf.ecore.ETypedElement typedElement)
public static java.lang.String formatString(java.lang.String name)
public static java.lang.String formatUnique(org.eclipse.emf.ecore.ETypedElement typedElement)
public static <T extends org.eclipse.emf.common.notify.Adapter> T getAdapter(org.eclipse.emf.common.notify.Notifier notifier,
java.lang.Class<T> adapterClass)
public static <T extends org.eclipse.emf.common.notify.Adapter> T getAdapter(java.util.List<org.eclipse.emf.common.notify.Adapter> eAdapters,
java.lang.Class<T> adapterClass)
public static org.eclipse.emf.ecore.EClassifier getEType(org.eclipse.emf.ecore.EObject sourceObject,
org.eclipse.emf.ecore.EStructuralFeature feature)
sourceObject - feature - public static java.util.Map.Entry<java.lang.String,java.lang.String> getEAnnotationDetail(Constraint constraint)
constraint - the constraintpublic static org.eclipse.emf.ecore.EOperation getEcoreInvariant(org.eclipse.emf.ecore.EClass eClass,
java.lang.String name)
eClass - with invariantname - of invariantpublic static <T> int getFeatureID(org.eclipse.emf.common.notify.Notification notification,
T expectedNotifier,
java.lang.Class<T> featureClass)
public static <T extends org.eclipse.emf.ecore.ENamedElement> T getNamedElement(java.util.Collection<T> elements,
java.lang.String name)
public static <T extends org.eclipse.emf.ecore.ENamedElement,R extends T> R getNamedElement(java.util.Collection<T> elements,
java.lang.String name,
java.lang.Class<R> returnClass)
public static java.lang.String qualifiedNameFor(java.lang.Object object)
object - to be namedpublic static java.lang.String simpleNameFor(java.lang.Object object)
object - to be named