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 Summary
Modifier and TypeMethodDescriptionvoid
addInputResource(String file)
Adds an input resource to be processed by Spoon (either a file or a folder).void
addProcessor(String name)
Adds a processor (fully qualified name).<T extends CtElement>
voidaddProcessor(Processor<T> processor)
Adds an instance of a processor.Builds the modelCreates a new Spoon compiler (for building the model)Creates a new Spoon environment (may be overridden)Creates a new Spoon factory (may be overridden)Returns the current environment.Returns the current factorygetModel()
Returns the model built from the sources given viaaddInputResource(String)
void
Write the transformed files to diskvoid
process()
Processes the model with the processors given previously withaddProcessor(String)
void
run()
Starts the complete Spoon processing (build model, process, write transformed files)void
Runs Spoon with these arguments (used by the "main" method)void
setBinaryOutputDirectory(File outputDirectory)
Sets the output directory for binary generated.void
setBinaryOutputDirectory(String path)
Sets the output directory for binary generated.void
setOutputFilter(String... qualifedNames)
Creates a filter from names in argument when the output-type is defined on classes.void
setOutputFilter(Filter<CtType<?>> typeFilter)
Applies a filter when the output-type is defined on classes.void
setSourceOutputDirectory(File outputDirectory)
Sets the output directory for source generated.void
setSourceOutputDirectory(String path)
Sets the output directory for source generated.
-
Method Details
-
run
Runs Spoon with these arguments (used by the "main" method) -
addInputResource
Adds an input resource to be processed by Spoon (either a file or a folder). -
setSourceOutputDirectory
Sets the output directory for source generated.- Parameters:
path
- Path for the output directory.
-
setSourceOutputDirectory
Sets the output directory for source generated.- Parameters:
outputDirectory
-File
for output directory.
-
setOutputFilter
Applies a filter when the output-type is defined on classes.- Parameters:
typeFilter
- Filter on CtType to know which type Spoon must print.
-
setOutputFilter
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
Sets the output directory for binary generated.- Parameters:
path
- Path for the binary output directory.
-
setBinaryOutputDirectory
Sets the output directory for binary generated.- Parameters:
outputDirectory
-File
for the binary output directory.
-
addProcessor
Adds a processor (fully qualified name). -
addProcessor
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 withaddProcessor(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 viaaddInputResource(String)
-