Package | Description |
---|---|
spoon |
This root package provides the default integrated launchers for Spoon program processing.
|
spoon.compiler |
This package defines interfaces for Java file compilation with Spoon.
|
spoon.experimental |
this is unstable code, subject to potential complete redesign, not only in snapshots but also in releases.
|
spoon.metamodel |
Ready to go meta?
This package contains classes that model the Spoon metamodel itself.
|
spoon.pattern | |
spoon.pattern.internal | |
spoon.pattern.internal.matcher | |
spoon.pattern.internal.node | |
spoon.processing |
This package contains the core API for code processing.
|
spoon.reflect |
This package defines the Spoon's compile-time meta-model of Java programs.
|
spoon.reflect.code |
This package contains the meta-model part that models the executable code (methods and constructors' bodies, field initializers).
|
spoon.reflect.cu |
This package defines compilation units that hold the source code and some classes around them (in most cases, these features should be ignored by the programmers).
|
spoon.reflect.cu.position | |
spoon.reflect.declaration |
This package contains the meta-model part that models the declarations (program's structures such as classes, fields, etc).
|
spoon.reflect.eval |
This package defines some evaluators for the Spoon meta-model.
|
spoon.reflect.factory |
This package defines all the sub-factories for the Spoon meta-model.
|
spoon.reflect.meta.impl | |
spoon.reflect.path | |
spoon.reflect.path.impl | |
spoon.reflect.reference |
This package defines the references to program elements for the meta-model.
|
spoon.reflect.visitor |
This package defines visitor, scanner, and scanner-based query API for Java programs reified in the meta-model.
|
spoon.reflect.visitor.chain | |
spoon.reflect.visitor.filter |
This package contains a set of useful filters when querying the model.
|
spoon.support |
This package contains some default implementations for commonly used processing tasks.
|
spoon.support.comparator | |
spoon.support.compiler.jdt | |
spoon.support.gui | |
spoon.support.modelobs | |
spoon.support.modelobs.context | |
spoon.support.reflect |
This package provides an implementation of the spoon.reflect package.
|
spoon.support.reflect.code | |
spoon.support.reflect.cu | |
spoon.support.reflect.declaration | |
spoon.support.reflect.eval | |
spoon.support.reflect.reference | |
spoon.support.sniper |
This package provides support for the sniper mode: only the transformed part of classes is rewritten to disk.
|
spoon.support.sniper.internal | |
spoon.support.util | |
spoon.support.visitor | |
spoon.support.visitor.clone | |
spoon.support.visitor.equals | |
spoon.support.visitor.replace | |
spoon.template |
This package defines a framework for well-typed pure-Java templates.
|
spoon.testing | |
spoon.testing.utils |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
SpoonAPI.addProcessor(Processor<T> processor)
Adds an instance of a processor.
|
<T extends CtElement> |
Launcher.addProcessor(Processor<T> processor) |
<T extends CtElement> |
FluentLauncher.processor(java.lang.Iterable<Processor<T>> processors)
Adds an instance of a processor.
|
<T extends CtElement> |
FluentLauncher.processor(Processor<T> processor)
Adds an instance of a processor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<Processor<? extends CtElement>> |
Launcher.getProcessors()
Gets the list of processors instance to be initially applied during the
processing.
|
Modifier and Type | Method and Description |
---|---|
void |
ContractVerifier.checkParentConsistency(CtElement element)
public modifier for testing purpose only, not in the public API
|
Modifier and Type | Method and Description |
---|---|
void |
SpoonModelBuilder.process(java.util.Collection<Processor<? extends CtElement>> processors)
Processes the Java model with the given processors.
|
Modifier and Type | Method and Description |
---|---|
FileGenerator<? extends CtElement> |
Environment.getDefaultFileGenerator()
Returns the default file generator for this environment (gives the
default output directory for the created files).
|
Modifier and Type | Method and Description |
---|---|
void |
Environment.report(Processor<?> processor,
org.slf4j.event.Level level,
CtElement element,
java.lang.String message)
Helper method called by a processor to report an error, warning or
message as dictated by the severity parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
Environment.setDefaultFileGenerator(FileGenerator<? extends CtElement> generator)
Sets the default file generator for this environment.
|
Modifier and Type | Class and Description |
---|---|
class |
CtUnresolvedImport |
Modifier and Type | Method and Description |
---|---|
void |
SpoonifierVisitor.enter(CtElement element) |
void |
SpoonifierVisitor.exit(CtElement element) |
Modifier and Type | Method and Description |
---|---|
java.util.List<CtType<? extends CtElement>> |
Metamodel.getAllInstantiableMetamodelInterfaces() |
Modifier and Type | Method and Description |
---|---|
MetamodelConcept |
Metamodel.getConcept(java.lang.Class<? extends CtElement> clazz) |
static java.lang.String |
Metamodel.getConceptName(java.lang.Class<? extends CtElement> conceptClass) |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
Generator.generate(ImmutableMap params)
Utility method that provides the same feature as
Generator.generate(Map) , but with a ImmutableMap as parameter (a Spoon elegant utility type) |
<T extends CtElement> |
Generator.generate(java.util.Map<java.lang.String,java.lang.Object> params)
Main method to generate a new AST made from substituting of parameters by
the values in `params`
|
Modifier and Type | Method and Description |
---|---|
CtElement |
Match.getMatchingElement() |
Modifier and Type | Method and Description |
---|---|
java.util.List<CtElement> |
Match.getMatchingElements() |
java.util.List<CtElement> |
PatternBuilderHelper.getPatternElements() |
Modifier and Type | Method and Description |
---|---|
PatternParameterConfigurator |
PatternParameterConfigurator.byElement(CtElement... elements)
Elements will be substituted by parameter value
|
PatternParameterConfigurator |
PatternParameterConfigurator.byRole(CtRole role,
CtElement... elements)
Attribute defined by `role` of `element` will be substituted by parameter value
|
PatternParameterConfigurator.ParameterElementPair |
PatternParameterConfigurator.ParameterElementPair.copyAndSet(CtElement element) |
static PatternBuilder |
PatternBuilder.create(CtElement... elems) |
java.util.List<Match> |
Pattern.getMatches(CtElement root)
Finds all target program sub-trees that correspond to this pattern
and returns them.
|
Modifier and Type | Method and Description |
---|---|
static PatternBuilder |
PatternBuilder.create(java.util.List<? extends CtElement> patternModel)
Creates a
PatternBuilder from the List of template elements |
PatternBuilderHelper |
PatternBuilderHelper.keepTypeMembers(Filter<? super CtElement> filter) |
Constructor and Description |
---|
ParameterElementPair(ParameterInfo parameter,
CtElement element) |
Constructor and Description |
---|
PatternBuilder(java.util.List<? extends CtElement> template) |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
DefaultGenerator.generate(ImmutableMap params) |
<T extends CtElement> |
DefaultGenerator.generate(java.util.Map<java.lang.String,java.lang.Object> params) |
Modifier and Type | Method and Description |
---|---|
void |
DefaultGenerator.applyGeneratedBy(CtElement generatedElement,
java.lang.String genBy)
Adds a Generated by comment to the javadoc of generatedElement
|
java.lang.String |
DefaultGenerator.getGeneratedByComment(CtElement ele) |
Modifier and Type | Method and Description |
---|---|
void |
MatchingScanner.scan(CtRole role,
CtElement element) |
Modifier and Type | Method and Description |
---|---|
void |
MatchingScanner.scan(CtRole role,
java.util.Collection<? extends CtElement> elements) |
void |
MatchingScanner.scan(CtRole role,
java.util.Map<java.lang.String,? extends CtElement> elements) |
Modifier and Type | Method and Description |
---|---|
static ElementNode |
ElementNode.create(CtElement element,
java.util.Map<CtElement,RootNode> patternElementToSubstRequests)
Creates an implicit
ElementNode , which contains all non derived attributes of `element` and all it's children |
protected void |
ElementNode.generateSingleNodeAttributes(DefaultGenerator generator,
CtElement clone,
ImmutableMap parameters) |
protected ImmutableMap |
ElementNode.matchesRole(ImmutableMap parameters,
CtElement target,
MetamodelProperty mmField,
RootNode attrNode) |
Modifier and Type | Method and Description |
---|---|
static ElementNode |
ElementNode.create(CtElement element,
java.util.Map<CtElement,RootNode> patternElementToSubstRequests)
Creates an implicit
ElementNode , which contains all non derived attributes of `element` and all it's children |
static ListOfNodes |
ElementNode.create(java.util.List<?> objects,
java.util.Map<CtElement,RootNode> patternElementToSubstRequests)
Same like
ElementNode.create(CtElement, Map) but with List of elements or primitive objects |
static ListOfNodes |
ElementNode.create(java.util.Map<java.lang.String,?> map,
java.util.Map<CtElement,RootNode> patternElementToSubstRequests)
Same like
ElementNode.create(CtElement, Map) but with Map of String to elements or primitive objects |
static ListOfNodes |
ElementNode.create(java.util.Set<?> templates,
java.util.Map<CtElement,RootNode> patternElementToSubstRequests)
Same like
ElementNode.create(CtElement, Map) but with Set of elements or primitive objects |
RootNode |
ElementNode.getOrCreateNodeOfRole(CtRole role,
java.util.Map<CtElement,RootNode> patternElementToSubstRequests) |
Constructor and Description |
---|
ElementNode(MetamodelConcept elementType,
CtElement templateElement) |
Modifier and Type | Class and Description |
---|---|
class |
AbstractAnnotationProcessor<A extends java.lang.annotation.Annotation,E extends CtElement>
This class defines an abstract annotation processor to be subclassed by the
user for defining new annotation processors including Java 8 annotations.
|
class |
AbstractParallelProcessor<E extends CtElement>
AbstractParallelProcessor allows using multiple threads for concurrent
processing with
AbstractProcessor . |
class |
AbstractProcessor<E extends CtElement>
This class defines an abstract processor to be subclassed by the user for
defining new processors.
|
interface |
AnnotationProcessor<A extends java.lang.annotation.Annotation,E extends CtElement>
This interface defines an annotation processor.
|
interface |
FileGenerator<T extends CtElement>
This interface should be implemented by processing tasks that generate new
files as processing results.
|
interface |
Processor<E extends CtElement>
This interface defines a generic code processor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Class<? extends CtElement>> |
Processor.getProcessedElementTypes()
Gets all the element types than need to be processed.
|
java.util.Set<java.lang.Class<? extends CtElement>> |
AbstractProcessor.getProcessedElementTypes() |
java.util.Set<java.lang.Class<? extends CtElement>> |
AbstractManualProcessor.getProcessedElementTypes()
Invalid method in this context.
|
Modifier and Type | Method and Description |
---|---|
boolean |
AbstractManualProcessor.isToBeProcessed(CtElement candidate)
Always returns false in this context.
|
void |
ProcessingManager.process(CtElement element)
Recursively processes a
CtElement with this manager. |
void |
AbstractManualProcessor.process(CtElement element)
Does nothing in this context.
|
Modifier and Type | Method and Description |
---|---|
protected void |
AbstractProcessor.addProcessedElementType(java.lang.Class<? extends CtElement> elementType)
Adds a processed element type.
|
protected void |
AbstractManualProcessor.addProcessedElementType(java.lang.Class<? extends CtElement> elementType)
Invalid method in this context.
|
void |
ProcessingManager.process(java.util.Collection<? extends CtElement> elements)
Recursively processes a collection of
CtElement s with this
manager. |
protected void |
AbstractProcessor.removeProcessedElementType(java.lang.Class<? extends CtElement> elementType)
Removes a processed element type.
|
Modifier and Type | Class and Description |
---|---|
static class |
CtModelImpl.CtRootPackage |
Modifier and Type | Method and Description |
---|---|
<R extends CtElement> |
CtModelImpl.filterChildren(Filter<R> filter) |
<E extends CtElement> |
CtModelImpl.getElements(Filter<E> filter) |
<E extends CtElement> |
CtModel.getElements(Filter<E> filter)
Returns all the model elements matching the filter.
|
Modifier and Type | Interface and Description |
---|---|
interface |
CtAbstractInvocation<T>
This code element defines an abstract invocation on a
CtExecutable . |
interface |
CtAbstractSwitch<S>
This code element defines an abstract switch
(either switch statement or switch expression).
|
interface |
CtAnnotationFieldAccess<T>
This code element defines an access to a annotation parameter variable.
|
interface |
CtArrayAccess<T,E extends CtExpression<?>>
This code element defines a one-dimensional array access.
|
interface |
CtArrayRead<T>
This code element defines a read access to an array.
|
interface |
CtArrayWrite<T>
This code element defines a write access to an array.
|
interface |
CtAssert<T>
This code element defines an assert clause.
|
interface |
CtAssignment<T,A extends T>
This code element defines an assignment.
|
interface |
CtBinaryOperator<T>
This interface defines a binary operator.
|
interface |
CtBlock<R>
This code element represents a block of code, that is to say a list of
statements enclosed in curly brackets.
|
interface |
CtBodyHolder
This abstract code element defines an element, which contains a body
|
interface |
CtBreak
This code element defines a break statement.
|
interface |
CtCase<S>
This code element defines a case within a switch-case.
|
interface |
CtCatch
This code element defines a
catch of a try . |
interface |
CtCatchVariable<T>
This code element defines an exception variable in a catch.
|
interface |
CtCFlowBreak
This abstract code element represents all the statements that break the
control flow of the program.
|
interface |
CtCodeElement
This interface is the root interface of the code elements.
|
interface |
CtCodeSnippetExpression<T>
This element is a code snippet that must represent an expression and can thus
be inserted in the program's model as is.
|
interface |
CtCodeSnippetStatement
This element is a code snippet that must represent a statement and can thus
be inserted in the program's model as is.
|
interface |
CtComment
This code element defines a comment
Example:
int x = 0;
// a comment
|
interface |
CtConditional<T>
This code element defines conditional expressions using the ? (ternary expressions).
|
interface |
CtConstructorCall<T>
This code element represents a constructor call.
|
interface |
CtContinue
This code element defines the continue statement.
|
interface |
CtDo
This code element defines a
do loop. |
interface |
CtExecutableReferenceExpression<T,E extends CtExpression<?>>
This abstract code element defines an expression which represents an executable reference.
|
interface |
CtExpression<T>
This abstract code element defines a typed expression.
|
interface |
CtFieldAccess<T>
This code element defines an access to a field variable (read and write)
|
interface |
CtFieldRead<T>
This code element defines a read access to a field.
|
interface |
CtFieldWrite<T>
This code element defines a write access to a field.
|
interface |
CtFor
This code element defines a for loop.
|
interface |
CtForEach
This code element defines a foreach statement.
|
interface |
CtIf
This code element represents an
if statement. |
interface |
CtInvocation<T>
This code element defines a concrete invocation.
|
interface |
CtJavaDoc
This code element defines a javadoc comment
Example:
|
interface |
CtJavaDocTag
This code element defines a javadoc tag
Example:
|
interface |
CtLabelledFlowBreak
This abstract code element represents all the statements that break the
control flow of the program and which can support a label.
|
interface |
CtLambda<T>
This code element represents the creation of a lambda.
|
interface |
CtLiteral<T>
This code element defines a literal value (an int, a string, etc).
|
interface |
CtLocalVariable<T>
This code element defines a local variable definition (within an executable
body).
|
interface |
CtLoop
This abstract code element defines a loop.
|
interface |
CtNewArray<T>
This code element defines the inline creation of a new array.
|
interface |
CtNewClass<T>
This code element represents the creation of a anonymous class.
|
interface |
CtOperatorAssignment<T,A extends T>
This code element defines an self-operated assignment such as += or *=.
|
interface |
CtReturn<R>
This code element represents a
return statement. |
interface |
CtStatement
This abstract code element represents all the statements, which can be part
of a block.
|
interface |
CtStatementList
This code element represents a list of statements.
|
interface |
CtSuperAccess<T>
This code element defines an access to super.
|
interface |
CtSwitch<S>
This code element defines a switch statement.
|
interface |
CtSwitchExpression<T,S>
This code element defines a switch expression.
|
interface |
CtSynchronized
This code element defines a
synchronized statement. |
interface |
CtTargetedExpression<T,E extends CtExpression<?>>
This abstract code element defines an expression which contains a target
expression.
|
interface |
CtTextBlock
This code element defines a Text Block String Literal.
|
interface |
CtThisAccess<T>
This code element defines an access to this.
|
interface |
CtThrow
This code element defines a
throw statement. |
interface |
CtTry
This code element defines a
try statement. |
interface |
CtTryWithResource
This code element defines a
try with resource statement. |
interface |
CtTypeAccess<A>
This code element represents a type reference usable as an expression.
|
interface |
CtUnaryOperator<T>
This code element represents a unary operator.
|
interface |
CtVariableAccess<T>
This code element defines an access to a variable (read and write).
|
interface |
CtVariableRead<T>
This code element defines an read access to a variable.
|
interface |
CtVariableWrite<T>
This code element defines a write to a variable.
|
interface |
CtWhile
This code element defines a
while loop. |
interface |
CtYieldStatement
This code element defines a
yield statement. |
Modifier and Type | Method and Description |
---|---|
<E extends CtElement> |
CtTypeAccess.setImplicit(boolean implicit)
Calls
CtTypeAccess.getAccessedType() .setImplicit() |
Modifier and Type | Interface and Description |
---|---|
interface |
CompilationUnit
Deprecated.
|
Modifier and Type | Class and Description |
---|---|
static class |
NoSourcePosition.NullCompilationUnit |
Modifier and Type | Interface and Description |
---|---|
interface |
CtAnnotation<A extends java.lang.annotation.Annotation>
This element represents an annotation on an element.
|
interface |
CtAnnotationMethod<T>
This element defines an annotation method declared in an annotation type.
|
interface |
CtAnnotationType<T extends java.lang.annotation.Annotation>
This element defines an annotation type.
|
interface |
CtAnonymousExecutable
This element defines an anonymous executable block declaration in a class.
|
interface |
CtClass<T>
This element represents a class declaration.
|
interface |
CtCompilationUnit
Defines a compilation unit.
|
interface |
CtConstructor<T>
This element defines a constructor declaration.
|
interface |
CtEnum<T extends java.lang.Enum<?>>
This element represents an enumeration declaration.
|
interface |
CtEnumValue<T>
Corresponds to one enum value specified in an enumeration.
|
interface |
CtExecutable<R>
This element represents an executable element such as a method, a
constructor, or an anonymous block.
|
interface |
CtField<T>
This element defines a field declaration.
|
interface |
CtFormalTypeDeclarer
This abstract element defines a declaration that accepts formal type
parameters (aka generics), such as a CtType (
class A<E> ), CtMethod or CtConstructor. |
interface |
CtImport
This element represents an import declaration.
|
interface |
CtInterface<T>
This element defines an interface declaration.
|
interface |
CtMethod<T>
This element defines a method declaration.
|
interface |
CtModifiable
This interface defines an element that accepts modifiers.
|
interface |
CtModule
Represents a Java module as defined in Java 9.
|
interface |
CtModuleDirective
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 . |
interface |
CtModuleRequirement
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.
|
interface |
CtMultiTypedElement
Defined an element with several types.
|
interface |
CtNamedElement
Declares an element that has a name (a class, a method, a variable, etc).
|
interface |
CtPackage
This element defines a package declaration.
|
interface |
CtPackageDeclaration
This element represents an package declaration.
|
interface |
CtPackageExport
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.
|
interface |
CtParameter<T>
This element defines an executable parameter declaration.
|
interface |
CtProvidedService
Represents a provided service in a
CtModule . |
interface |
CtType<T>
This abstract element defines a super-type for classes and interfaces, which
can declare methods.
|
interface |
CtTypedElement<T>
This abstract element defines a typed element.
|
interface |
CtTypeMember
This interface represents a member of a class (field, method,
nested class or static/instance initializer).
|
interface |
CtTypeParameter
This element defines a declaration of a type parameter (aka generics).
|
interface |
CtUsedService
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. |
interface |
CtVariable<T>
This abstract element defines a variable declaration.
|
Modifier and Type | Method and Description |
---|---|
<E extends CtElement> |
CtElement.addAnnotation(CtAnnotation<? extends java.lang.annotation.Annotation> annotation)
Add an annotation for this element
|
<E extends CtElement> |
CtElement.addComment(CtComment comment)
Add a comment to the current element
element.addComment(element.getFactory().Code().createComment("comment", CtComment.CommentType.INLINE) |
<E extends CtElement> |
CtElement.getAnnotatedChildren(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets the child elements annotated with the given annotation type's
instances.
|
<E extends CtElement> |
CtElement.getElements(Filter<E> filter)
Returns all the children elements recursively matching the filter.
|
<P extends CtElement> |
CtElement.getParent(java.lang.Class<P> parentType)
Gets the first parent that matches the given type.
|
<E extends CtElement> |
CtElement.getParent(Filter<E> filter)
Gets the first parent that matches the filter.
|
<E extends CtElement> |
CtElement.putMetadata(java.lang.String key,
java.lang.Object val)
Saves metadata inside an Element.
|
<E extends CtElement> |
CtElement.removeComment(CtComment comment)
Remove a comment
|
<E extends CtElement> |
CtElement.replace(java.util.Collection<E> elements)
Replaces this element by several elements.
|
<E extends CtElement> |
CtElement.setAllMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
Saves a bunch of metadata inside an Element
|
<E extends CtElement> |
CtElement.setAnnotations(java.util.List<CtAnnotation<? extends java.lang.annotation.Annotation>> annotation)
Sets the annotations for this element.
|
<E extends CtElement> |
CtElement.setComments(java.util.List<CtComment> comments)
Set the comment list
|
<E extends CtElement> |
CtElement.setDocComment(java.lang.String docComment)
Sets the text of the documentation ("javadoc") comment of this
declaration.
|
<E extends CtElement> |
CtElement.setImplicit(boolean b)
Sets this element to be implicit.
|
<E extends CtElement> |
CtElement.setParent(E parent)
Manually sets the parent element of the current element.
|
<E extends CtElement> |
CtCompilationUnit.setParent(E parent) |
<E extends CtElement> |
CtElement.setPosition(SourcePosition position)
Sets the position in the Java source file.
|
<E extends CtElement> |
CtCompilationUnit.setPosition(SourcePosition position) |
<E extends CtElement> |
CtElement.setPositions(SourcePosition position)
Sets the position of this element and all its children element.
|
<E extends CtElement,T> |
CtElement.setValueByRole(CtRole role,
T value)
Sets a field according to a role.
|
Modifier and Type | Method and Description |
---|---|
CtElement |
CtElement.clone()
Clone the element which calls this method in a new object.
|
CtElement |
CtAnnotation.getAnnotatedElement()
Returns the element which is annotated by this annotation.
|
CtElement |
CtElement.getParent()
Gets the parent of current reference.
|
CtElement |
CtCompilationUnit.getParent() |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<CtElement> |
CtElement.asIterable()
Returns an Iterable instance of this CtElement, allowing for dfs traversal of its descendants.
|
java.util.Iterator<CtElement> |
CtElement.descendantIterator()
Returns an iterator over this CtElement's descendants.
|
java.util.List<CtElement> |
CtElement.getDirectChildren() |
Modifier and Type | Method and Description |
---|---|
static CtAnnotatedElementType |
CtAnnotation.getAnnotatedElementTypeForCtElement(CtElement element) |
boolean |
CtElement.hasParent(CtElement candidate)
Tells if the given element is a direct or indirect parent.
|
void |
CtElement.replace(CtElement element)
Replaces this element by another one.
|
Modifier and Type | Method and Description |
---|---|
<R extends CtElement> |
PartialEvaluator.evaluate(R element)
Partially evaluates an element and all its sub-elements.
|
Modifier and Type | Class and Description |
---|---|
static class |
ModuleFactory.CtUnnamedModule |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
CoreFactory.clone(T element)
Recursively clones a given element of the metamodel and all its child
elements.
|
Modifier and Type | Method and Description |
---|---|
CtElement |
CoreFactory.create(java.lang.Class<? extends CtElement> klass)
Creates an instance of the concrete metamodel class given as parameter.
|
CtElement |
Factory.createElement(java.lang.Class<? extends CtElement> klass) |
CtElement |
FactoryImpl.createElement(java.lang.Class<? extends CtElement> klass) |
CtElement |
ModuleFactory.CtUnnamedModule.getParent() |
Modifier and Type | Method and Description |
---|---|
<A extends java.lang.annotation.Annotation> |
AnnotationFactory.annotate(CtElement element,
java.lang.Class<A> annotationType)
Adds an annotation to an element.
|
<A extends java.lang.annotation.Annotation> |
AnnotationFactory.annotate(CtElement element,
java.lang.Class<A> annotationType,
java.lang.String annotationElementName,
java.lang.Object value)
Creates/updates an element's annotation value.
|
<A extends java.lang.annotation.Annotation> |
AnnotationFactory.annotate(CtElement element,
CtTypeReference<A> annotationType)
Adds an annotation to an element.
|
<A extends java.lang.annotation.Annotation> |
AnnotationFactory.annotate(CtElement element,
CtTypeReference<A> annotationType,
java.lang.String annotationElementName,
java.lang.Object value)
Creates/updates an element's annotation value.
|
Modifier and Type | Method and Description |
---|---|
CtElement |
CoreFactory.create(java.lang.Class<? extends CtElement> klass)
Creates an instance of the concrete metamodel class given as parameter.
|
CtElement |
Factory.createElement(java.lang.Class<? extends CtElement> klass) |
CtElement |
FactoryImpl.createElement(java.lang.Class<? extends CtElement> klass) |
Modifier and Type | Method and Description |
---|---|
static RoleHandler |
RoleHandlerHelper.getRoleHandlerWrtParent(CtElement element) |
Modifier and Type | Method and Description |
---|---|
static RoleHandler |
RoleHandlerHelper.getOptionalRoleHandler(java.lang.Class<? extends CtElement> targetClass,
CtRole role) |
static RoleHandler |
RoleHandlerHelper.getRoleHandler(java.lang.Class<? extends CtElement> targetClass,
CtRole role) |
static java.util.List<RoleHandler> |
RoleHandlerHelper.getRoleHandlers(java.lang.Class<? extends CtElement> targetClass) |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
CtPath.evaluateOn(CtElement... startNode)
Search for elements matching this CtPatch from start nodes given as parameters.
|
<T extends CtElement> |
CtPathBuilder.type(java.lang.Class<T> type,
java.lang.String[]... args)
Match on element of a given type.
|
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
CtPath.evaluateOn(CtElement... startNode)
Search for elements matching this CtPatch from start nodes given as parameters.
|
CtPath |
CtElementPathBuilder.fromElement(CtElement el)
Build absolute path to a CtElement el.
|
CtPath |
CtElementPathBuilder.fromElement(CtElement el,
CtElement root)
Build path to a CtElement el, from one of its parent.
|
CtRole |
CtRole.getMatchingSubRoleFor(CtElement item) |
CtPath |
CtPath.relativePath(CtElement parent)
Returns the path that is relative to the given element (subpath from it to the end of the path).
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractPathElement<P extends CtElement,T extends CtElement>
Partial implementation for CtPathElement
|
class |
AbstractPathElement<P extends CtElement,T extends CtElement>
Partial implementation for CtPathElement
|
interface |
CtPathElement<P extends CtElement,T extends CtElement>
A single path element from a CtPath.
|
interface |
CtPathElement<P extends CtElement,T extends CtElement>
A single path element from a CtPath.
|
class |
CtTypedNameElement<P extends CtElement,T extends CtElement>
spoon.reflect.path.impl.CtPathElement that match on CtNamedElement
|
class |
CtTypedNameElement<P extends CtElement,T extends CtElement>
spoon.reflect.path.impl.CtPathElement that match on CtNamedElement
|
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
CtPathImpl.evaluateOn(CtElement... startNode) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<CtElement> |
CtRolePathElement.getElements(java.util.Collection<CtElement> roots) |
java.util.Collection<CtElement> |
CtNamedPathElement.getElements(java.util.Collection<CtElement> roots) |
java.util.Collection<CtElement> |
CtNamedPathElement.scanElements(java.util.Collection<? extends CtElement> roots) |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
CtPathImpl.evaluateOn(CtElement... startNode) |
CtPath |
CtPathImpl.relativePath(CtElement parent) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<CtElement> |
CtRolePathElement.getElements(java.util.Collection<CtElement> roots) |
java.util.Collection<CtElement> |
CtNamedPathElement.getElements(java.util.Collection<CtElement> roots) |
java.util.Collection<CtElement> |
CtNamedPathElement.scanElements(java.util.Collection<? extends CtElement> roots) |
Modifier and Type | Interface and Description |
---|---|
interface |
CtArrayTypeReference<T>
This interface defines a reference to an array.
|
interface |
CtCatchVariableReference<T>
This interface defines a reference to
CtCatchVariable . |
interface |
CtExecutableReference<T>
This interface defines a reference to a
CtExecutable . |
interface |
CtFieldReference<T>
This interface defines a reference to a
CtField . |
interface |
CtIntersectionTypeReference<T>
This interface defines a reference to an intersection type in generics or in casts.
|
interface |
CtLocalVariableReference<T>
This interface defines a reference to
CtLocalVariable . |
interface |
CtModuleReference
Represents a reference to a
CtModule |
interface |
CtPackageReference
This interface defines a reference to a
CtPackage . |
interface |
CtParameterReference<T>
This interface defines a reference to a
CtParameter of a method. |
interface |
CtReference
This is the root interface for named program element references.
|
interface |
CtTypeMemberWildcardImportReference
This interface defines a import reference to all static type members of a type.
Example: somePackage.Type.*; |
interface |
CtTypeParameterReference
This interface defines a reference to a type parameter (aka generics).
|
interface |
CtTypeReference<T>
This interface defines a reference to a
CtType or sub-type. |
interface |
CtUnboundVariableReference<T>
This interface defines a reference to an unbound
CtVariable . |
interface |
CtVariableReference<T>
This interface defines a reference to a
CtVariable or sub-type. |
interface |
CtWildcardReference
Represents a wildcard in generic type annotations, i.e.
|
Modifier and Type | Method and Description |
---|---|
<E extends CtElement> |
CtTypeMemberWildcardImportReference.addAnnotation(CtAnnotation<? extends java.lang.annotation.Annotation> annotation) |
<E extends CtElement> |
CtTypeMemberWildcardImportReference.setAnnotations(java.util.List<CtAnnotation<? extends java.lang.annotation.Annotation>> annotation) |
<E extends CtElement> |
CtUnboundVariableReference.setAnnotations(java.util.List<CtAnnotation<? extends java.lang.annotation.Annotation>> annotation) |
<E extends CtElement> |
CtReference.setComments(java.util.List<CtComment> comments)
comments are not possible for references
|
<E extends CtElement> |
CtTypeMemberWildcardImportReference.setImplicit(boolean b) |
Modifier and Type | Method and Description |
---|---|
CtElement |
CtReference.getDeclaration()
Returns the declaration that corresponds to the referenced element only
if the declaration is in the analyzed source files.
|
Modifier and Type | Interface and Description |
---|---|
interface |
Filter<T extends CtElement>
This interface defines a filter for program elements.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Deque<CtElement> |
CtDequeScanner.elementsDeque
The stack of elements.
|
protected java.util.List<Processor<CtElement>> |
DefaultJavaPrettyPrinter.preprocessors
Handle imports of classes.
|
protected java.util.Deque<CtElement> |
CtBiScannerDefault.stack |
Modifier and Type | Method and Description |
---|---|
static <E extends CtElement> |
Query.getElements(CtElement rootElement,
Filter<E> filter)
Returns all the program elements that match the filter starting from the given rootElement.
|
static <E extends CtElement> |
Query.getElements(Factory factory,
Filter<E> filter)
Within a given factory, returns all the program elements that match the
filter.
|
Modifier and Type | Method and Description |
---|---|
CtElement |
LexicalScope.getScopeElement() |
CtElement |
CtBFSIterator.next()
Dereference the "iterator"
|
CtElement |
CtIterator.next()
Dereference the "iterator"
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Processor<CtElement>> |
DefaultJavaPrettyPrinter.getPreprocessors() |
Modifier and Type | Method and Description |
---|---|
PrinterHelper |
PrinterHelper.adjustEndPosition(CtElement e) |
PrinterHelper |
PrinterHelper.adjustStartPosition(CtElement e)
writes as many newlines as needed to align the line number again between the element position and the current line number
|
void |
DefaultJavaPrettyPrinter.applyPreProcessors(CtElement el)
Warning, this may change the state of the object
|
abstract void |
CtAbstractBiScanner.biScan(CtElement element,
CtElement other)
This method is called to compare `element` and `other` when traversing two trees in parallel.
|
void |
CtBiScannerDefault.biScan(CtElement element,
CtElement other) |
abstract void |
CtAbstractBiScanner.biScan(CtRole role,
CtElement element,
CtElement other)
This method is called to compare `element` and `other` according to the role when traversing two trees in parallel.
|
void |
CtBiScannerDefault.biScan(CtRole role,
CtElement element,
CtElement other) |
void |
ImportScannerImpl.computeImports(CtElement element) |
void |
ImportScanner.computeImports(CtElement element)
Computes import of a
CtElement |
protected void |
EarlyTerminatingScanner.doScan(CtRole role,
CtElement element,
ScanningMode mode)
This method is called ONLY when the listener decides that the current element and children should be visited.
|
protected void |
DefaultJavaPrettyPrinter.enter(CtElement e)
This method is called by
DefaultJavaPrettyPrinter.scan(CtElement) when entering a scanned element. |
protected void |
ImportCleaner.ImportCleanerScanner.enter(CtElement e) |
protected void |
LexicalScopeScanner.enter(CtElement e) |
void |
ModelConsistencyChecker.enter(CtElement element)
Enters an element.
|
protected void |
CtDequeScanner.enter(CtElement e)
Pushes the element.
|
protected void |
CtScanner.enter(CtElement e)
This method is upcalled by the scanner when entering a scanned element.
|
protected void |
CtBiScannerDefault.enter(CtElement e) |
protected void |
DefaultJavaPrettyPrinter.exit(CtElement e)
This method is called by
DefaultJavaPrettyPrinter.scan(CtElement) when entering a scanned element. |
protected void |
ImportCleaner.ImportCleanerScanner.exit(CtElement e) |
protected void |
LexicalScopeScanner.exit(CtElement e) |
protected void |
ModelConsistencyChecker.exit(CtElement e)
Exits an element.
|
protected void |
CtDequeScanner.exit(CtElement e)
Pops the element.
|
protected void |
CtScanner.exit(CtElement e)
This method is upcalled by the scanner when exiting a scanned element.
|
protected void |
CtBiScannerDefault.exit(CtElement e) |
java.util.List<CtComment> |
ElementPrinterHelper.getComments(CtElement element,
CommentOffset offset) |
static <E extends CtElement> |
Query.getElements(CtElement rootElement,
Filter<E> filter)
Returns all the program elements that match the filter starting from the given rootElement.
|
static <T extends CtReference> |
Query.getReferences(CtElement rootElement,
Filter<T> filter)
Returns all the program element references that match the filter.
|
protected java.util.Set<java.lang.String> |
ImportScannerImpl.lookForLocalVariables(CtElement parent) |
void |
PrinterHelper.mapLine(CtElement e,
CtCompilationUnit unitExpected) |
protected void |
EarlyTerminatingScanner.onElement(CtRole role,
CtElement element)
Called for each scanned element.
|
java.lang.String |
DefaultJavaPrettyPrinter.prettyprint(CtElement e) |
java.lang.String |
PrettyPrinter.prettyprint(CtElement ctElement)
pretty-prints the element, call
#toString() to get the result |
java.lang.String |
DefaultJavaPrettyPrinter.printElement(CtElement element)
Prints an element.
|
java.lang.String |
PrettyPrinter.printElement(CtElement element)
Prints an element.
|
DefaultJavaPrettyPrinter |
DefaultJavaPrettyPrinter.scan(CtElement e)
The generic scan method for an element.
|
void |
CtInheritanceScanner.scan(CtElement element)
Generically scans a meta-model element.
|
void |
CtBFSIterator.scan(CtElement element)
prevent scanner from going down the tree, instead save with other CtElement children of the current node
|
void |
EarlyTerminatingScanner.scan(CtElement element) |
void |
CtIterator.scan(CtElement element)
prevent scanner from going down the tree, instead save with other CtElement children of the current node
|
void |
ImportScannerImpl.scan(CtElement element) |
void |
AstParentConsistencyChecker.scan(CtElement element) |
void |
CtScanner.scan(CtElement element)
Generically scans a meta-model element.
|
void |
EarlyTerminatingScanner.scan(CtRole role,
CtElement element) |
void |
CtScanner.scan(CtRole role,
CtElement element)
Generically scans a meta-model element.
|
void |
CtInheritanceScanner.scanCtElement(CtElement e)
Scans an abstract element.
|
void |
ElementPrinterHelper.writeAnnotations(CtElement element)
Writes the annotations for the given element.
|
void |
ElementPrinterHelper.writeComment(CtElement element) |
void |
ElementPrinterHelper.writeComment(CtElement element,
CommentOffset offset) |
Modifier and Type | Method and Description |
---|---|
protected void |
CtBiScannerDefault.biScan(CtRole role,
java.util.Collection<? extends CtElement> elements,
java.util.Collection<? extends CtElement> others) |
protected void |
CtBiScannerDefault.biScan(CtRole role,
java.util.Collection<? extends CtElement> elements,
java.util.Collection<? extends CtElement> others) |
void |
CtInheritanceScanner.scan(java.util.Collection<? extends CtElement> elements)
Generically scans a collection of meta-model elements.
|
void |
CtScanner.scan(java.util.Collection<? extends CtElement> elements)
Generically scans a collection of meta-model elements.
|
void |
EarlyTerminatingScanner.scan(CtRole role,
java.util.Collection<? extends CtElement> elements) |
void |
CtScanner.scan(CtRole role,
java.util.Collection<? extends CtElement> elements)
Generically scans a collection of meta-model elements.
|
void |
EarlyTerminatingScanner.scan(CtRole role,
java.util.Map<java.lang.String,? extends CtElement> elements) |
void |
CtScanner.scan(CtRole role,
java.util.Map<java.lang.String,? extends CtElement> elements)
Generically scans a Map of meta-model elements.
|
void |
DefaultJavaPrettyPrinter.setPreprocessors(java.util.List<Processor<CtElement>> preprocessors) |
Constructor and Description |
---|
AccessibleVariablesFinder(CtElement expression) |
CtBFSIterator(CtElement root)
CtIterator constructor, prepares the iterator from the @root node
|
CtIterator(CtElement root)
CtIterator constructor, prepares the iterator from the @root node
|
Modifier and Type | Method and Description |
---|---|
<R extends CtElement> |
CtQueryImpl.filterChildren(Filter<R> filter) |
<R extends CtElement> |
CtQueryable.filterChildren(Filter<R> filter) |
<R extends CtElement> |
CtQuery.filterChildren(Filter<R> filter)
Recursively scans all children elements of an input element.
|
<R extends CtElement> |
CtQueryImpl.select(Filter<R> filter) |
<R extends CtElement> |
CtQuery.select(Filter<R> filter)
The matched element for which (filter.matches(element)==true) is sent to the next query step.
|
Modifier and Type | Method and Description |
---|---|
default ScanningMode |
CtScannerListener.enter(CtElement element)
Called before the scanner enters an element
|
default ScanningMode |
CtScannerListener.enter(CtRole role,
CtElement element)
Called before the scanner enters an element
|
default void |
CtScannerListener.exit(CtElement element)
This method is called after the element and all its children have been visited.
|
default void |
CtScannerListener.exit(CtRole role,
CtElement element)
This method is called after the element and all its children have been visited.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractFilter<T extends CtElement>
Defines an abstract filter based on matching on the element types.
|
class |
AnnotationFilter<E extends CtElement>
This filter matches all the elements annotated with a given annotation type.
|
class |
CompositeFilter<T extends CtElement>
This class defines a composite filter, which can compose several filters
together by using
FilteringOperator . |
class |
RegexFilter<E extends CtElement>
Filters elements with a regular expression on the element's code.
|
class |
TypeFilter<T extends CtElement>
This simple filter matches all the elements of a given type.
|
Modifier and Type | Field and Description |
---|---|
protected CtElement |
VariableReferenceFunction.scope |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<CtElement> |
RegexFilter.getType() |
Modifier and Type | Method and Description |
---|---|
void |
SiblingsFunction.apply(CtElement input,
CtConsumer<java.lang.Object> outputConsumer) |
void |
PotentialVariableDeclarationFunction.apply(CtElement input,
CtConsumer<java.lang.Object> outputConsumer) |
void |
CtScannerFunction.apply(CtElement input,
CtConsumer<java.lang.Object> outputConsumer) |
void |
FieldReferenceFunction.apply(CtElement fieldOrScope,
CtConsumer<java.lang.Object> outputConsumer) |
void |
LocalVariableReferenceFunction.apply(CtElement scope,
CtConsumer<java.lang.Object> outputConsumer) |
void |
ParentFunction.apply(CtElement input,
CtConsumer<java.lang.Object> outputConsumer) |
void |
VariableReferenceFunction.apply(CtElement variableOrScope,
CtConsumer<java.lang.Object> outputConsumer) |
ScanningMode |
SuperInheritanceHierarchyFunction.DistinctTypeListener.enter(CtElement element) |
protected void |
VariableScopeFunction.Visitor.enter(CtElement e) |
protected void |
VariableReferenceFunction.Visitor.enter(CtElement e) |
void |
SuperInheritanceHierarchyFunction.DistinctTypeListener.exit(CtElement element) |
boolean |
SameFilter.matches(CtElement element) |
Constructor and Description |
---|
SameFilter(CtElement argument2) |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
DefaultCoreFactory.clone(T object) |
Modifier and Type | Method and Description |
---|---|
CtElement |
DefaultCoreFactory.create(java.lang.Class<? extends CtElement> klass) |
Modifier and Type | Method and Description |
---|---|
FileGenerator<? extends CtElement> |
StandardEnvironment.getDefaultFileGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
RuntimeProcessingManager.process(CtElement element) |
void |
QueueProcessingManager.process(CtElement element) |
void |
RuntimeProcessingManager.process(CtElement element,
Processor<?> processor)
Recursively processes an element and its children with a given processor.
|
void |
StandardEnvironment.report(Processor<?> processor,
org.slf4j.event.Level level,
CtElement element,
java.lang.String message) |
Modifier and Type | Method and Description |
---|---|
CtElement |
DefaultCoreFactory.create(java.lang.Class<? extends CtElement> klass) |
void |
RuntimeProcessingManager.process(java.util.Collection<? extends CtElement> elements) |
void |
QueueProcessingManager.process(java.util.Collection<? extends CtElement> elements) |
void |
RuntimeProcessingManager.process(java.util.Collection<? extends CtElement> elements,
Processor<?> processor)
Recursively processes elements and their children with a given processor.
|
void |
StandardEnvironment.setDefaultFileGenerator(FileGenerator<? extends CtElement> defaultFileGenerator) |
Modifier and Type | Method and Description |
---|---|
int |
SignatureComparator.compare(CtElement o1,
CtElement o2) |
int |
CtLineElementComparator.compare(CtElement o1,
CtElement o2)
Returns 0 if o1 has the same position as o2, or both positions are invalid and o1.equals(o2).
|
int |
QualifiedNameComparator.compare(CtElement o1,
CtElement o2) |
int |
DeepRepresentationComparator.compare(CtElement o1,
CtElement o2) |
Modifier and Type | Field and Description |
---|---|
CtElement |
ASTPair.element |
Modifier and Type | Method and Description |
---|---|
void |
ParentExiter.scanCtElement(CtElement e) |
void |
ParentExiter.setChild(CtElement child) |
Modifier and Type | Method and Description |
---|---|
void |
JDTBasedSpoonCompiler.process(java.util.Collection<Processor<? extends CtElement>> processors) |
Constructor and Description |
---|
ASTPair(CtElement element,
org.eclipse.jdt.internal.compiler.ast.ASTNode node) |
Modifier and Type | Method and Description |
---|---|
void |
SpoonTreeBuilder.enter(CtElement element) |
void |
SpoonTreeBuilder.exit(CtElement element) |
void |
SpoonTreeBuilder.scan(CtRole role,
CtElement element) |
Constructor and Description |
---|
SpoonModelTree(CtElement rootElement) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<CtRole> |
ChangeCollector.getChanges(CtElement currentElement)
Return the set of
CtRole s for which children have changed from `currentElement`
since this ChangeCollector was attached
Warning: change in IMPLICIT are ignored |
java.util.Set<CtRole> |
ChangeCollector.getDirectChanges(CtElement currentElement) |
protected void |
SourceFragmentCreator.onChange(CtElement currentElement,
CtRole role) |
protected void |
ChangeCollector.onChange(CtElement currentElement,
CtRole role)
Called whenever anything changes in the spoon model
|
void |
ActionBasedChangeListenerImpl.onListAdd(CtElement currentElement,
CtRole role,
java.util.List field,
CtElement newValue) |
void |
FineModelChangeListener.onListAdd(CtElement currentElement,
CtRole role,
java.util.List field,
CtElement newValue)
a newValue is appended to the list corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onListAdd(CtElement currentElement,
CtRole role,
java.util.List field,
CtElement newValue) |
void |
ActionBasedChangeListenerImpl.onListAdd(CtElement currentElement,
CtRole role,
java.util.List field,
int index,
CtElement newValue) |
void |
FineModelChangeListener.onListAdd(CtElement currentElement,
CtRole role,
java.util.List field,
int index,
CtElement newValue)
a newValue is appended to the list corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onListAdd(CtElement currentElement,
CtRole role,
java.util.List field,
int index,
CtElement newValue) |
void |
ActionBasedChangeListenerImpl.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.Collection<? extends CtElement> oldValue) |
void |
FineModelChangeListener.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.Collection<? extends CtElement> oldValue)
an oldValue is deleted in the list corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.Collection<? extends CtElement> oldValue) |
void |
ActionBasedChangeListenerImpl.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
int index,
CtElement oldValue) |
void |
FineModelChangeListener.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
int index,
CtElement oldValue)
an oldValue is deleted in the list corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
int index,
CtElement oldValue) |
void |
ActionBasedChangeListenerImpl.onListDeleteAll(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.List oldValue) |
void |
FineModelChangeListener.onListDeleteAll(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.List oldValue)
a list corresponding to the role in the AST node is emptied
|
void |
EmptyModelChangeListener.onListDeleteAll(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.List oldValue) |
<K,V> void |
ActionBasedChangeListenerImpl.onMapAdd(CtElement currentElement,
CtRole role,
java.util.Map<K,V> field,
K key,
CtElement newValue) |
<K,V> void |
FineModelChangeListener.onMapAdd(CtElement currentElement,
CtRole role,
java.util.Map<K,V> field,
K key,
CtElement newValue)
a newValue is appended to the map corresponding to the role in the AST node
|
<K,V> void |
EmptyModelChangeListener.onMapAdd(CtElement currentElement,
CtRole role,
java.util.Map<K,V> field,
K key,
CtElement newValue) |
<K,V> void |
ActionBasedChangeListenerImpl.onMapDeleteAll(CtElement currentElement,
CtRole role,
java.util.Map<K,V> field,
java.util.Map<K,V> oldValue) |
<K,V> void |
FineModelChangeListener.onMapDeleteAll(CtElement currentElement,
CtRole role,
java.util.Map<K,V> field,
java.util.Map<K,V> oldValue)
a map corresponding to the role in the AST node is emptied
|
<K,V> void |
EmptyModelChangeListener.onMapDeleteAll(CtElement currentElement,
CtRole role,
java.util.Map<K,V> field,
java.util.Map<K,V> oldValue) |
void |
ActionBasedChangeListenerImpl.onObjectDelete(CtElement currentElement,
CtRole role,
CtElement oldValue) |
void |
FineModelChangeListener.onObjectDelete(CtElement currentElement,
CtRole role,
CtElement oldValue)
a field corresponding to the role is being set to null
|
void |
EmptyModelChangeListener.onObjectDelete(CtElement currentElement,
CtRole role,
CtElement oldValue) |
void |
ActionBasedChangeListenerImpl.onObjectUpdate(CtElement currentElement,
CtRole role,
CtElement newValue,
CtElement oldValue) |
void |
FineModelChangeListener.onObjectUpdate(CtElement currentElement,
CtRole role,
CtElement newValue,
CtElement oldValue)
a field corresponding to the role is being set in the AST node
|
void |
EmptyModelChangeListener.onObjectUpdate(CtElement currentElement,
CtRole role,
CtElement newValue,
CtElement oldValue) |
void |
ActionBasedChangeListenerImpl.onObjectUpdate(CtElement currentElement,
CtRole role,
java.lang.Object newValue,
java.lang.Object oldValue) |
void |
FineModelChangeListener.onObjectUpdate(CtElement currentElement,
CtRole role,
java.lang.Object newValue,
java.lang.Object oldValue)
a field corresponding to the role is being set in the AST node
|
void |
EmptyModelChangeListener.onObjectUpdate(CtElement currentElement,
CtRole role,
java.lang.Object newValue,
java.lang.Object oldValue) |
void |
ActionBasedChangeListenerImpl.onSetAdd(CtElement currentElement,
CtRole role,
java.util.Set field,
CtElement newValue) |
void |
FineModelChangeListener.onSetAdd(CtElement currentElement,
CtRole role,
java.util.Set field,
CtElement newValue)
a newValue is appended to the set corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onSetAdd(CtElement currentElement,
CtRole role,
java.util.Set field,
CtElement newValue) |
<T extends java.lang.Enum> |
ActionBasedChangeListenerImpl.onSetAdd(CtElement currentElement,
CtRole role,
java.util.Set field,
T newValue) |
<T extends java.lang.Enum> |
FineModelChangeListener.onSetAdd(CtElement currentElement,
CtRole role,
java.util.Set field,
T newValue)
a newValue is appended to the set corresponding to the role in the AST node
|
<T extends java.lang.Enum> |
EmptyModelChangeListener.onSetAdd(CtElement currentElement,
CtRole role,
java.util.Set field,
T newValue) |
void |
ActionBasedChangeListenerImpl.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
java.util.Collection<ModifierKind> oldValue) |
void |
FineModelChangeListener.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
java.util.Collection<ModifierKind> oldValue)
an oldValue is deleted in the set corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
java.util.Collection<ModifierKind> oldValue) |
void |
ActionBasedChangeListenerImpl.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
CtElement oldValue) |
void |
FineModelChangeListener.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
CtElement oldValue)
an oldValue is deleted in the set corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
CtElement oldValue) |
void |
ActionBasedChangeListenerImpl.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
ModifierKind oldValue) |
void |
FineModelChangeListener.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
ModifierKind oldValue)
an oldValue is deleted in the set corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onSetDelete(CtElement currentElement,
CtRole role,
java.util.Set field,
ModifierKind oldValue) |
void |
ActionBasedChangeListenerImpl.onSetDeleteAll(CtElement currentElement,
CtRole role,
java.util.Set field,
java.util.Set oldValue) |
void |
FineModelChangeListener.onSetDeleteAll(CtElement currentElement,
CtRole role,
java.util.Set field,
java.util.Set oldValue)
a set corresponding to the role in the AST node is emptied
|
void |
EmptyModelChangeListener.onSetDeleteAll(CtElement currentElement,
CtRole role,
java.util.Set field,
java.util.Set oldValue) |
Modifier and Type | Method and Description |
---|---|
void |
ActionBasedChangeListenerImpl.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.Collection<? extends CtElement> oldValue) |
void |
FineModelChangeListener.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.Collection<? extends CtElement> oldValue)
an oldValue is deleted in the list corresponding to the role in the AST node
|
void |
EmptyModelChangeListener.onListDelete(CtElement currentElement,
CtRole role,
java.util.List field,
java.util.Collection<? extends CtElement> oldValue) |
Modifier and Type | Method and Description |
---|---|
CtElement |
Context.getElementWhereChangeHappens()
the changed parent
|
Constructor and Description |
---|
CollectionContext(CtElement element,
CtRole role,
T copyOfTheCollection) |
Context(CtElement element,
CtRole changedProperty) |
ListContext(CtElement element,
CtRole role,
java.util.List<?> original) |
ListContext(CtElement element,
CtRole role,
java.util.List<?> original,
int position) |
MapContext(CtElement element,
CtRole role,
java.util.Map<K,V> map) |
MapContext(CtElement element,
CtRole role,
java.util.Map<K,V> map,
K key) |
ObjectContext(CtElement ctElement,
CtRole role) |
SetContext(CtElement element,
CtRole role,
java.util.Set<?> original) |
Constructor and Description |
---|
CtModifierHandler(CtElement element) |
Modifier and Type | Method and Description |
---|---|
<E extends CtElement> |
CtTypeAccessImpl.setImplicit(boolean implicit) |
<E extends CtElement> |
CtStatementListImpl.setPosition(SourcePosition position) |
Modifier and Type | Class and Description |
---|---|
class |
CompilationUnitImpl
Implements a compilation unit.
|
Modifier and Type | Class and Description |
---|---|
class |
CtAnnotationImpl<A extends java.lang.annotation.Annotation>
The implementation for
CtAnnotation . |
class |
CtAnnotationMethodImpl<T>
The implementation for
CtAnnotationMethod . |
class |
CtAnnotationTypeImpl<T extends java.lang.annotation.Annotation>
The implementation for
CtAnnotationType . |
class |
CtAnonymousExecutableImpl |
class |
CtClassImpl<T>
The implementation for
CtClass . |
class |
CtCompilationUnitImpl
Implements a compilation unit.
|
class |
CtConstructorImpl<T> |
class |
CtElementImpl
Contains the default implementation of most CtElement methods.
|
class |
CtEnumImpl<T extends java.lang.Enum<?>> |
class |
CtEnumValueImpl<T> |
class |
CtExecutableImpl<R>
The implementation for
CtExecutable . |
class |
CtFieldImpl<T>
The implementation for
CtField . |
class |
CtImportImpl |
class |
CtInterfaceImpl<T> |
class |
CtMethodImpl<T>
The implementation for
CtMethod . |
class |
CtModuleImpl |
class |
CtModuleRequirementImpl |
class |
CtNamedElementImpl |
class |
CtPackageDeclarationImpl |
class |
CtPackageExportImpl |
class |
CtPackageImpl
The implementation for
CtPackage . |
class |
CtParameterImpl<T>
The implementation for
CtParameter . |
class |
CtProvidedServiceImpl |
class |
CtTypeImpl<T>
The implementation for
CtType . |
class |
CtTypeParameterImpl |
class |
CtUsedServiceImpl |
class |
InvisibleArrayConstructorImpl<T>
This class is used to represent the constructor of an array when calling with an expression like
|
Modifier and Type | Field and Description |
---|---|
protected CtElement |
CtElementImpl.parent |
Modifier and Type | Method and Description |
---|---|
<E extends CtElement> |
CtElementImpl.addAnnotation(CtAnnotation<? extends java.lang.annotation.Annotation> annotation) |
<E extends CtElement> |
CtElementImpl.addComment(CtComment comment) |
<P extends CtElement> |
CtElementImpl.filterChildren(Filter<P> predicate) |
<E extends CtElement> |
CtElementImpl.getAnnotatedChildren(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType) |
<E extends CtElement> |
CtElementImpl.getElements(Filter<E> filter) |
<P extends CtElement> |
CtElementImpl.getParent(java.lang.Class<P> parentType) |
<E extends CtElement> |
CtElementImpl.getParent(Filter<E> filter) |
<E extends CtElement> |
CtElementImpl.putMetadata(java.lang.String key,
java.lang.Object val) |
<E extends CtElement> |
CtElementImpl.removeComment(CtComment comment) |
<E extends CtElement> |
CtElementImpl.replace(java.util.Collection<E> elements) |
<E extends CtElement> |
CtElementImpl.setAllMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata) |
<E extends CtElement> |
CtElementImpl.setAnnotations(java.util.List<CtAnnotation<? extends java.lang.annotation.Annotation>> annotations) |
<E extends CtElement> |
CtElementImpl.setComments(java.util.List<CtComment> comments) |
<E extends CtElement> |
CtElementImpl.setDocComment(java.lang.String docComment) |
<E extends CtElement> |
CtElementImpl.setImplicit(boolean implicit) |
<E extends CtElement> |
CtCompilationUnitImpl.setParent(E parent) |
<E extends CtElement> |
CtElementImpl.setParent(E parent) |
<T extends CtElement> |
CtModuleImpl.setParent(T parent) |
<E extends CtElement> |
CtCompilationUnitImpl.setPosition(SourcePosition position) |
<E extends CtElement> |
CtElementImpl.setPosition(SourcePosition position) |
<E extends CtElement> |
CtElementImpl.setPositions(SourcePosition position) |
<E extends CtElement,T> |
CtElementImpl.setValueByRole(CtRole role,
T value) |
Modifier and Type | Method and Description |
---|---|
CtElement |
CtElementImpl.clone() |
CtElement |
CtAnnotationImpl.getAnnotatedElement() |
CtElement |
CtCompilationUnitImpl.getParent() |
CtElement |
CtModuleImpl.getParent() |
CtElement |
CtElementImpl.getParent() |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<CtElement> |
CtElementImpl.asIterable() |
java.util.Iterator<CtElement> |
CtElementImpl.descendantIterator() |
java.util.List<CtElement> |
CtElementImpl.getDirectChildren() |
Modifier and Type | Method and Description |
---|---|
boolean |
CtElementImpl.hasParent(CtElement candidate) |
void |
CtElementImpl.replace(CtElement element) |
Modifier and Type | Method and Description |
---|---|
<R extends CtElement> |
VisitorPartialEvaluator.evaluate(R element) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
EvalHelper.convertElementToRuntimeObject(CtElement value)
Evaluates and converts CtExpression to their equivalent runtime objects
eg "CtLiteral(3) + CtLiteral(4)" -> 7
|
protected void |
VisitorPartialEvaluator.exit(CtElement e) |
protected void |
InlinePartialEvaluator.exit(CtElement e) |
Modifier and Type | Class and Description |
---|---|
class |
CtArrayTypeReferenceImpl<T> |
class |
CtCatchVariableReferenceImpl<T> |
class |
CtExecutableReferenceImpl<T> |
class |
CtFieldReferenceImpl<T> |
class |
CtIntersectionTypeReferenceImpl<T> |
class |
CtLocalVariableReferenceImpl<T>
An implementation for
CtLocalVariableReference . |
class |
CtModuleReferenceImpl |
class |
CtPackageReferenceImpl |
class |
CtParameterReferenceImpl<T> |
class |
CtReferenceImpl |
class |
CtTypeMemberWildcardImportReferenceImpl
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.*;
|
class |
CtTypeParameterReferenceImpl |
class |
CtTypeReferenceImpl<T> |
class |
CtUnboundVariableReferenceImpl<T>
represents a reference to an unbound field (used when no full classpath is available
|
class |
CtVariableReferenceImpl<T> |
class |
CtWildcardReferenceImpl |
Modifier and Type | Method and Description |
---|---|
<E extends CtElement> |
CtTypeMemberWildcardImportReferenceImpl.addAnnotation(CtAnnotation<? extends java.lang.annotation.Annotation> annotation) |
<E extends CtElement> |
CtTypeMemberWildcardImportReferenceImpl.setAnnotations(java.util.List<CtAnnotation<? extends java.lang.annotation.Annotation>> annotations) |
<E extends CtElement> |
CtUnboundVariableReferenceImpl.setAnnotations(java.util.List<CtAnnotation<? extends java.lang.annotation.Annotation>> annotations) |
<E extends CtElement> |
CtReferenceImpl.setComments(java.util.List<CtComment> comments) |
<E extends CtElement> |
CtTypeMemberWildcardImportReferenceImpl.setImplicit(boolean implicit) |
Modifier and Type | Method and Description |
---|---|
static boolean |
SniperJavaPrettyPrinter.hasImplicitAncestor(CtElement el)
Warning, not in the API, public for testing purposes
|
java.lang.String |
SniperJavaPrettyPrinter.printElement(CtElement element)
The sniper mode only works from JavaOutputProcessor
|
java.lang.String |
SniperJavaPrettyPrinter.printElementSniper(CtElement element)
Warning: debug and test method only, not part of the public API
|
SniperJavaPrettyPrinter |
SniperJavaPrettyPrinter.scan(CtElement element)
Called whenever
DefaultJavaPrettyPrinter scans/prints an element
Warning: DO not call on a cloned element. |
Modifier and Type | Field and Description |
---|---|
protected CtElement |
ElementPrinterEvent.element |
Modifier and Type | Method and Description |
---|---|
static ElementSourceFragment |
ElementSourceFragment.createSourceFragmentsFrom(CtElement element)
Builds a tree of source fragments for `element` and all its children, based on the source positions of each element
|
Constructor and Description |
---|
ChangeResolver(ChangeCollector changeCollector,
CtElement element) |
ElementPrinterEvent(CtRole role,
CtElement element) |
SourceFragmentContextList(MutableTokenWriter mutableTokenWriter,
CtElement element,
java.util.List<SourceFragment> fragments,
ChangeResolver changeResolver) |
Modifier and Type | Class and Description |
---|---|
class |
ModelList<T extends CtElement>
The implementation of the
List , which is used by Spoon model objects. |
class |
ModelSet<T extends CtElement>
The implementation of the
Set , which is used by Spoon model objects. |
class |
QualifiedNameBasedSortedSet<E extends CtElement>
The set properties of this set are based on the qualified name of the element inserted.
|
Modifier and Type | Method and Description |
---|---|
protected abstract CtElement |
ModelList.getOwner() |
protected abstract CtElement |
ModelSet.getOwner() |
Constructor and Description |
---|
ModelSet(java.util.Comparator<? super CtElement> comparator) |
Modifier and Type | Method and Description |
---|---|
void |
ProcessingVisitor.scan(CtElement e)
Applies the processing to the given element.
|
void |
HashcodeVisitor.scan(CtElement element) |
Modifier and Type | Method and Description |
---|---|
static <T extends CtElement> |
CloneBuilder.build(CloneBuilder builder,
CtElement element,
CtElement other) |
<T extends CtElement> |
CloneVisitor.getClone() |
Modifier and Type | Method and Description |
---|---|
static <T extends CtElement> |
CloneBuilder.build(CloneBuilder builder,
CtElement element,
CtElement other) |
void |
CloneBuilder.copy(CtElement element,
CtElement other) |
void |
CloneBuilder.scanCtElement(CtElement e)
Scans an abstract element.
|
void |
CloneBuilder.setOther(CtElement other) |
Modifier and Type | Field and Description |
---|---|
protected CtElement |
EqualsChecker.other |
Modifier and Type | Method and Description |
---|---|
protected <T extends CtElement> |
CloneHelper.addClone(java.util.Collection<T> targetCollection,
T element)
clones an element and adds it's clone as value into targetCollection
|
protected <T extends CtElement> |
CloneHelper.addClone(java.util.Map<java.lang.String,T> targetMap,
java.lang.String key,
T value)
clones a value and adds it's clone as value into targetMap under key
|
<T extends CtElement> |
CloneHelper.clone(java.util.Collection<T> elements) |
<T extends CtElement> |
CloneHelper.clone(java.util.List<T> elements) |
<T extends CtElement> |
CloneHelper.clone(java.util.Map<java.lang.String,T> elements) |
<T extends CtElement> |
CloneHelper.clone(java.util.Set<T> elements)
clones a Set of elements
|
<T extends CtElement> |
CloneHelper.clone(T element) |
Modifier and Type | Method and Description |
---|---|
void |
EqualsVisitor.biScan(CtElement element,
CtElement other) |
void |
EqualsVisitor.biScan(CtRole role,
CtElement element,
CtElement other) |
boolean |
EqualsVisitor.checkEquals(CtElement element,
CtElement other) |
protected void |
EqualsVisitor.enter(CtElement e) |
static boolean |
EqualsVisitor.equals(CtElement element,
CtElement other) |
void |
EqualsChecker.setOther(CtElement other) |
void |
CloneHelper.tailor(CtElement topLevelElement,
CtElement topLevelClone)
Is called by
CloneVisitor at the end of the cloning for each element. |
Modifier and Type | Method and Description |
---|---|
protected void |
EqualsVisitor.biScan(CtRole role,
java.util.Collection<? extends CtElement> elements,
java.util.Collection<? extends CtElement> others) |
protected void |
EqualsVisitor.biScan(CtRole role,
java.util.Collection<? extends CtElement> elements,
java.util.Collection<? extends CtElement> others) |
Modifier and Type | Interface and Description |
---|---|
interface |
ReplaceListener<T extends CtElement>
Interface for the AST node replacement infrastructure.
|
Modifier and Type | Method and Description |
---|---|
static <E extends CtElement> |
ReplacementVisitor.replace(CtElement original,
java.util.Collection<E> replaces) |
Modifier and Type | Method and Description |
---|---|
static <E extends CtElement> |
ReplacementVisitor.replace(CtElement original,
java.util.Collection<E> replaces) |
static void |
ReplacementVisitor.replace(CtElement original,
CtElement replace) |
Modifier and Type | Class and Description |
---|---|
class |
AbstractTemplate<T extends CtElement>
handles the well-formedness and helper methods of templates
|
interface |
Template<T extends CtElement>
A template code is simply a piece of code that uses a
TemplateParameter 's instance. |
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
TemplateMatcher.find(CtElement targetRoot)
Finds all target program sub-trees that correspond to a template.
|
static <E extends CtElement> |
Substitution.substitute(CtType<?> targetType,
Template<?> template,
E code)
Substitutes all the template parameters in a random piece of code.
|
Modifier and Type | Method and Description |
---|---|
<T extends CtElement> |
TemplateMatcher.find(CtElement targetRoot)
Finds all target program sub-trees that correspond to a template.
|
void |
TemplateMatcher.forEachMatch(CtElement rootElement,
CtConsumer<Match> consumer)
Finds all target program sub-trees that correspond to a template
and calls consumer.accept(matchingElement, )
|
boolean |
TemplateMatcher.matches(CtElement element) |
static void |
Substitution.redirectTypeReferences(CtElement element,
CtTypeReference<?> source,
CtTypeReference<?> target)
A helper method that recursively redirects all the type references from a
source type to a target type in the given element.
|
Constructor and Description |
---|
TemplateMatcher(CtElement templateRoot)
Constructs a matcher for a given template.
|
TemplateMatcher(CtElement templateRoot,
CtClass<?> templateType)
Constructs a matcher for a given template.
|
Modifier and Type | Method and Description |
---|---|
static AbstractCtElementAssert<?> |
Assert.assertThat(CtElement actual)
Create a new instance of
. |
T |
AbstractCtElementAssert.isEqualTo(CtElement expected)
Verifies that the actual value is equal to the given one.
|
Constructor and Description |
---|
AbstractCtElementAssert(CtElement actual,
java.lang.Class<?> selfType) |
CtElementAssert(CtElement actual) |
Modifier and Type | Method and Description |
---|---|
static <A extends CtElement,E extends CtElement> |
Check.assertIsSame(A actual,
E expected) |
static <A extends CtElement,E extends CtElement> |
Check.assertIsSame(A actual,
E expected) |
Modifier and Type | Method and Description |
---|---|
static void |
Check.assertCtElementEquals(CtElement ct1,
CtElement ct2)
if ct1 is not equals to ct2, tells the exact difference
|
Copyright © 2007–2021 Inria. All rights reserved.