Class SpoonifierVisitor

java.lang.Object
spoon.reflect.visitor.CtScanner
spoon.experimental.SpoonifierVisitor
All Implemented Interfaces:
CtVisitor

public class SpoonifierVisitor extends CtScanner
Visitor that generates factory calls to recreate the AST visited.
  • Field Details

    • printTabs

      public boolean printTabs
  • Constructor Details

    • SpoonifierVisitor

      public SpoonifierVisitor()
      Default constructor for SpoonifierVisitor. Print with tabulations.
    • SpoonifierVisitor

      public SpoonifierVisitor(boolean printTabs)
      Parameters:
      printTabs - if set to true, tabulations will be printed to match the structure of the AST constructed.
  • Method Details

    • getResult

      public String getResult()
      Returns:
      the generated code. Note that this code assume a variable Factory factory is already aessible in the scope.
    • enter

      public void enter(CtElement element)
      Description copied from class: CtScanner
      This method is called by the scanner when entering a scanned element. To be overridden to implement specific scanners.
      Overrides:
      enter in class CtScanner
    • exit

      public void exit(CtElement element)
      Description copied from class: CtScanner
      This method is called by the scanner when exiting a scanned element. To be overridden to implement specific scanners.
      Overrides:
      exit in class CtScanner