Uses of Interface
spoon.reflect.declaration.CtMethod
Package
Description
Ready to go meta?
This package contains classes that model the Spoon metamodel itself.
This package contains the meta-model part that models the executable code (methods and constructors' bodies, field initializers).
This package contains the meta-model part that models the declarations (program's structures such as classes, fields, etc).
This package defines all the sub-factories for the Spoon meta-model.
This package defines visitor, scanner, and scanner-based query API for Java programs reified in the meta-model.
This package contains a set of useful filters when querying the model.
This package contains some default implementations for commonly used processing tasks.
This package defines a framework for well-typed pure-Java templates.
-
Uses of CtMethod in spoon.metamodel
Modifier and TypeMethodDescriptionstatic CtRole
Metamodel.getRoleOfMethod(CtMethod<?> method)
static MMMethodKind
Detect kind of methodboolean
-
Uses of CtMethod in spoon.pattern
Modifier and TypeMethodDescriptionPatternParameterConfigurator.byInvocation(CtMethod<?> method)
each invocation of `method` will be replaces by parameter value -
Uses of CtMethod in spoon.refactoring
Modifier and TypeMethodDescriptionstatic CtMethod<?>
Refactoring.copyMethod(CtMethod<?> method)
See doc incopyMethod()
Modifier and TypeMethodDescriptionstatic void
Refactoring.changeMethodName(CtMethod<?> method, String newName)
Changes name of a method, propagates the change in the executable references of the model.static CtMethod<?>
Refactoring.copyMethod(CtMethod<?> method)
See doc incopyMethod()
<T> void
MethodInvocationSearch.visitCtMethod(CtMethod<T> method)
-
Uses of CtMethod in spoon.reflect.code
-
Uses of CtMethod in spoon.reflect.declaration
Modifier and TypeInterfaceDescriptioninterface
This element defines an annotation method declared in an annotation type.Modifier and TypeMethodDescriptionCtMethod.setDefaultMethod(boolean defaultMethod)
Sets the default value state of a method.Modifier and TypeMethodDescriptionCtMethod.clone()
CtMethod<?>
CtMethod.copyMethod()
Copy the method, where copy means cloning + porting all the references of the old method to the new method (important for recursive methods).<R> CtMethod<R>
CtType.getMethod(String name, CtTypeReference<?>... parameterTypes)
Gets a method from its name and parameter types.<R> CtMethod<R>
CtType.getMethod(CtTypeReference<R> returnType, String name, CtTypeReference<?>... parameterTypes)
Gets a method from its return type, name, and parameter types.CtMethod<?>
CtRecordComponent.toMethod()
Converts the component to an implicit method.Modifier and TypeMethodDescriptionCtType.getAllMethods()
Return all the methods that can be called on an instance of this type.CtType.getMethods()
Returns the methods that are directly declared by this class or interface.CtType.getMethodsAnnotatedWith(CtTypeReference<?>... annotationTypes)
Returns the methods that are directly declared by this class or interface and annotated with one of the given annotations.CtType.getMethodsByName(String name)
Returns the methods that are directly declared by this class or interface and that have the given name.Collection<CtMethod<?>>
CtMethod.getTopDefinitions()
Returns the top-most methods in the hierarchy defining this method (in super class and super interfaces).Modifier and TypeMethodDescriptionAdds a method to this type.Adds a method to this type.boolean
Searches in the type for the given method.boolean
CtMethod.isOverriding(CtMethod<?> superMethod)
<M> boolean
CtType.removeMethod(CtMethod<M> method)
Removes a method from this type.Modifier and TypeMethodDescriptionCtAnnotationType.setMethods(Set<CtMethod<?>> methods)
Sets the methods of this type.CtType.setMethods(Set<CtMethod<?>> methods)
Sets the methods of this type.CtTypeParameter.setMethods(Set<CtMethod<?>> methods)
-
Uses of CtMethod in spoon.reflect.factory
Modifier and TypeMethodDescription<R, B extends R>
CtMethod<R>MethodFactory.create(CtClass<?> target, Set<ModifierKind> modifiers, CtTypeReference<R> returnType, String name, List<CtParameter<?>> parameters, Set<CtTypeReference<? extends Throwable>> thrownTypes, CtBlock<B> body)
Creates a method.<T> CtMethod<T>
MethodFactory.create(CtType<?> target, Set<ModifierKind> modifiers, CtTypeReference<T> returnType, String name, List<CtParameter<?>> parameters, Set<CtTypeReference<? extends Throwable>> thrownTypes)
Creates an empty method.<T> CtMethod<T>
Creates a method by copying an existing method.<T> CtMethod<T>
CoreFactory.createMethod()
Creates a method.<T> CtMethod<T>
Factory.createMethod()
Factory.createMethod(CtClass<?> target, Set<ModifierKind> modifiers, CtTypeReference returnType, String name, List<CtParameter<?>> parameters, Set<CtTypeReference<? extends Throwable>> thrownTypes, CtBlock body)
Factory.createMethod(CtType<?> target, Set<ModifierKind> modifiers, CtTypeReference returnType, String name, List<CtParameter<?>> parameters, Set<CtTypeReference<? extends Throwable>> thrownTypes)
Factory.createMethod(CtType<?> target, CtMethod source, boolean redirectReferences)
<T> CtMethod<T>
FactoryImpl.createMethod()
FactoryImpl.createMethod(CtClass<?> target, Set<ModifierKind> modifiers, CtTypeReference returnType, String name, List<CtParameter<?>> parameters, Set<CtTypeReference<? extends Throwable>> thrownTypes, CtBlock body)
FactoryImpl.createMethod(CtType<?> target, Set<ModifierKind> modifiers, CtTypeReference returnType, String name, List<CtParameter<?>> parameters, Set<CtTypeReference<? extends Throwable>> thrownTypes)
FactoryImpl.createMethod(CtType<?> target, CtMethod source, boolean redirectReferences)
Modifier and TypeMethodDescriptionMethodFactory.getMainMethods()
Gets all the main methods stored in this factory.Modifier and TypeMethodDescription<T> CtConstructor<T>
Creates a constructor into a target class by copying it from a source method.<T> CtMethod<T>
Creates a method by copying an existing method.Factory.createConstructor(CtClass target, CtMethod<?> source)
FactoryImpl.createConstructor(CtClass target, CtMethod<?> source)
Factory.createMethod(CtType<?> target, CtMethod source, boolean redirectReferences)
FactoryImpl.createMethod(CtType<?> target, CtMethod source, boolean redirectReferences)
<T> CtExecutableReference<T>
MethodFactory.createReference(CtMethod<T> m)
Creates a method reference. -
Uses of CtMethod in spoon.reflect.visitor
Modifier and TypeMethodDescription<T> void
CtAbstractVisitor.visitCtMethod(CtMethod<T> m)
<T> void
CtBiScannerDefault.visitCtMethod(CtMethod<T> m)
<T> void
CtInheritanceScanner.visitCtMethod(CtMethod<T> e)
<T> void
CtScanner.visitCtMethod(CtMethod<T> m)
<T> void
CtVisitor.visitCtMethod(CtMethod<T> m)
Visits a method declaration.<T> void
DefaultJavaPrettyPrinter.visitCtMethod(CtMethod<T> m)
-
Uses of CtMethod in spoon.reflect.visitor.filter
Modifier and TypeMethodDescriptionvoid
OverriddenMethodQuery.apply(CtMethod<?> input, CtConsumer<Object> outputConsumer)
boolean
boolean
ModifierConstructorDescriptionInvocationFilter(CtMethod<?> method)
Creates a new invocation filter.OverriddenMethodFilter(CtMethod<?> method)
Creates a new overridden method filter.OverridingMethodFilter(CtMethod<?> method)
Creates a new overriding method filter. -
Uses of CtMethod in spoon.support
-
Uses of CtMethod in spoon.support.adaption
Modifier and TypeMethodDescriptionCtMethod<?>
TypeAdaptor.adaptMethod(CtMethod<?> inputMethod)
Adapts a given method to the context of this type adapter.Modifier and TypeMethodDescriptionCtMethod<?>
TypeAdaptor.adaptMethod(CtMethod<?> inputMethod)
Adapts a given method to the context of this type adapter.boolean
TypeAdaptor.isConflicting(CtMethod<?> first, CtMethod<?> second)
Checks if two given methods are conflicting, i.e.boolean
TypeAdaptor.isOverriding(CtMethod<?> subMethod, CtMethod<?> superMethod)
Checks ifsubMethod
overridessuperMethod
.boolean
TypeAdaptor.isSameSignature(CtMethod<?> first, CtMethod<?> second)
Checks if two methods have the same signature, once you adapt both to the context of this type adapter.ModifierConstructorDescriptionTypeAdaptor(CtMethod<?> hierarchyStart)
Creates a new type adaptor using the given method as the start of its hierarchy. -
Uses of CtMethod in spoon.support.compiler.jdt
-
Uses of CtMethod in spoon.support.reflect.code
-
Uses of CtMethod in spoon.support.reflect.declaration
Modifier and TypeClassDescriptionclass
The implementation forCtAnnotationMethod
.class
CtMethodImpl<T>
The implementation forCtMethod
.Modifier and TypeMethodDescriptionCtMethodImpl.clone()
CtMethod<?>
CtMethodImpl.copyMethod()
<R> CtMethod<R>
CtEnumImpl.getMethod(String name, CtTypeReference<?>... parameterTypes)
<R> CtMethod<R>
CtEnumImpl.getMethod(CtTypeReference<R> returnType, String name, CtTypeReference<?>... parameterTypes)
<R> CtMethod<R>
CtTypeImpl.getMethod(String name, CtTypeReference<?>... parameterTypes)
<R> CtMethod<R>
CtTypeImpl.getMethod(CtTypeReference<R> returnType, String name, CtTypeReference<?>... parameterTypes)
<R> CtMethod<R>
CtTypeParameterImpl.getMethod(String name, CtTypeReference<?>... parameterTypes)
<R> CtMethod<R>
CtTypeParameterImpl.getMethod(CtTypeReference<R> returnType, String name, CtTypeReference<?>... parameterTypes)
CtMethod<?>
CtRecordComponentImpl.toMethod()
Modifier and TypeMethodDescriptionCtEnumImpl.getAllMethods()
CtTypeImpl.getAllMethods()
CtTypeParameterImpl.getAllMethods()
CtTypeImpl.getMethods()
CtTypeParameterImpl.getMethods()
CtTypeImpl.getMethodsAnnotatedWith(CtTypeReference<?>... annotationTypes)
CtTypeParameterImpl.getMethodsAnnotatedWith(CtTypeReference<?>... annotationTypes)
CtTypeImpl.getMethodsByName(String name)
CtTypeParameterImpl.getMethodsByName(String name)
Collection<CtMethod<?>>
CtMethodImpl.getTopDefinitions()
Modifier and TypeMethodDescriptionboolean
boolean
CtMethodImpl.isOverriding(CtMethod<?> superMethod)
<M> boolean
CtTypeImpl.removeMethod(CtMethod<M> method)
<M> boolean
CtTypeParameterImpl.removeMethod(CtMethod<M> method)
Modifier and TypeMethodDescriptionCtRecordImpl.setMethods(Set<CtMethod<?>> methods)
CtTypeImpl.setMethods(Set<CtMethod<?>> methods)
CtTypeParameterImpl.setMethods(Set<CtMethod<?>> methods)
-
Uses of CtMethod in spoon.support.visitor
Modifier and TypeMethodDescriptionboolean
ClassTypingContext.isOverriding(CtMethod<?> thisMethod, CtMethod<?> thatMethod)
thisMethod overrides thatMethod if 1) thisMethod class is a subclass of thatMethod class 2) thisMethod is a subsignature of thatMethod See http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.4.8.1boolean
ClassTypingContext.isSameSignature(CtExecutable<?> thisExecutable, CtMethod<?> thatExecutable)
Two methods are considered as having the same signature if they have the same name and argument types See https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2boolean
ClassTypingContext.isSubSignature(CtMethod<?> thisMethod, CtMethod<?> thatMethod)
isSubsignature is defined as an oriented relation between two methods as defined in See https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2 thisMethod is subsignature of thatMethod if either A) thisMethod is same signature like thatMethod B) thisMethod is same signature like type erasure of thatMethod<T> void
SignaturePrinter.visitCtMethod(CtMethod<T> m)
For methods, this implementation of signature contains the return type, which corresponds to what the Java compile and virtual machine call a "descriptor". -
Uses of CtMethod in spoon.support.visitor.clone
Modifier and TypeMethodDescription<T> void
CloneBuilder.visitCtMethod(CtMethod<T> e)
<T> void
CloneVisitor.visitCtMethod(CtMethod<T> m)
-
Uses of CtMethod in spoon.support.visitor.equals
-
Uses of CtMethod in spoon.support.visitor.java.internal
Modifier and TypeMethodDescriptionvoid
void
ModifierConstructorDescriptionExecutableRuntimeBuilderContext(Executable executable, CtMethod<?> ctMethod)
-
Uses of CtMethod in spoon.support.visitor.replace
-
Uses of CtMethod in spoon.template
Modifier and TypeMethodDescriptionstatic <T> CtMethod<T>
Substitution.insertMethod(CtType<?> targetType, Template<?> template, CtMethod<T> sourceMethod)
Generates a method from a template method by substituting all the template parameters by their values.Modifier and TypeMethodDescriptionstatic <T> CtConstructor<T>
Substitution.insertConstructor(CtClass<T> targetClass, Template<?> template, CtMethod<?> sourceMethod)
Generates a constructor from a template method by substituting all the template parameters by their values.static <T> CtMethod<T>
Substitution.insertMethod(CtType<?> targetType, Template<?> template, CtMethod<T> sourceMethod)
Generates a method from a template method by substituting all the template parameters by their values.