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.
  • Constructor Details

    • PropagatingAstObserver

      public PropagatingAstObserver()
  • Method Details

    • 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 interface AstObserver
      Parameters:
      observedNode - owner of the property
      property - property changed
      oldValue - value of the property before the change
      newValue - 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 interface AstObserver
      Parameters:
      observedNode - list changed
      type - type of change
      index - position at which the changed occurred
      nodeAddedOrRemoved - element added or removed
    • listReplacement

      public void listReplacement(NodeList<?> observedNode, int index, Node oldNode, Node newNode)
      Specified by:
      listReplacement in interface AstObserver
    • 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 interface AstObserver
      Parameters:
      observedNode - node of which the parent is changed
      previousParent - previous parent
      newParent - new parent