Package spoon

Interface SpoonAPI

All Known Implementing Classes:
IncrementalLauncher, Launcher, MavenLauncher

public interface SpoonAPI
Is the core entry point of Spoon. Implemented by Launcher.
  • Method Details

    • run

      void run(String[] args)
      Runs Spoon with these arguments (used by the "main" method)
    • addInputResource

      void addInputResource(String file)
      Adds an input resource to be processed by Spoon (either a file or a folder).
    • setSourceOutputDirectory

      void setSourceOutputDirectory(String path)
      Sets the output directory for source generated.
      Parameters:
      path - Path for the output directory.
    • setSourceOutputDirectory

      void setSourceOutputDirectory(File outputDirectory)
      Sets the output directory for source generated.
      Parameters:
      outputDirectory - File for output directory.
    • setOutputFilter

      void setOutputFilter(Filter<CtType<?>> typeFilter)
      Applies a filter when the output-type is defined on classes.
      Parameters:
      typeFilter - Filter on CtType to know which type Spoon must print.
    • setOutputFilter

      void setOutputFilter(String... qualifedNames)
      Creates a filter from names in argument when the output-type is defined on classes.
      Parameters:
      qualifedNames - Names of class in fully qualified name to know which type Spoon must print.
    • setBinaryOutputDirectory

      void setBinaryOutputDirectory(String path)
      Sets the output directory for binary generated.
      Parameters:
      path - Path for the binary output directory.
    • setBinaryOutputDirectory

      void setBinaryOutputDirectory(File outputDirectory)
      Sets the output directory for binary generated.
      Parameters:
      outputDirectory - File for the binary output directory.
    • addProcessor

      void addProcessor(String name)
      Adds a processor (fully qualified name).
    • addProcessor

      <T extends CtElement> void addProcessor(Processor<T> processor)
      Adds an instance of a processor. The user is responsible for keeping a pointer to it for later retrieving some processing information.
    • buildModel

      CtModel buildModel()
      Builds the model
    • process

      void process()
      Processes the model with the processors given previously with addProcessor(String)
    • prettyprint

      void prettyprint()
      Write the transformed files to disk
    • run

      void run()
      Starts the complete Spoon processing (build model, process, write transformed files)
    • getFactory

      Factory getFactory()
      Returns the current factory
    • getEnvironment

      Environment getEnvironment()
      Returns the current environment. This environment is modifiable.
    • createFactory

      Factory createFactory()
      Creates a new Spoon factory (may be overridden)
    • createEnvironment

      Environment createEnvironment()
      Creates a new Spoon environment (may be overridden)
    • createCompiler

      SpoonModelBuilder createCompiler()
      Creates a new Spoon compiler (for building the model)
    • getModel

      CtModel getModel()
      Returns the model built from the sources given via addInputResource(String)