public final class CommonUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Set<org.eclipse.emf.ecore.EClass> |
getAllEContainments(org.eclipse.emf.ecore.EClass eClass)
Gives all registryEClasses which can be contained in a given EClass.
|
static Set<org.eclipse.emf.ecore.EClass> |
getAllModelElementEClasses()
Retrieve all EClasses from the ECore package registry.
|
static Set<org.eclipse.emf.ecore.EClass> |
getAllSubEClasses(org.eclipse.emf.ecore.EClass eClass)
Retrieve all EClasses from the ECore package registry that are subclasses of the given EClass.
|
static String |
getEncoding()
Returns the file encoding in use.
|
static Set<org.eclipse.emf.ecore.EObject> |
getNonTransientContents(org.eclipse.emf.ecore.EObject eObject)
Get all contained EObjects not including transient containment features.
|
static <T extends org.eclipse.emf.ecore.EObject> |
getParent(Class<T> parent,
org.eclipse.emf.ecore.EObject child)
Get the EContainer that contains the given model element and whose EContainer is null.
|
static org.eclipse.emf.ecore.EReference |
getPossibleContainingReference(org.eclipse.emf.ecore.EObject containee,
org.eclipse.emf.ecore.EObject parent)
Returns a containing reference of the
parent that may contain the
given containee. |
static boolean |
isSelfContained(org.eclipse.emf.ecore.EObject object)
Check an EObject and its containment tree whether it is self-contained.
|
static boolean |
isSelfContained(org.eclipse.emf.ecore.EObject eObject,
boolean ignoreContainer)
Check an EObject and its containment tree whether it is self-contained.
A containment tree is self contained if it does not have references to EObjects outside the tree. |
static boolean |
isSingletonEObject(org.eclipse.emf.ecore.EObject eObject)
Determines whether an EObject is a singleton object.
|
static boolean |
isTesting() |
static Set<org.eclipse.emf.ecore.EObject> |
loadFromResource(org.eclipse.emf.ecore.resource.Resource resource,
List<String> errorStrings)
Loads a Set of EObject from a given resource.
|
static void |
setTesting(boolean testing)
If we are running tests.
|
public static org.eclipse.emf.ecore.EReference getPossibleContainingReference(org.eclipse.emf.ecore.EObject containee,
org.eclipse.emf.ecore.EObject parent)
parent that may contain the
given containee.containee - the EObject that may be contained by the parent's reference, if anyparent - The EObject to get the containment references fromparent's container referencepublic static Set<org.eclipse.emf.ecore.EClass> getAllEContainments(org.eclipse.emf.ecore.EClass eClass)
eClass - the EClasspublic static Set<org.eclipse.emf.ecore.EClass> getAllSubEClasses(org.eclipse.emf.ecore.EClass eClass)
eClass - the superClass of the subClasses to retrievepublic static Set<org.eclipse.emf.ecore.EClass> getAllModelElementEClasses()
public static <T extends org.eclipse.emf.ecore.EObject> T getParent(Class<T> parent, org.eclipse.emf.ecore.EObject child)
T - parent typeparent - the Class of the parentchild - the model element whose container should get returnedpublic static boolean isSelfContained(org.eclipse.emf.ecore.EObject object)
object - the eObject that is checked whether it is self-containedpublic static boolean isSelfContained(org.eclipse.emf.ecore.EObject eObject,
boolean ignoreContainer)
eObject - the EObject that is checked whether it is self-containedignoreContainer - true, if references of object to its container should be ignored in the checkpublic static Set<org.eclipse.emf.ecore.EObject> getNonTransientContents(org.eclipse.emf.ecore.EObject eObject)
eObject - the EObject whose non-transient contents should be retrievedpublic static boolean isSingletonEObject(org.eclipse.emf.ecore.EObject eObject)
eObject - the EObject that will be checked whether it is a singletonpublic static Set<org.eclipse.emf.ecore.EObject> loadFromResource(org.eclipse.emf.ecore.resource.Resource resource, List<String> errorStrings)
resource - contains the items which should be loaded.errorStrings - contains all messages about items which couldn't be loaded by the method.public static void setTesting(boolean testing)
testing - the testing to setpublic static boolean isTesting()
public static String getEncoding()
Copyright © 2017. All rights reserved.