public final class ExclusiveGroups extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,Set<org.eclipse.emf.ecore.EObject>> |
aggregateGroups(org.eclipse.emf.common.util.EList<? extends org.eclipse.emf.ecore.EObject> objects)
Group objects by groupId
|
static org.eclipse.emf.ecore.EAnnotation |
findAnnotation(org.eclipse.emf.ecore.EObject target)
Finds the annotation even on supertypes
|
static Set<String> |
makeGroupIds(Collection<? extends org.eclipse.emf.ecore.EObject> objects)
Make a set of group ids present in the object collection
|
static void |
removeGroups(Collection<? extends org.eclipse.emf.ecore.EObject> objects,
Collection<? extends org.eclipse.emf.ecore.EObject> sourceObjects)
Remove all exclusive objects that are in the one group from the other
|
static void |
removeGroups(Collection<? extends org.eclipse.emf.ecore.EObject> objects,
Set<String> groupIds)
Remove exclusive groups from a collection of objects
|
static Map<String,Set<org.eclipse.emf.ecore.EObject>> |
validate(org.eclipse.emf.common.util.EList<? extends org.eclipse.emf.ecore.EObject> objects)
Return an aggregated map of group violations
|
public static void removeGroups(Collection<? extends org.eclipse.emf.ecore.EObject> objects, Set<String> groupIds)
objects
- the objects to processgroupIds
- the groups to removepublic static org.eclipse.emf.ecore.EAnnotation findAnnotation(org.eclipse.emf.ecore.EObject target)
target
- the object to checknull
the object or its supertypes
don't have the annotationpublic static Set<String> makeGroupIds(Collection<? extends org.eclipse.emf.ecore.EObject> objects)
objects
- the objects to checknull
public static void removeGroups(Collection<? extends org.eclipse.emf.ecore.EObject> objects, Collection<? extends org.eclipse.emf.ecore.EObject> sourceObjects)
objects
- the object from which objects will be removedsourceObjects
- the source of the exclusive group objectspublic static Map<String,Set<org.eclipse.emf.ecore.EObject>> validate(org.eclipse.emf.common.util.EList<? extends org.eclipse.emf.ecore.EObject> objects)
This method actually calls aggregateGroups(EList)
and only
returns groups with a size greater than 1.
objects
- the objects to validatepublic static Map<String,Set<org.eclipse.emf.ecore.EObject>> aggregateGroups(org.eclipse.emf.common.util.EList<? extends org.eclipse.emf.ecore.EObject> objects)
Note that object without are group are not returned
objects
- the object to group