Package spoon.support.modelobs
Class ActionBasedChangeListenerImpl
java.lang.Object
spoon.support.modelobs.ActionBasedChangeListenerImpl
- All Implemented Interfaces:
ActionBasedChangeListener
,FineModelChangeListener
public abstract class ActionBasedChangeListenerImpl
extends Object
implements ActionBasedChangeListener, FineModelChangeListener
This listener will propagate the change to the listener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
when an element is changedvoid
when an element is addedvoid
onDelete(DeleteAction action)
when an element is removedvoid
onDeleteAll(DeleteAllAction action)
when all element are removedvoid
a newValue is appended to the list corresponding to the role in the AST nodevoid
a newValue is appended to the list corresponding to the role in the AST nodevoid
onListDelete(CtElement currentElement, CtRole role, List field, int index, CtElement oldValue)
an oldValue is deleted in the list corresponding to the role in the AST nodevoid
onListDelete(CtElement currentElement, CtRole role, List field, Collection<? extends CtElement> oldValue)
an oldValue is deleted in the list corresponding to the role in the AST nodevoid
onListDeleteAll(CtElement currentElement, CtRole role, List field, List oldValue)
a list corresponding to the role in the AST node is emptied<K, V> void
a newValue is appended to the map corresponding to the role in the AST node<K, V> void
onMapDelete(CtElement currentElement, CtRole role, Map<K,V> field, K key, CtElement oldValue)
A mapping is removed from the map corresponding to the role in the AST node<K, V> void
onMapDeleteAll(CtElement currentElement, CtRole role, Map<K,V> field, Map<K,V> oldValue)
a map corresponding to the role in the AST node is emptiedvoid
onObjectDelete(CtElement currentElement, CtRole role, CtElement oldValue)
a field corresponding to the role is being set to nullvoid
onObjectUpdate(CtElement currentElement, CtRole role, Object newValue, Object oldValue)
a field corresponding to the role is being set in the AST nodevoid
onObjectUpdate(CtElement currentElement, CtRole role, CtElement newValue, CtElement oldValue)
a field corresponding to the role is being set in the AST nodevoid
a newValue is appended to the set corresponding to the role in the AST node<T extends Enum>
voida newValue is appended to the set corresponding to the role in the AST nodevoid
onSetDelete(CtElement currentElement, CtRole role, Set field, Collection<ModifierKind> oldValue)
an oldValue is deleted in the set corresponding to the role in the AST nodevoid
onSetDelete(CtElement currentElement, CtRole role, Set field, CtElement oldValue)
an oldValue is deleted in the set corresponding to the role in the AST nodevoid
onSetDelete(CtElement currentElement, CtRole role, Set field, ModifierKind oldValue)
an oldValue is deleted in the set corresponding to the role in the AST nodevoid
onSetDeleteAll(CtElement currentElement, CtRole role, Set field, Set oldValue)
a set corresponding to the role in the AST node is emptiedvoid
onUpdate(UpdateAction action)
when an element is modified
-
Constructor Details
-
ActionBasedChangeListenerImpl
public ActionBasedChangeListenerImpl()
-
-
Method Details
-
onObjectUpdate
public void onObjectUpdate(CtElement currentElement, CtRole role, CtElement newValue, CtElement oldValue)Description copied from interface:FineModelChangeListener
a field corresponding to the role is being set in the AST node- Specified by:
onObjectUpdate
in interfaceFineModelChangeListener
-
onObjectUpdate
public void onObjectUpdate(CtElement currentElement, CtRole role, Object newValue, Object oldValue)Description copied from interface:FineModelChangeListener
a field corresponding to the role is being set in the AST node- Specified by:
onObjectUpdate
in interfaceFineModelChangeListener
-
onObjectDelete
Description copied from interface:FineModelChangeListener
a field corresponding to the role is being set to null- Specified by:
onObjectDelete
in interfaceFineModelChangeListener
-
onListAdd
Description copied from interface:FineModelChangeListener
a newValue is appended to the list corresponding to the role in the AST node- Specified by:
onListAdd
in interfaceFineModelChangeListener
-
onListAdd
public void onListAdd(CtElement currentElement, CtRole role, List field, int index, CtElement newValue)Description copied from interface:FineModelChangeListener
a newValue is appended to the list corresponding to the role in the AST node- Specified by:
onListAdd
in interfaceFineModelChangeListener
-
onListDelete
public void onListDelete(CtElement currentElement, CtRole role, List field, Collection<? extends CtElement> oldValue)Description copied from interface:FineModelChangeListener
an oldValue is deleted in the list corresponding to the role in the AST node- Specified by:
onListDelete
in interfaceFineModelChangeListener
-
onListDelete
public void onListDelete(CtElement currentElement, CtRole role, List field, int index, CtElement oldValue)Description copied from interface:FineModelChangeListener
an oldValue is deleted in the list corresponding to the role in the AST node- Specified by:
onListDelete
in interfaceFineModelChangeListener
-
onListDeleteAll
Description copied from interface:FineModelChangeListener
a list corresponding to the role in the AST node is emptied- Specified by:
onListDeleteAll
in interfaceFineModelChangeListener
-
onMapAdd
public <K, V> void onMapAdd(CtElement currentElement, CtRole role, Map<K,V> field, K key, CtElement newValue)Description copied from interface:FineModelChangeListener
a newValue is appended to the map corresponding to the role in the AST node- Specified by:
onMapAdd
in interfaceFineModelChangeListener
-
onMapDelete
public <K, V> void onMapDelete(CtElement currentElement, CtRole role, Map<K,V> field, K key, CtElement oldValue)Description copied from interface:FineModelChangeListener
A mapping is removed from the map corresponding to the role in the AST node- Specified by:
onMapDelete
in interfaceFineModelChangeListener
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
currentElement
- the element that changedrole
- the role of the field that changedfield
- the current value of the field that changedkey
- the key of the element that was deletedoldValue
- the element that was deleted
-
onMapDeleteAll
public <K, V> void onMapDeleteAll(CtElement currentElement, CtRole role, Map<K,V> field, Map<K,V> oldValue)Description copied from interface:FineModelChangeListener
a map corresponding to the role in the AST node is emptied- Specified by:
onMapDeleteAll
in interfaceFineModelChangeListener
-
onSetAdd
Description copied from interface:FineModelChangeListener
a newValue is appended to the set corresponding to the role in the AST node- Specified by:
onSetAdd
in interfaceFineModelChangeListener
-
onSetAdd
public <T extends Enum> void onSetAdd(CtElement currentElement, CtRole role, Set field, T newValue)Description copied from interface:FineModelChangeListener
a newValue is appended to the set corresponding to the role in the AST node- Specified by:
onSetAdd
in interfaceFineModelChangeListener
-
onSetDelete
Description copied from interface:FineModelChangeListener
an oldValue is deleted in the set corresponding to the role in the AST node- Specified by:
onSetDelete
in interfaceFineModelChangeListener
-
onSetDelete
public void onSetDelete(CtElement currentElement, CtRole role, Set field, Collection<ModifierKind> oldValue)Description copied from interface:FineModelChangeListener
an oldValue is deleted in the set corresponding to the role in the AST node- Specified by:
onSetDelete
in interfaceFineModelChangeListener
-
onSetDelete
Description copied from interface:FineModelChangeListener
an oldValue is deleted in the set corresponding to the role in the AST node- Specified by:
onSetDelete
in interfaceFineModelChangeListener
-
onSetDeleteAll
Description copied from interface:FineModelChangeListener
a set corresponding to the role in the AST node is emptied- Specified by:
onSetDeleteAll
in interfaceFineModelChangeListener
-
onDelete
Description copied from interface:ActionBasedChangeListener
when an element is removed- Specified by:
onDelete
in interfaceActionBasedChangeListener
- Parameters:
action
- contains information of the change
-
onDeleteAll
Description copied from interface:ActionBasedChangeListener
when all element are removed- Specified by:
onDeleteAll
in interfaceActionBasedChangeListener
- Parameters:
action
- contains information of the change
-
onAdd
Description copied from interface:ActionBasedChangeListener
when an element is added- Specified by:
onAdd
in interfaceActionBasedChangeListener
- Parameters:
action
- contains information of the change
-
onUpdate
Description copied from interface:ActionBasedChangeListener
when an element is modified- Specified by:
onUpdate
in interfaceActionBasedChangeListener
- Parameters:
action
- contains information of the change
-
onAction
Description copied from interface:ActionBasedChangeListener
when an element is changed- Specified by:
onAction
in interfaceActionBasedChangeListener
- Parameters:
action
- contains information of the change
-