Top Description Constructors Methods
com.github.javaparser.ast.observer

public abstract Class PropagatingAstObserver

extends Object
implements AstObserver
Class Inheritance
All Implemented Interfaces
com.github.javaparser.ast.observer.AstObserver
Known Direct Subclasses
com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.Observer
Imports
com.github.javaparser.ast.Node, .NodeList

This AstObserver attach itself to all new nodes added to the nodes already observed.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
concreteListChange(NodeList<N extends Node> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)

public void
concreteListReplacement(NodeList<N extends Node> observedNode, int index, Node oldValue, Node newValue)

public void
concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)

private void
private void
public final void
listChange(NodeList<N extends Node>
list changed
observedNode
,
AstObserver.ListChangeType
type of change
type
,
int
position at which the changed occurred
index
,
Node
element added or removed
nodeAddedOrRemoved
)

Implements com.github.javaparser.ast.observer.AstObserver.listChange.

A list is changed
public void
listReplacement(NodeList<N extends Node> observedNode, int index, Node oldNode, Node newNode)

Implements com.github.javaparser.ast.observer.AstObserver.listReplacement.

public void
parentChange(Node
node of which the parent is changed
observedNode
,
Node
previous parent
previousParent
,
Node
new parent
newParent
)

Implements com.github.javaparser.ast.observer.AstObserver.parentChange.

The parent of a node is changed
public final void
propertyChange(Node
owner of the property
observedNode
,
ObservableProperty
property changed
property
,
Object
value of the property before the change
oldValue
,
Object
value of the property after the change
newValue
)

Implements com.github.javaparser.ast.observer.AstObserver.propertyChange.

The value of a property is changed
public static PropagatingAstObserver
transformInPropagatingObserver(final AstObserver observer)

Wrap a given observer to make it self-propagating.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropagatingAstObserverback to summary
public PropagatingAstObserver()

Method Detail

concreteListChangeback to summary
public void concreteListChange(NodeList<N extends Node> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)
concreteListReplacementback to summary
public void concreteListReplacement(NodeList<N extends Node> observedNode, int index, Node oldValue, Node newValue)
concretePropertyChangeback to summary
public void concretePropertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)
considerAddingback to summary
private void considerAdding(Object element)
considerRemovingback to summary
private void considerRemoving(Object element)
listChangeback to summary
public final void listChange(NodeList<N extends Node> observedNode, AstObserver.ListChangeType type, int index, Node nodeAddedOrRemoved)

Implements com.github.javaparser.ast.observer.AstObserver.listChange.

Doc from com.github.javaparser.ast.observer.AstObserver.listChange.

A list is changed

Parameters
observedNode:NodeList<N extends Node>

list changed

type:AstObserver.ListChangeType

type of change

index:int

position at which the changed occurred

nodeAddedOrRemoved:Node

element added or removed

Annotations
@Override
listReplacementback to summary
public void listReplacement(NodeList<N extends Node> observedNode, int index, Node oldNode, Node newNode)

Implements com.github.javaparser.ast.observer.AstObserver.listReplacement.

Annotations
@Override
parentChangeback to summary
public void parentChange(Node observedNode, Node previousParent, Node newParent)

Implements com.github.javaparser.ast.observer.AstObserver.parentChange.

Doc from com.github.javaparser.ast.observer.AstObserver.parentChange.

The parent of a node is changed

Parameters
observedNode:Node

node of which the parent is changed

previousParent:Node

previous parent

newParent:Node

new parent

Annotations
@Override
propertyChangeback to summary
public final void propertyChange(Node observedNode, ObservableProperty property, Object oldValue, Object newValue)

Implements com.github.javaparser.ast.observer.AstObserver.propertyChange.

Doc from com.github.javaparser.ast.observer.AstObserver.propertyChange.

The value of a property is changed

Parameters
observedNode:Node

owner of the property

property:ObservableProperty

property changed

oldValue:Object

value of the property before the change

newValue:Object

value of the property after the change

Annotations
@Override
transformInPropagatingObserverback to summary
public static PropagatingAstObserver transformInPropagatingObserver(final 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.