Interface CtScannerListener

All Known Implementing Classes:
SuperInheritanceHierarchyFunction.DistinctTypeListener

public interface CtScannerListener
Responsible for performing an action when a scanner enters/exits a node while scanning the AST.
  • Method Summary

    Modifier and Type
    Method
    Description
    default ScanningMode
    enter​(CtElement element)
    Called before the scanner enters an element
    default ScanningMode
    enter​(CtRole role, CtElement element)
    Called before the scanner enters an element
    default void
    exit​(CtElement element)
    This method is called after the element and all its children have been visited.
    default void
    exit​(CtRole role, CtElement element)
    This method is called after the element and all its children have been visited.
  • Method Details

    • enter

      default ScanningMode enter(CtElement element)
      Called before the scanner enters an element
      Parameters:
      element - the element about to be scanned.
      Returns:
      a ScanningMode that drives how the scanner processes this element and its children. For instance, returning ScanningMode.SKIP_ALL causes that element and all children to be skipped and exit(CtElement) are be NOT called for that element.
    • enter

      default ScanningMode enter(CtRole role, CtElement element)
      Called before the scanner enters an element
      Parameters:
      role - the CtRole, which `element` has in its parent. It is null for the first scanned element
      element - the element about to be scanned.
      Returns:
      a ScanningMode that drives how the scanner processes this element and its children. For instance, returning ScanningMode.SKIP_ALL causes that element and all children to be skipped and exit(CtElement) are be NOT called for that element.
    • exit

      default void exit(CtElement element)
      This method is called after the element and all its children have been visited. This method is NOT called if an exception is thrown in enter(CtElement) or during the scanning of the element or any of its children element. This method is NOT called for an element for which enter(CtElement) returned ScanningMode.SKIP_ALL.
      Parameters:
      element - the element that has just been scanned.
    • exit

      default void exit(CtRole role, CtElement element)
      This method is called after the element and all its children have been visited. This method is NOT called if an exception is thrown in enter(CtElement) or during the scanning of the element or any of its children element. This method is NOT called for an element for which enter(CtElement) returned ScanningMode.SKIP_ALL.
      Parameters:
      role - the CtRole, which `element` has in its parent. It is null for the first scanned element
      element - the element that has just been scanned.