All Classes
Class
Description
This class defines an abstract annotation processor to be subclassed by the
user for defining new annotation processors including Java 8 annotations.
Base contract for all assertion objects: the minimum functionality that
any assertion object should provide.
Defines an abstract filter based on matching on the element types.
This class defines an abstract processor to be subclassed by the user for
defining new manual processors.
Represents a parameterized Pattern ValueResolver, which can be used
to generate a zero, one or more copies of model using provided parameters
to match zero, one or more instances of model and deliver a matching parameters
AbstractParallelProcessor allows using multiple threads for concurrent
processing with
AbstractProcessor
.Partial implementation for CtPathElement
This class defines an abstract processor to be subclassed by the user for
defining new processors.
This class defines an abstract reference filter that needs to be subclassed
in order to define the matching criteria.
abstract implementation of rename element refactoring
handles the well-formedness and helper methods of templates
Find local variables catch, parameters, fields, super fields
defines an action change on the model
notifies all change on the AST
This listener will propagate the change to the listener
Returns all methods/lambdas with same signature in related inheritance hierarchies.
Expects
CtType
as input
and produces all CtTypeMember
s declared in input class
or any super class or super interface.The
CtAnnotationType
sub-factory.This filter matches all the elements annotated with a given annotation type.
This interface defines an annotation processor.
Entry point for assertion methods for different data types.
This enumeration defines all the kinds of binary operators.
This class represents a template parameter that defines a void block
statement directly expressed in Java (no returns).
This interface represents the position of a Method or Type declaration in a source file.
This class represents the position of a Java program element in a source
file.
Caches some field and nested type names
This Query expects a
CtCatchVariable
as input
and returns all CtCatchVariableReference
s, which refers this input.This Query expects a
CtCatchVariable
as input
and returns all CtElements,
which are in visibility scope of that catch variable.Chain of
RootNode
s.Listens on changes on the spoon model and remembers them
Helper which provides details about changes on provided `element`
This annotation defines a method that contains children of an element of the
meta model.
The
CtClass
sub-factory.Helper class created from type X or reference to X.
Used to set all data in the cloned element.
CloneHelper
is responsible for creating clones of CtElement
AST nodes including the whole subtree.Used to clone a given element.
This sub-factory contains utility methods to create code elements.
SourceFragment
of List or Set of ElementSourceFragment
s which belong to collection role.Computes source code representation of the Comment literal
Deprecated.
A factory to create some evaluation utilities on the Spoon metamodel.
This interface is used by instances of
SpoonModelBuilder
to
exclude particular CompilationUnit
s while
generating a CtModel
with
SpoonModelBuilder.build(spoon.compiler.builder.JDTBuilder)
.Implements a compilation unit.
This class defines a composite filter, which can compose several filters
together by using
FilteringOperator
.This interface represents the position of a program element like an expression in a source file.
This class represents the position of a named Java program element in a source
file.
Different types of compressions used, e.g.
Represents a parameter which is related to a value of another parameter.
Represents categories of metamodel types
Defines what happens when a
RootNode
has to be replaced by another RootNode
, default in ConflictResolutionMode.FAIL
.Generates/Matches a copy of single template object
The
CtConstructor
sub-factory.Represents a kind of data, which is used in an field or in a role in the Spoon metamodel.
defines the context of an action
Verifies all contracts that should hold on any AST.
This interface defines the core creation methods for the meta-model (to be
implemented so that Spoon can manipulate other meta-model implementations).
Defines the core bi-scan responsibility.
Provides an empty implementation of
CtImportVisitor
.This code element defines an abstract invocation on a
CtExecutable
.This code element defines an abstract switch
(either switch statement or switch expression).
Provides an empty implementation of CtVisitor.
This interface defines the capability related to binding generics (aka type parameters).
This enum specifies the element type which is annotated by the annotation
This element represents an annotation on an element.
This code element defines an access to a annotation parameter variable.
The implementation for
CtAnnotation
.This element defines an annotation method declared in an annotation type.
The implementation for
CtAnnotationMethod
.This element defines an annotation type.
The implementation for
CtAnnotationType
.This element defines an anonymous executable block declaration in a class.
This code element defines a one-dimensional array access.
This code element defines a read access to an array.
This interface defines a reference to an array.
This code element defines a write access to an array.
This code element defines an assert clause.
This code element defines an assignment.
A class to be able to iterate over the children elements in the tree of a given node, in breadth-first order.
This interface defines a binary operator.
This visitor implements a deep-search scan on the model for 2 elements.
This code element represents a block of code, that is to say a list of
statements enclosed in curly brackets.
This abstract code element defines an element, which contains a body
This code element defines a break statement.
This code element defines a case within a switch-case.
This code element defines a
catch
of a try
.This code element defines an exception variable in a catch.
This interface defines a reference to
CtCatchVariable
.This abstract code element represents all the statements that break the
control flow of the program.
This element represents a class declaration.
The implementation for
CtClass
.This interface is the root interface of the code elements.
This interface represents snippets of source code that can be used in the AST
to represent complex code without having to build the corresponding program
model structure.
This element is a code snippet that must represent an expression and can thus
be inserted in the program's model as is.
This element is a code snippet that must represent a statement and can thus
be inserted in the program's model as is.
This code element defines a comment
Example:
int x = 0;
// a comment
Defines a compilation unit.
Implements a compilation unit.
This code element defines conditional expressions using the ? (ternary expressions).
This element defines a constructor declaration.
This code element represents a constructor call.
Represents a function, as
CtFunction
.The functional interface used to receive objects.
This code element defines the continue statement.
This class defines a scanner that maintains a scanning stack for contextual
awareness.
This code element defines a
do
loop.This interface is the root interface for the metamodel elements (any program
element).
Contains the default implementation of most CtElement methods.
This builder allow to create some CtPath from CtElements
Created by nharrand on 21/02/2018.
This element represents an enumeration declaration.
Corresponds to one enum value specified in an enumeration.
This element represents an executable element such as a method, a
constructor, or an anonymous block.
The implementation for
CtExecutable
.This interface defines a reference to a
CtExecutable
.This abstract code element defines an expression which represents an executable reference.
This abstract code element defines a typed expression.
Represents a modifier (eg "public").
This element defines a field declaration.
This code element defines an access to a field variable (read and write)
The implementation for
CtField
.This code element defines a read access to a field.
This interface defines a reference to a
CtField
.This code element defines a write access to a field.
This code element defines a for loop.
This code element defines a foreach statement.
This abstract element defines a declaration that accepts formal type
parameters (aka generics), such as a CtType (
class A<E>
), CtMethod or CtConstructor.Abstraction for functions in the Spoon realm.
This code element represents an
if
statement.This element represents an import declaration.
This interface defines the visitor for the different types of CtImport
This class provides an abstract implementation of the visitor that allows its
subclasses to scan the metamodel elements by recursively using their
(abstract) supertype scanning methods.
This element defines an interface declaration.
This interface defines a reference to an intersection type in generics or in casts.
This code element defines a concrete invocation.
A class to be able to iterate over the children elements in the tree of a given node, in depth-first order.
This code element defines a javadoc comment
Example:
This code element defines a javadoc tag
Example:
Define the possible type for a tag
This abstract code element represents all the statements that break the
control flow of the program and which can support a label.
This code element represents the creation of a lambda.
Comparator of compile-time elements.
This code element defines a literal value (an int, a string, etc).
This code element defines a local variable definition (within an executable
body).
This interface defines a reference to
CtLocalVariable
.An implementation for
CtLocalVariableReference
.This abstract code element defines a loop.
This element defines a method declaration.
The implementation for
CtMethod
.represents a Java program, modeled by a set of compile-time (Ct) objects
where each object is a program element (for instance, a CtClass represents a class).
This interface defines an element that accepts modifiers.
Represents a Java module as defined in Java 9.
Represents a directive of a
CtModule
The directives of a module declaration specify the module's dependences on other modules CtModuleRequirement
,
the packages it makes available to other modules CtPackageExport
,
the services it consumes CtUsedService
,
and the services it provides CtProvidedService
.Represents a reference to a
CtModule
Represents a require module in a Java module definition
The requires directive specifies the name of a module on which the current module has a dependence.
Defined an element with several types.
Declares an element that has a name (a class, a method, a variable, etc).
A CtPathElement that match on CtNamedElement#getSimpleName
This code element defines the inline creation of a new array.
This code element represents the creation of a anonymous class.
This code element defines an self-operated assignment such as += or *=.
This element defines a package declaration.
This element represents an package declaration.
Represents an exported or opened package in a Java module
The exports directive specifies the name of a package to be exported by the current module.
The implementation for
CtPackage
.This interface defines a reference to a
CtPackage
.This element defines an executable parameter declaration.
The implementation for
CtParameter
.This interface defines a reference to a
CtParameter
of a method.Removes target
CtParameter
from the parent target CtExecutable
and from all overriding/overridden methods of related type hierarchies
and from all lambda expressions (if any) implementing the modified interface.A CtPath allows to define the path to a CtElement in the Spoon model, eg ".spoon.test.path.Foo.foo#body#statement[index=0]"
This builder allow to create some CtPath.
A single path element from a CtPath.
This exception is throw when there are errors during a CtPath building or evaluation.
Default implementation for a CtPath
Created by nicolas on 27/08/2015.
This interface represents a common super type for different
patterns implemented in the Java language.
Represents a provided service in a
CtModule
.CtQuery represents a query, which can be used to traverse a spoon model and collect
children elements in several ways.
Represents an object on which one can make queries.
Expert-only capability interface so as to write advanced
CtFunction
and Filter
that need to access the state of the top-level CtQuery
instance
containing the function to be evaluated.This element represents a record declaration.
This element represents a record component.
Defines basic contract of all refactoring implementations.
Contract: to process a required refactoring.
Usage:
Contract: to process a required refactoring.
Usage:
This is the root interface for named program element references, such as fields, types,
variables, and so on.
Spoon model that can refactor any type of variable (method parameters, local variables, field variables.
Spoon model refactoring function which renames `target` local variable to `newName`
This refactoring will throw
This refactoring will throw
RefactoringException
if the model would be not consistent after rename to new name.The kind of refactoring, which renames a `target` element
to the `newName`
Usage:
Usage:
This code element defines a resource used in the try-with-resource statement.
This code element represents a
return
statement.Identifies the roles of attributes of spoon model.
A CtPathElement that define some roles for matching.
This visitor implements a deep-search scan on the model.
Returns all children of an element.
Responsible for performing an action when a scanner enters/exits a node while scanning the AST.
This interface represents any type that can be sealed.
A shadow element is an element that is in the Spoon model, but does not exist in the actual source code.
This abstract code element represents all the statements, which can be part
of a block.
This code element represents a list of statements.
This code element defines an access to super.
This code element defines a switch statement.
This code element defines a switch expression.
This code element defines a
synchronized
statement.This abstract code element defines an expression which contains a target
expression.
This code element defines a Text Block String Literal.
This code element defines an access to this.
This code element defines a
throw
statement.This code element defines a
try
statement.This code element defines a
try
with resource statement.This abstract element defines a super-type for classes and interfaces, which
can declare methods.
This code element represents a type reference usable as an expression.
This abstract element defines a typed element.
spoon.reflect.path.impl.CtPathElement that match on CtNamedElement
The implementation for
CtType
.Returns information that can be obtained both at compile-time and run-time.
This interface represents a member of a class (field, method,
nested class or static/instance initializer).
This interface defines a import reference to all static type members of a type.
Example:
Example:
somePackage.Type.*;
This class intends to be used only to represent the reference of a
static import of all members of a type:
import static org.junit.Assert.*;
This element defines a declaration of a type parameter (aka generics).
This interface defines a reference to a type parameter (aka generics).
This code element defines a type pattern, introduced in Java 16
by JEP 394.
This interface defines a reference to a
CtType
or sub-type.This code element represents a unary operator.
This interface defines a reference to an unbound
CtVariable
.represents a reference to an unbound field (used when no full classpath is available
Represents the declaration of a used service in a
CtModule
The uses directive specifies a service for which the current module may discover providers via java.util.ServiceLoader.This abstract element defines a variable declaration.
This code element defines an access to a variable (read and write).
This code element defines an read access to a variable.
This interface defines a reference to a
CtVariable
or sub-type.This code element defines a write to a variable.
Define a visitable element in spoon.
This interface defines the visitor for the Spoon metamodel, as defined in
spoon.reflect.declaration
, spoon.reflect.code
, and
spoon.reflect.reference
.This code element defines a
while
loop.Represents a wildcard in generic type annotations, i.e.
This code element defines a
yield
statement.CtYieldStatementImpl
Represents the position of a program element in a source file in an immutable manner.
This class represents the position of a Java program element in a source
file.
Compares based on a toString representation.
This class implements a default core factory for Spoon's meta-model.
Drives generation process
Defines order of imports:
1) imports are ordered alphabetically
2) static imports are last
A visitor for generating Java code from the program compile-time model.
Default behavior for the destination of the spoon.
A default dumb implementation of
SourceFragmentPrinter
, which only prints the given PrinterEvent.Implementation of
TokenWriter
, which writes all tokens to PrinterHelper
defines the delete action
defines the delete all action.
Tells that a metamodel property is derived, ie computed from the value of another property.
A filter for
CtReference
s that compare equal to the reference provided in the constructor.Extends
CtScanner
, to support early termination of scanning process and scan listeners.This class is for internal use only.
Generates/Matches a copy of a single CtElement AST node with all it's children (whole AST tree of the root CtElement)
Represents an action of Printer, which prints whole element
Whether to print generic types for references.
Represents a part of source code of an
CtElement
It is connected into a tree of ElementSourceFragment
s.is the listener that creates the action on the model.
The
CtEnum
sub-factory.This interface represents the environment in which Spoon is launched -
accessible through
Factory.getEnvironment()
.Drives how the model is pretty-printed to disk, or when
CtElement.prettyprint()
is calledUsed to check equality between an element and another one.
A factory to create some evaluation utilities on the Spoon metamodel.
The
CtExecutable
sub-factory.This filter matches all the
CtExecutableReference
referencing defined one or more CtExecutable
s.Tells that a type has recently been introduced and may be subject to non-backward compatible changes without deprecation.
This class represents an expression template parameter expressed in Java.
Inserts all the methods, fields, constructors, initialization blocks (if
target is a class), inner types, and super interfaces (except
Template
) from a given template by substituting all the template
parameters by their values.Provides the sub-factories required by Spoon.
This interface represents an object that can access the meta-model factory.
Implements
Factory
This simple filter matches all the accesses to a given field.
The
CtField
sub-factory.This Query expects a
CtField
as input
and returns all CtFieldReference
s, which refers this input.This Query expects a
CtField
as input
and returns all CtElements,
which are in visibility scope of that field.This interface should be implemented by processing tasks that generate new
files as processing results.
This interface defines a filter for program elements.
A filtering resource, see https://github.com/INRIA/spoon/issues/877
This enumeration defines the possible composition operators for filters.
Can be subclassed by clients who want to be notified on all changes in AST nodes
FluentLauncher provides a different, fluent interface for the launcher class.
Forces fully qualified identifiers by making many elements explicit (by calling setImplicit(false)).
Marks all types references as implicit so all types will get imported.
Pattern node of multiple occurrences of the same model, just with different parameters.
Generates code from patterns.
Provides adapting of generic types from one scope to another scope.
Responsible for computing CtElement.hashCode().
An immutable map.
Internal class only, not in the public API.
Updates list of import statements of compilation unit following
CtElement.isImplicit()
.Detects conflicts needed to be required be a fully-qualified name.
Used to compute the imports required to write readable code with no fully qualified names.
A scanner that calculates the imports for a given model.
Create a Spoon launcher for incremental build
Utility class for detecting the indentation style used in a compilation unit.
Builds inline statements of Pattern
For example if the `for` statement in this pattern model
Represents a kind of
RootNode
,
whose AST statements are understood as pattern statements.Simplifies an AST inline based on
VisitorPartialEvaluator
(wanring: the nodes are changed).The
CtInterface
sub-factory.Tells that an element is not in the public API (even if it has Java visibility "public")
Required because package-visibility is too coarse-grained.
Thrown when replacing of element by another element is not possible
This class is used to represent the constructor of an array when calling with an expression like
This simple filter matches all the accesses to a given executable or any
executable that overrides it.
The structured content of a single Javadoc comment.
A block tag.
A javadoc text, potentially containing inline tags.
An element of a description: either an inline tag or a piece of text.
An inline tag contained in a Javadoc description.
The type of tag: it could either correspond to a known tag (code, docRoot, etc.) or represent
an unknown tag.
A piece of text inside a Javadoc description.
This enum defines the Java keywords and some helper method to determine if
some strings are Java identifiers.
A processor that generates compilable Java source files from the meta-model.
Builds Spoon model from class file using the reflection api.
Main class of Spoon to build the model.
Helper to build arguments for the JDT compiler.
The comment builder that will insert all element of a CompilationUnitDeclaration into the Spoon AST
Extracts a subset of constants as defined in
TypeConstants
, since
this class is only meant for internal use.A visitor for iterating through the parse tree.
This exception is thrown when an operation on a
CtElement
transfers it in an invalid state.This filter matches all the
CtLambda
elements, which implements defined interface(s)This class implements an integrated command-line launcher for processing
programs at compile-time using the JDT-based builder (Eclipse).
Enum for representing logging levels.
Represents that a lexical scope in the language
Note that scopes are changing after variable declaration.
A
CtScanner
which provides current lexical scope
of currently scanned AST node.This filter matches all elements that can be considered as line of code (e.g.
defines a list context
List of
RootNode
s.Helper which assures consistent printing of lists
prefixed with `start`, separated by `separator` and suffixed by `end`.
If there is no item in the list then it prints `start` and then `end`
If there is one item in the list then it prints `start`, item and then `end`
If there is more then one items in the list then it prints `start`, items separated by `separator` and then `end`
If there is no item in the list then it prints `start` and then `end`
If there is one item in the list then it prints `start`, item and then `end`
If there is more then one items in the list then it prints `start`, items separated by `separator` and then `end`
This annotation should be placed on templates' members to indicate that they
are local elements of the template class.
This mapping function expects a
CtLocalVariable
as input
and returns all CtLocalVariableReference
s, which refers this input.This Query expects a
CtLocalVariable
as input
and returns all CtElements,
which are in visibility scope of that local variable."It was from the artists and poets that the pertinent answers came"
In Spoon, we do believe that poetry has a place in software.
defines the map context
Represents a ValueResolver of one Map.Entry
A kind of
ParameterInfo
which returns value by the named parameter
From a container of type ImmutableMap
or Map
Represents a single match of
Pattern
A container of
RootNode
s.Represents a Match of TemplateMatcher
Create a Spoon launcher from a maven pom file
The type of source to consider in the model
Represents the Spoon metamodel (incl.
Represents a concept of the Spoon metamodel (eg
CtClass
).Represents a property of the Spoon metamodel.
Tells that a field is a property of the metamodel
For instance
CtNamedElementImpl.getSimpleName()
is the property name of CtNamedElement
This class is for the call state of a method.
The
CtMethod
sub-factory.Class for creating a mapping from CtExecutable to all known calls from fields
and methods.
For the scope method or constructor and super type hierarchy of it's declaring type,
it is able to adapt type parameters.
Represents a method used to get or set a
MetamodelProperty
of a MetamodelConcept
.Represents the type of metamodel method.
thrown when the Spoon model of a program cannot be built
This scanner checks that a program model is consistent with regards to the
parent elements (children must have the right parent).
Recommended default capacities for containers (primarily
ArrayList
)
of AST model elements.The implementation of the
List
, which is used by Spoon model objects.Deprecated.
This set is no longer actively used or maintained.
This interface defines the protocol to save and load a factory and it's
associated model through output and input streams.
represents whether a
SourceFragment
has been modified, and should be reprinted as is or with the normal pretty-printerRepresents a modifier on the declaration of a program element such as a
class, method, or field.
TokenWriter
which simply delegates
to DefaultTokenWriter
with the decorator pattern, until MutableTokenWriter.setMuted(boolean)
is called with true
Then all tokens are ignored.Filters elements by name and by type (for instance to find a method).
Filters elements by name (for instance to find a method).
This annotation is used to mark a workaround for the lack of a correct classpath so called noclasspathmode.
This annotation is used to mark a workaround for the lack of a correct classpath so called noclasspathmode.
This class represents the position of a program element in a source file.
Computes source code representation of the operator
Types of output.
Gets all overridden method from the method given.
Gets all overridden method from the method given.
Gets all overriding method from the method given.
The
CtPackage
sub-factory.This annotation should be placed on templates' fields or methods to indicate
that they represent template parameters.
Computes a value of
ComputedParameterInfo
I - type of input value
O - type of computed valueRepresents the parameter of
Pattern
defines acceptable value of parameter value during matching.Represents pattern model variable
Delivers/Matches 0, 1 or more values of defined parameter.
This Query expects a
CtParameter
as input
and returns all CtParameterReference
s, which refers this input.This class defines an API to manipulate template parameters.
This Query expects a
CtParameter
as input
and returns all CtElements,
which are in visibility scope of that parameter.This annotation defines a method that returns the parent of an element of the
meta model.
This Function expects a
CtElement
as input
and returns all parents of this element.This exception is thrown when the parent of an element has not been correctly
initialized.
This interface defines a simple partial evaluator on the Spoon Java model.
This class intends to create a source position containing only a compilation unit.
Represents a pattern for matching code.
The master class to create a
Pattern
instance.Utility class to select parts of AST to be used as a model of a
PatternBuilder
.Used to define pattern parameters.
Generates the source code corresponding to a Pattern's RootNode
Created by bdanglot on 07/07/16.
This mapping function searches for all
CtVariable
instances,
which might be a declaration of an input CtElement
.This interface defines the pretty printers.
Defines API of a primitive matcher - matcher for single target object
Represents an action of PrettyPrinter
Supports configurable printing of text with indentations and line and column counting
The processing manager defines the API to process a program model of a given
Factory
with a set of processors.This visitor implements the code processing engine.
This exception is used to interrupt a processor during its processing.
This interface defines a generic code processor.
An interface to retrieve processor properties.
This annotation shall be used on processor fields to declare them as being
properties (for configuration).
Specifies that a method is an official metamodel getter in the Spoon metamodel.
Specifies that a method is an official metamodel setter in the Spoon metamodel.
The set properties of this set are based on the qualified name of the element inserted.
compares based on names (with a preference for qualified names if available)
Defines a matching strategy for pattern parameters, default is
Quantifier.GREEDY
.This class provides some useful methods to retrieve program elements and
reference through a
CtScanner
-based deep
search.A factory to create some queries on the Spoon metamodel.
Use in
CtQuery.failurePolicy(QueryFailurePolicy)
to define how to handle failureThis processing manager applies the processors one by one from the given root element.
Contains all methods to refactor code elements in the AST.
Thrown when required refactoring would cause model inconsistency
This simple filter matches all the references of a given type.
Filters elements with a regular expression on the element's code.
Defines API of a repeatable matcher.
Interface for the AST node replacement infrastructure.
Used to replace an element by another one.
Container for single or multiple values of required type
Container of multiple values of required type
Container of single value of required type
This simple filter matches all the occurrences of a return or a throw
statement (end of execution flow).
Enables client code to get and set a field based on a role for a CtElement.
Provides a
RoleHandler
implementation for the pair of CtElement
implementation and CtRole
The returned RoleHandler
can be then used to manipulate value of attribute represented by CtRole
on the CtElement
instanceThis annotation defines an element as Root of the meta model.
Represents a parameterized Pattern ValueResolver, which can be used
to generate a zero, one or more copies of model using provided parameters
to match zero, one or more instances of model and deliver a matching parameters
This class is a helper for runtime reflection.
To be compatible with Java 6, RtParameter has been created from
the Parameter class in Java 8.
This processing manager implements a blocking processing policy that consists
of applying the processors in a FIFO order until no processors remain to be
applied.
Finds the element given in parameter, useful for checking if an element is in an ancestor.
Defines how a
CtScannerListener
drives the scanning of EarlyTerminatingScanner
This class provides a regular Java serialization-based implementation of the
model streamer.
visits siblings of input element.
Defines visiting mode
maintains unicity with method signatures
Compares executables (method, executable-references) based on a signature.
Responsible for computing signatures for elements where a signature exists
(CtType, CtMethod and CtPackage).
a
ParameterComputer
which computes simpleName of CtTypeReference
PrettyPrinter
implementation, which copies as much as possible from the origin sources
and tries to only print the changed elements.Helper class for working with snippets
Represents a part of source code.
Handles printing of changes of the ordered list of elements.
Knows how to print modified
CtElement
by the way that origin formatting is kept as much as possible.A
ChangeCollector
, which builds a tree of ElementSourceFragment
s of CompilationUnit
of the modified element
lazily just before the element is changedAn object that knows how to print
PrinterEvent
This interface represents the position of a program element in a source file.
This interface represents an element which knows its position in a source file.
This immutable class represents the position of a Java program element in a source
file.
Is the core entry point of Spoon.
Spoon-specific ClassNotFoundException (mostly encapsulates a ClassNotFoundException or a NoClassDefFoundError
as a runtime exception)
is a generic runtime exception for Spoon
This interface represents files that can be used as resources for the Spoon
compiler.
A Spoon resource that represents a folder.
Visitor that generates factory calls to recreate the AST visited.
Responsible for building a spoon model from Java source code.
The types of compilable elements
FILES - compiles the java files from the file system, which were registered by
SpoonModelBuilder.addInputSource(File)
and SpoonModelBuilder.addTemplateSource(File)
CTTYPES - compiles virtual java files, which are dynamically generated from the all top level classes of the CtModel by DefaultJavaPrettyPrinter
Additional options for maven invocations.
is the interface to follow the progress of the creation of the Spoon model.
This interface defines generic resources that are used by
SpoonModelBuilder
in the Java compilation process.This class defines a helper for manipulating resources.
Creates an empty class spoon.Spoon
This class implements a simple Spoon environment that reports messages in the
standard output stream (Java-compliant).
This class represents a template parameter that defines a statement list
directly expressed in Java (no returns).
Delivers single String value, which is created by replacing string markers in constant String template
by String value of appropriate parameter.
This class is the superclass for all the sub-factories of
Factory
.Expects a
The output is produced in arbitrary order.
CtTypeInformation
as input
and produces all sub classes and sub interfaces recursively.The output is produced in arbitrary order.
Expects a
The repeated processing of this mapping function on the same input returns only newly found sub types.
CtPackage
as input
and upon calls to forEachSubTypeInPackage produces all sub classes and sub interfaces,
which extends or implements super type(s) provided by call(s) of SubInheritanceHierarchyResolver.addSuperType(CtTypeInformation)
and stored as `targetSuperTypes`.The repeated processing of this mapping function on the same input returns only newly found sub types.
This class defines the substitution API for templates (see
Template
).Maps AST model object to the
RootNode
Matches all CtType elements, which are sub type of
SubtypeFilter.superType
Matches the input `superType` too.Expects a
The output is produced in following order: input type.
CtTypeInformation
as input
and produces all super classes and super interfaces recursively.The output is produced in following order: input type.
Implementation of
CtScannerListener
,
which is used to assure that each interface is visited only once.List of conditional cases
{code}
if (a) {
...
A template code is simply a piece of code that uses a
TemplateParameter
's instance.This runtime exception can be throws when something wrong occurs in template
operations such as loading, substitution, and matching.
This class defines an engine for matching a template to pieces of code.
This interface defines a typed template parameter.
Describes what next has to be matched.
Represents an action of Printer, which prints a token
a
SourceFragment
of some primitive String token,
like separator, operator, whitespace, ...Type of
TokenSourceFragment
token.Responsible for writing a token while pretty-printing.
Wraps a `tokenWriter` by an implementation which intercepts all
TokenWriter
writeXxx(String) calls
and calls TokenWriterProxy.Listener.onTokenWriterWrite(TokenType, String, CtComment, Runnable)
where Runnable
can be used to invoke same event on the wrapped TokenWriter
Listens for each call of
TokenWriter
This enumeration defines the traversal strategies available for a processor.
Determines subtyping relationships and adapts generics from a super- to a subclass.
The
CtType
sub-factory.This simple filter matches all the elements of a given type.
A scanner that calculates the imports for a given model.
This enumeration defines all the kinds of unary operators.
Tells that a metamodel property (ie a getter in metamodel interface) is unsettable because it does not make sense for a certain metamodel element.
defines the update action
Converts the individual parameter values to required type after substitution
Converts the matching model values to parameter values during matching process
Converts the individual parameter values to required type
This simple filter matches all the accesses to a given variable.
The mapping function, accepting
CtVariable
CtLocalVariable - local variable declared in body
CtField - member field of an type
CtParameter - method parameter
CtCatchVariable - try - catch variable
and returning all the CtVariableReference
, which refers this variableThe mapping function, accepting
CtVariable
CtLocalVariable - local variable declared in body
CtParameter - method parameter
CtCatchVariable - try - catch variable
and returning all the CtElements, which exists in visibility scope of this variable.Simplifies an AST by performing all operations that are statically known and changes the AST accordingly (eg "0+1" -> "1")
This visitor implements a simple partial evaluator for the program
compile-time metamodel.