Class ElementFilter
java.lang.Object
javax.lang.model.util.ElementFilter
Filters for selecting just the elements of interest from a
collection of elements. The returned sets and lists are new
collections that do not use the argument collection as a backing store. The
methods in this class do not make any attempts to guard against
concurrent modifications of the arguments. The returned sets and
lists are mutable and unsafe for concurrent access. A returned set
from a method has the same iteration order as the argument set to the method.
If iterables or sets containing null are passed as
arguments to methods in this class, a NullPointerException
will be thrown.
- Since:
- 1.6
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<ExecutableElement> constructorsIn(Iterable<? extends Element> elements) Returns a list of constructors inelements.static Set<ExecutableElement> constructorsIn(Set<? extends Element> elements) Returns a set of constructors inelements.static List<ModuleElement.ExportsDirective> exportsIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofexportsdirectives indirectives.static List<VariableElement> Returns a list of fields inelements.static Set<VariableElement> Returns a set of fields inelements.static List<ExecutableElement> Returns a list of methods inelements.static Set<ExecutableElement> Returns a set of methods inelements.static List<ModuleElement> Returns a list of modules inelements.static Set<ModuleElement> Returns a set of modules inelements.static List<ModuleElement.OpensDirective> opensIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofopensdirectives indirectives.static List<PackageElement> packagesIn(Iterable<? extends Element> elements) Returns a list of packages inelements.static Set<PackageElement> packagesIn(Set<? extends Element> elements) Returns a set of packages inelements.static List<ModuleElement.ProvidesDirective> providesIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofprovidesdirectives indirectives.static List<RecordComponentElement> recordComponentsIn(Iterable<? extends Element> elements) Returns a list of record components inelements.static Set<RecordComponentElement> recordComponentsIn(Set<? extends Element> elements) Returns a set of record components inelements.static List<ModuleElement.RequiresDirective> requiresIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofrequiresdirectives indirectives.static List<TypeElement> Returns a list of classes and interfaces inelements.static Set<TypeElement> Returns a set of classes and interfaces inelements.static List<ModuleElement.UsesDirective> usesIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofusesdirectives indirectives.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Method Details
-
fieldsIn
Returns a list of fields inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of fields in
elements
-
fieldsIn
Returns a set of fields inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of fields in
elements
-
recordComponentsIn
Returns a list of record components inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of record components in
elements - Since:
- 16
-
recordComponentsIn
Returns a set of record components inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of record components in
elements - Since:
- 16
-
constructorsIn
Returns a list of constructors inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of constructors in
elements
-
constructorsIn
Returns a set of constructors inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of constructors in
elements
-
methodsIn
Returns a list of methods inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of methods in
elements
-
methodsIn
Returns a set of methods inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of methods in
elements
-
typesIn
Returns a list of classes and interfaces inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of classes and interfaces in
elements
-
typesIn
Returns a set of classes and interfaces inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of classes and interfaces in
elements
-
packagesIn
Returns a list of packages inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of packages in
elements
-
packagesIn
Returns a set of packages inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of packages in
elements
-
modulesIn
Returns a list of modules inelements.- Parameters:
elements- the elements to filter- Returns:
- a list of modules in
elements - Since:
- 9
-
modulesIn
Returns a set of modules inelements.- Parameters:
elements- the elements to filter- Returns:
- a set of modules in
elements - Since:
- 9
-
exportsIn
public static List<ModuleElement.ExportsDirective> exportsIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofexportsdirectives indirectives.- Parameters:
directives- the directives to filter- Returns:
- a list of
exportsdirectives indirectives - Since:
- 9
-
opensIn
public static List<ModuleElement.OpensDirective> opensIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofopensdirectives indirectives.- Parameters:
directives- the directives to filter- Returns:
- a list of
opensdirectives indirectives - Since:
- 9
-
providesIn
public static List<ModuleElement.ProvidesDirective> providesIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofprovidesdirectives indirectives.- Parameters:
directives- the directives to filter- Returns:
- a list of
providesdirectives indirectives - Since:
- 9
-
requiresIn
public static List<ModuleElement.RequiresDirective> requiresIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofrequiresdirectives indirectives.- Parameters:
directives- the directives to filter- Returns:
- a list of
requiresdirectives indirectives - Since:
- 9
-
usesIn
public static List<ModuleElement.UsesDirective> usesIn(Iterable<? extends ModuleElement.Directive> directives) Returns a list ofusesdirectives indirectives.- Parameters:
directives- the directives to filter- Returns:
- a list of
usesdirectives indirectives - Since:
- 9
-