RootContainer
- the type of root containers in which model elements may reside (e.g. a Resource
)ModelObject
- the type representing a model element; can be simply an EObject
or a surrogate keypublic interface IEcoreManipulations<RootContainer,ModelObject>
IModelManipulations
is provided as the default case where the instance model is simply an EMF model.
Note that not all representations may support / preserve ordered collections.
Modifier and Type | Method and Description |
---|---|
default void |
add(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element)
Adds an existing element to a selected EStructuralFeature.
|
default void |
add(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element,
int index)
Adds an existing element to a selected EStructuralFeature at the specified index.
|
default void |
addAll(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature reference,
java.util.Collection<? extends java.lang.Object> elements)
Adds a collection of existing elements to a selected EStructuralFeature.
|
void |
addAllTo(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature reference,
java.util.Collection<? extends java.lang.Object> elements)
Adds a collection of existing elements to a selected EStructuralFeature.
|
void |
addTo(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element)
Adds an existing element to a selected EStructuralFeature.
|
void |
addTo(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element,
int index)
Adds an existing element to a selected EStructuralFeature at the specified index.
|
void |
changeIndex(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
int oldIndex,
int newIndex)
Changes the position of an existing element in the selected feature of the selected model object.
|
ModelObject |
create(RootContainer res,
org.eclipse.emf.ecore.EClass clazz)
Creates a model object and puts it as the root of the selected root container.
|
ModelObject |
createChild(ModelObject container,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass clazz)
Creates a model object and puts it into the selected reference of a
container.
|
void |
moveAllTo(java.util.Collection<ModelObject> what,
ModelObject newContainer,
org.eclipse.emf.ecore.EReference reference)
Moves a collection of existing elements into the selected containment reference of the selected model object.
|
void |
moveTo(ModelObject what,
ModelObject newContainer,
org.eclipse.emf.ecore.EReference reference)
Moves an existing element into the selected containment reference of the selected model object.
|
void |
moveTo(ModelObject what,
ModelObject newContainer,
org.eclipse.emf.ecore.EReference reference,
int index)
Moves an existing element into the selected containment reference of the selected model object at the specified index.
|
void |
moveTo(ModelObject what,
RootContainer newContainer)
Moves an existing element into the root of the selected root container.
|
void |
moveTo(ModelObject what,
RootContainer newContainer,
int index)
Moves an existing element into the root of the selected root container at the specified index.
|
void |
remove(ModelObject object)
Removes an object from the model, along with all contained objects, and any incoming or outgoing references.
|
void |
remove(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature)
Removes all elements from the 'many'-valued reference; if the reference is a containment reference, the element
is removed from the model as well (it is assumed that no dangling cross-references point to it).
|
void |
remove(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index)
Removes the element at the specified index from the 'many'-valued reference;
if the reference is a containment reference, the element is removed from the model as well
(it is assumed that no dangling cross-references point to it).
|
void |
remove(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element)
Removes an element from the 'many'-valued reference; if the reference is a containment reference, the element is
removed from the model as well (it is assumed that no dangling cross-references point to it).
|
void |
set(ModelObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object value)
Sets a 'single'-valued EStructuralFeature of a given container model element to the given value.
|
ModelObject create(RootContainer res, org.eclipse.emf.ecore.EClass clazz) throws ModelManipulationException
ModelManipulationException
ModelObject createChild(ModelObject container, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass clazz) throws ModelManipulationException
ModelManipulationException
default void add(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element) throws ModelManipulationException
ModelManipulationException
default void add(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element, int index) throws ModelManipulationException
ModelManipulationException
default void addAll(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature reference, java.util.Collection<? extends java.lang.Object> elements) throws ModelManipulationException
ModelManipulationException
void addTo(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element) throws ModelManipulationException
ModelManipulationException
void addTo(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element, int index) throws ModelManipulationException
ModelManipulationException
void addAllTo(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature reference, java.util.Collection<? extends java.lang.Object> elements) throws ModelManipulationException
ModelManipulationException
void set(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value) throws ModelManipulationException
The previous value of the feature, if any, is removed. If the provided new value is null, then the invocation acts as 'unset', and no new value is stored.
value
- the new value to be set, or null
TODO restrict to non-containment?
ModelManipulationException
void remove(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element) throws ModelManipulationException
ModelManipulationException
void remove(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, int index) throws ModelManipulationException
ModelManipulationException
void remove(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature) throws ModelManipulationException
ModelManipulationException
void remove(ModelObject object) throws ModelManipulationException
ModelManipulationException
void moveTo(ModelObject what, RootContainer newContainer) throws ModelManipulationException
ModelManipulationException
void moveTo(ModelObject what, RootContainer newContainer, int index) throws ModelManipulationException
ModelManipulationException
void moveTo(ModelObject what, ModelObject newContainer, org.eclipse.emf.ecore.EReference reference) throws ModelManipulationException
ModelManipulationException
void moveTo(ModelObject what, ModelObject newContainer, org.eclipse.emf.ecore.EReference reference, int index) throws ModelManipulationException
ModelManipulationException
void moveAllTo(java.util.Collection<ModelObject> what, ModelObject newContainer, org.eclipse.emf.ecore.EReference reference) throws ModelManipulationException
ModelManipulationException
void changeIndex(ModelObject container, org.eclipse.emf.ecore.EStructuralFeature feature, int oldIndex, int newIndex) throws ModelManipulationException
ModelManipulationException