Class PropagatingAstObserver
- java.lang.Object
-
- com.github.javaparser.ast.observer.PropagatingAstObserver
-
- All Implemented Interfaces:
AstObserver
public abstract class PropagatingAstObserver extends Object implements AstObserver
This AstObserver attach itself to all new nodes added to the nodes already observed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.javaparser.ast.observer.AstObserver
AstObserver.ListChangeType
-
-
Constructor Summary
Constructors Constructor Description PropagatingAstObserver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
concreteListChange(NodeList<?> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)
void
concreteListReplacement(NodeList<?> observedNode, int index, Node oldValue, Node newValue)
void
concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)
void
listChange(NodeList<?> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)
A list is changedvoid
listReplacement(NodeList<?> observedNode, int index, Node oldNode, Node newNode)
void
parentChange(Node observedNode, Node previousParent, Node newParent)
The parent of a node is changedvoid
propertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)
The value of a property is changedstatic PropagatingAstObserver
transformInPropagatingObserver(AstObserver observer)
Wrap a given observer to make it self-propagating.
-
-
-
Method Detail
-
transformInPropagatingObserver
public static PropagatingAstObserver transformInPropagatingObserver(AstObserver observer)
Wrap a given observer to make it self-propagating. If the given observer is an instance of PropagatingAstObserver the observer is returned without changes.
-
propertyChange
public final void propertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)
Description copied from interface:AstObserver
The value of a property is changed- Specified by:
propertyChange
in interfaceAstObserver
- Parameters:
observedNode
- owner of the propertyproperty
- property changedoldValue
- value of the property before the changenewValue
- value of the property after the change
-
listChange
public final void listChange(NodeList<?> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)
Description copied from interface:AstObserver
A list is changed- Specified by:
listChange
in interfaceAstObserver
- Parameters:
observedNode
- list changedtype
- type of changeindex
- position at which the changed occurrednodeAddedOrRemoved
- element added or removed
-
listReplacement
public void listReplacement(NodeList<?> observedNode, int index, Node oldNode, Node newNode)
- Specified by:
listReplacement
in interfaceAstObserver
-
concretePropertyChange
public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)
-
concreteListChange
public void concreteListChange(NodeList<?> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)
-
concreteListReplacement
public void concreteListReplacement(NodeList<?> observedNode, int index, Node oldValue, Node newValue)
-
parentChange
public void parentChange(Node observedNode, Node previousParent, Node newParent)
Description copied from interface:AstObserver
The parent of a node is changed- Specified by:
parentChange
in interfaceAstObserver
- Parameters:
observedNode
- node of which the parent is changedpreviousParent
- previous parentnewParent
- new parent
-
-