public abstract class AbstractModelManipulations extends AbstractEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject> implements IModelManipulations, IModelReadOperations
Modifier and Type | Field and Description |
---|---|
protected ViatraQueryEngine |
engine |
Constructor and Description |
---|
AbstractModelManipulations(ViatraQueryEngine engine) |
Modifier and Type | Method and Description |
---|---|
void |
addTo(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.util.Collection<? extends java.lang.Object> elements)
Adds a collection of existing elements to a selected EStructuralFeature.
|
void |
addTo(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element)
Adds an existing element to a selected EStructuralFeature.
|
void |
addTo(org.eclipse.emf.ecore.EObject 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(org.eclipse.emf.ecore.EObject 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.
|
int |
count(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature)
Retrieves the number of values in a given feature slot of a given container model element.
|
org.eclipse.emf.ecore.EObject |
create(org.eclipse.emf.ecore.resource.Resource res,
org.eclipse.emf.ecore.EClass clazz)
Creates a model object and puts it as the root of the selected root container.
|
org.eclipse.emf.ecore.EObject |
createChild(org.eclipse.emf.ecore.EObject 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.
|
protected abstract void |
doAdd(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature reference,
java.util.Collection<? extends java.lang.Object> element) |
protected abstract void |
doAdd(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature reference,
java.lang.Object object,
int index) |
protected abstract void |
doChangeIndex(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
int oldIndex,
int newIndex) |
protected abstract int |
doCount(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature) |
protected abstract org.eclipse.emf.ecore.EObject |
doCreate(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass clazz) |
protected abstract org.eclipse.emf.ecore.EObject |
doCreate(org.eclipse.emf.ecore.resource.Resource res,
org.eclipse.emf.ecore.EClass clazz) |
protected abstract boolean |
doIsSetTo(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object value) |
protected void |
doMoveTo(java.util.Collection<org.eclipse.emf.ecore.EObject> what,
org.eclipse.emf.ecore.EObject newContainer,
org.eclipse.emf.ecore.EReference reference) |
protected abstract void |
doMoveTo(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.EObject newContainer,
org.eclipse.emf.ecore.EReference reference) |
protected abstract void |
doMoveTo(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.EObject newContainer,
org.eclipse.emf.ecore.EReference reference,
int index) |
protected abstract void |
doMoveTo(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.resource.Resource newContainer) |
protected abstract void |
doMoveTo(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.resource.Resource newContainer,
int index) |
protected abstract void |
doRemove(org.eclipse.emf.ecore.EObject object)
Removes an element from the containment hierarchy
|
protected abstract void |
doRemove(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature reference) |
protected abstract void |
doRemove(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index) |
protected abstract void |
doRemove(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object element)
Remove a non-containment reference value
|
protected abstract void |
doSet(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object value) |
protected abstract java.util.stream.Stream<? extends java.lang.Object> |
doStream(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature) |
org.eclipse.emf.ecore.EClass |
eClass(org.eclipse.emf.ecore.EObject element)
Queries the exact type of the given object.
|
protected NavigationHelper |
getBaseEMFIndex() |
protected static java.util.Collection<java.lang.Object> |
getSlotValuesInternal(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature) |
boolean |
isSetTo(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature,
java.lang.Object value)
Returns whether the given value is listed among the values in a given feature slot of a given container model element.
|
void |
moveTo(java.util.Collection<org.eclipse.emf.ecore.EObject> what,
org.eclipse.emf.ecore.EObject 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(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.EObject newContainer,
org.eclipse.emf.ecore.EReference reference)
Moves an existing element into the selected containment reference of the selected model object.
|
void |
moveTo(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.EObject 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(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.resource.Resource newContainer)
Moves an existing element into the root of the selected root container.
|
void |
moveTo(org.eclipse.emf.ecore.EObject what,
org.eclipse.emf.ecore.resource.Resource newContainer,
int index)
Moves an existing element into the root of the selected root container at the specified index.
|
void |
remove(org.eclipse.emf.ecore.EObject object)
Removes an object from the model, along with all contained objects, and any incoming or outgoing references.
|
void |
remove(org.eclipse.emf.ecore.EObject 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(org.eclipse.emf.ecore.EObject 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(org.eclipse.emf.ecore.EObject 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(org.eclipse.emf.ecore.EObject 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.
|
java.util.stream.Stream<? extends java.lang.Object> |
stream(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EStructuralFeature feature)
Retrieves all values in a given feature slot of a given container model element.
|
isEObjectClass
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, addAllTo, moveAllTo
add, add, addAll
protected final ViatraQueryEngine engine
public AbstractModelManipulations(ViatraQueryEngine engine)
protected NavigationHelper getBaseEMFIndex()
ViatraQueryRuntimeException
protected void doMoveTo(java.util.Collection<org.eclipse.emf.ecore.EObject> what, org.eclipse.emf.ecore.EObject newContainer, org.eclipse.emf.ecore.EReference reference) throws ModelManipulationException
ModelManipulationException
protected abstract void doMoveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.resource.Resource newContainer) throws ModelManipulationException
ModelManipulationException
protected abstract void doMoveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.resource.Resource newContainer, int index) throws ModelManipulationException
ModelManipulationException
protected abstract void doMoveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.EObject newContainer, org.eclipse.emf.ecore.EReference reference) throws ModelManipulationException
ModelManipulationException
protected abstract void doMoveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.EObject newContainer, org.eclipse.emf.ecore.EReference reference, int index) throws ModelManipulationException
ModelManipulationException
protected abstract void doRemove(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element) throws ModelManipulationException
ModelManipulationException
protected abstract void doRemove(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, int index) throws ModelManipulationException
ModelManipulationException
protected abstract void doRemove(org.eclipse.emf.ecore.EObject object) throws ModelManipulationException
ModelManipulationException
protected abstract void doRemove(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature reference) throws ModelManipulationException
ModelManipulationException
protected abstract void doAdd(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature reference, java.util.Collection<? extends java.lang.Object> element) throws ModelManipulationException
ModelManipulationException
protected abstract void doAdd(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature reference, java.lang.Object object, int index) throws ModelManipulationException
ModelManipulationException
protected abstract void doSet(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value) throws ModelManipulationException
ModelManipulationException
protected abstract org.eclipse.emf.ecore.EObject doCreate(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass clazz) throws ModelManipulationException
ModelManipulationException
protected abstract org.eclipse.emf.ecore.EObject doCreate(org.eclipse.emf.ecore.resource.Resource res, org.eclipse.emf.ecore.EClass clazz) throws ModelManipulationException
ModelManipulationException
protected abstract void doChangeIndex(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, int oldIndex, int newIndex) throws ModelManipulationException
ModelManipulationException
protected abstract int doCount(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature) throws ModelManipulationException
ModelManipulationException
protected abstract java.util.stream.Stream<? extends java.lang.Object> doStream(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature) throws ModelManipulationException
ModelManipulationException
protected abstract boolean doIsSetTo(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value) throws ModelManipulationException
ModelManipulationException
public org.eclipse.emf.ecore.EClass eClass(org.eclipse.emf.ecore.EObject element) throws ModelManipulationException
IEcoreReadOperations
eClass
in interface IEcoreReadOperations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public int count(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature) throws ModelManipulationException
IEcoreReadOperations
count
in interface IEcoreReadOperations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public java.util.stream.Stream<? extends java.lang.Object> stream(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature) throws ModelManipulationException
IEcoreReadOperations
stream
in interface IEcoreReadOperations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public boolean isSetTo(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value) throws ModelManipulationException
IEcoreReadOperations
isSetTo
in interface IEcoreReadOperations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public org.eclipse.emf.ecore.EObject create(org.eclipse.emf.ecore.resource.Resource res, org.eclipse.emf.ecore.EClass clazz) throws ModelManipulationException
IEcoreManipulations
create
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public org.eclipse.emf.ecore.EObject createChild(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass clazz) throws ModelManipulationException
IEcoreManipulations
createChild
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void addTo(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element) throws ModelManipulationException
IEcoreManipulations
addTo
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void addTo(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element, int index) throws ModelManipulationException
IEcoreManipulations
addTo
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void addTo(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.util.Collection<? extends java.lang.Object> elements) throws ModelManipulationException
IModelManipulations
addTo
in interface IModelManipulations
ModelManipulationException
public void set(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value) throws ModelManipulationException
IEcoreManipulations
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.
set
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
value
- the new value to be set, or null
TODO restrict to non-containment?
ModelManipulationException
public void remove(org.eclipse.emf.ecore.EObject object) throws ModelManipulationException
IEcoreManipulations
remove
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void remove(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object element) throws ModelManipulationException
IEcoreManipulations
remove
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void remove(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, int index) throws ModelManipulationException
IEcoreManipulations
remove
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void remove(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature) throws ModelManipulationException
IEcoreManipulations
remove
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void moveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.resource.Resource newContainer) throws ModelManipulationException
IEcoreManipulations
moveTo
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void moveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.resource.Resource newContainer, int index) throws ModelManipulationException
IEcoreManipulations
moveTo
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void moveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.EObject newContainer, org.eclipse.emf.ecore.EReference reference) throws ModelManipulationException
IEcoreManipulations
moveTo
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void moveTo(org.eclipse.emf.ecore.EObject what, org.eclipse.emf.ecore.EObject newContainer, org.eclipse.emf.ecore.EReference reference, int index) throws ModelManipulationException
IEcoreManipulations
moveTo
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
public void moveTo(java.util.Collection<org.eclipse.emf.ecore.EObject> what, org.eclipse.emf.ecore.EObject newContainer, org.eclipse.emf.ecore.EReference reference) throws ModelManipulationException
IModelManipulations
moveTo
in interface IModelManipulations
ModelManipulationException
public void changeIndex(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature, int oldIndex, int newIndex) throws ModelManipulationException
IEcoreManipulations
changeIndex
in interface IEcoreManipulations<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.ecore.EObject>
ModelManipulationException
protected static java.util.Collection<java.lang.Object> getSlotValuesInternal(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EStructuralFeature feature)