Package spoon.reflect.visitor.filter
package spoon.reflect.visitor.filter
This package contains a set of useful filters when querying the model.
-
ClassDescriptionAbstractFilter<T extends CtElement>Defines an abstract filter based on matching on the element types.AbstractReferenceFilter<T extends CtReference>This class defines an abstract reference filter that needs to be subclassed in order to define the matching criteria.Returns all methods/lambdas with same signature in related inheritance hierarchies.Expects
CtType
as input and produces allCtTypeMember
s declared in input class or any super class or super interface.AnnotationFilter<E extends CtElement>This filter matches all the elements annotated with a given annotation type.This Query expects aCtCatchVariable
as input and returns allCtCatchVariableReference
s, which refers this input.This Query expects aCtCatchVariable
as input and returns all CtElements, which are in visibility scope of that catch variable.CompositeFilter<T extends CtElement>This class defines a composite filter, which can compose several filters together by usingFilteringOperator
.Returns all children of an element.DirectReferenceFilter<T extends CtReference>A filter forCtReference
s that compare equal to the reference provided in the constructor.This filter matches all theCtExecutableReference
referencing defined one or moreCtExecutable
s.This simple filter matches all the accesses to a given field.This Query expects aCtField
as input and returns allCtFieldReference
s, which refers this input.This Query expects aCtField
as input and returns all CtElements, which are in visibility scope of that field.This simple filter matches all the accesses to a given executable or any executable that overrides it.This filter matches all theCtLambda
elements, which implements defined interface(s)This filter matches all elements that can be considered as line of code (e.g.This mapping function expects aCtLocalVariable
as input and returns allCtLocalVariableReference
s, which refers this input.This Query expects aCtLocalVariable
as input and returns all CtElements, which are in visibility scope of that local variable.NamedElementFilter<T extends CtNamedElement>Filters elements by name and by type (for instance to find a method).Gets all overridden method from the method given.Gets all overridden method from the method given.Gets all overriding method from the method given.This Query expects aCtParameter
as input and returns allCtParameterReference
s, which refers this input.This Query expects aCtParameter
as input and returns all CtElements, which are in visibility scope of that parameter.This Function expects aCtElement
as input and returns all parents of this element.This mapping function searches for allCtVariable
instances, which might be a declaration of an inputCtElement
.ReferenceTypeFilter<T extends CtReference>This simple filter matches all the references of a given type.RegexFilter<E extends CtElement>Filters elements with a regular expression on the element's code.This simple filter matches all the occurrences of a return or a throw statement (end of execution flow).Finds the element given in parameter, useful for checking if an element is in an ancestor.visits siblings of input element.Expects aCtTypeInformation
as input and produces all sub classes and sub interfaces recursively.
The output is produced in arbitrary order.Matches all CtType elements, which are sub type ofSubtypeFilter.superType
Matches the input `superType` too.Expects aCtTypeInformation
as input and produces all super classes and super interfaces recursively.
The output is produced in following order: input type.Implementation ofCtScannerListener
, which is used to assure that each interface is visited only once.TypeFilter<T extends CtElement>This simple filter matches all the elements of a given type.VariableAccessFilter<T extends CtVariableAccess<?>>This simple filter matches all the accesses to a given variable.The mapping function, acceptingCtVariable
CtLocalVariable - local variable declared in body CtField - member field of an type CtParameter - method parameter CtCatchVariable - try - catch variable and returning all theCtVariableReference
, which refers this variableThe mapping function, acceptingCtVariable
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. -
EnumDescriptionThis enumeration defines the possible composition operators for filters.Defines visiting mode