Class ElementFilter
- java.lang.Object
-
- javax.lang.model.util.ElementFilter
public class ElementFilter extends Object
Filters for selecting just the elements of interest from a collection of elements. The returned sets and lists are new collections and do use the argument 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 but unsafe for concurrent access. A returned set has the same iteration order as the argument set to a method.
If iterables and sets containing null
are passed as arguments to methods in this class, a NullPointerException
will be thrown.
- Since:
- 1.6
Methods
Modifier and Type | Method | Description |
---|---|---|
static List<ExecutableElement> | constructorsIn(Iterable<? extends Element> elements) | Returns a list of constructors in |
static Set<ExecutableElement> | constructorsIn(Set<? extends Element> elements) | Returns a set of constructors in |
static List<ModuleElement.ExportsDirective> | exportsIn(Iterable<? extends ModuleElement.Directive> directives) | Returns a list of |
static List<VariableElement> | fieldsIn(Iterable<? extends Element> elements) | Returns a list of fields in |
static Set<VariableElement> | fieldsIn(Set<? extends Element> elements) | Returns a set of fields in |
static List<ExecutableElement> | methodsIn(Iterable<? extends Element> elements) | Returns a list of methods in |
static Set<ExecutableElement> | methodsIn(Set<? extends Element> elements) | Returns a set of methods in |
static List<ModuleElement> | modulesIn(Iterable<? extends Element> elements) | Returns a list of modules in |
static Set<ModuleElement> | modulesIn(Set<? extends Element> elements) | Returns a set of modules in |
static List<ModuleElement.OpensDirective> | opensIn(Iterable<? extends ModuleElement.Directive> directives) | Returns a list of |
static List<PackageElement> | packagesIn(Iterable<? extends Element> elements) | Returns a list of packages in |
static Set<PackageElement> | packagesIn(Set<? extends Element> elements) | Returns a set of packages in |
static List<ModuleElement.ProvidesDirective> | providesIn(Iterable<? extends ModuleElement.Directive> directives) | Returns a list of |
static List<ModuleElement.RequiresDirective> | requiresIn(Iterable<? extends ModuleElement.Directive> directives) | Returns a list of |
static List<TypeElement> | typesIn(Iterable<? extends Element> elements) | Returns a list of types in |
static Set<TypeElement> | typesIn(Set<? extends Element> elements) | Returns a set of types in |
static List<ModuleElement.UsesDirective> | usesIn(Iterable<? extends ModuleElement.Directive> directives) | Returns a list of |
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods
fieldsIn
public static List<VariableElement> fieldsIn(Iterable<? extends Element> elements)
Returns a list of fields in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a list of fields in
elements
fieldsIn
public static Set<VariableElement> fieldsIn(Set<? extends Element> elements)
Returns a set of fields in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a set of fields in
elements
constructorsIn
public static List<ExecutableElement> constructorsIn(Iterable<? extends Element> elements)
Returns a list of constructors in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a list of constructors in
elements
constructorsIn
public static Set<ExecutableElement> constructorsIn(Set<? extends Element> elements)
Returns a set of constructors in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a set of constructors in
elements
methodsIn
public static List<ExecutableElement> methodsIn(Iterable<? extends Element> elements)
Returns a list of methods in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a list of methods in
elements
methodsIn
public static Set<ExecutableElement> methodsIn(Set<? extends Element> elements)
Returns a set of methods in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a set of methods in
elements
typesIn
public static List<TypeElement> typesIn(Iterable<? extends Element> elements)
Returns a list of types in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a list of types in
elements
typesIn
public static Set<TypeElement> typesIn(Set<? extends Element> elements)
Returns a set of types in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a set of types in
elements
packagesIn
public static List<PackageElement> packagesIn(Iterable<? extends Element> elements)
Returns a list of packages in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a list of packages in
elements
packagesIn
public static Set<PackageElement> packagesIn(Set<? extends Element> elements)
Returns a set of packages in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a set of packages in
elements
modulesIn
public static List<ModuleElement> modulesIn(Iterable<? extends Element> elements)
Returns a list of modules in elements
.
- Parameters:
-
elements
- the elements to filter - Returns:
- a list of modules in
elements
- Since:
- 9
modulesIn
public static Set<ModuleElement> modulesIn(Set<? extends Element> elements)
Returns a set of modules in elements
.
- 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 of exports
directives in directives
.
- Parameters:
-
directives
- the directives to filter - Returns:
- a list of
exports
directives indirectives
- Since:
- 9
opensIn
public static List<ModuleElement.OpensDirective> opensIn(Iterable<? extends ModuleElement.Directive> directives)
Returns a list of opens
directives in directives
.
- Parameters:
-
directives
- the directives to filter - Returns:
- a list of
opens
directives indirectives
- Since:
- 9
providesIn
public static List<ModuleElement.ProvidesDirective> providesIn(Iterable<? extends ModuleElement.Directive> directives)
Returns a list of provides
directives in directives
.
- Parameters:
-
directives
- the directives to filter - Returns:
- a list of
provides
directives indirectives
- Since:
- 9
requiresIn
public static List<ModuleElement.RequiresDirective> requiresIn(Iterable<? extends ModuleElement.Directive> directives)
Returns a list of requires
directives in directives
.
- Parameters:
-
directives
- the directives to filter - Returns:
- a list of
requires
directives indirectives
- Since:
- 9
usesIn
public static List<ModuleElement.UsesDirective> usesIn(Iterable<? extends ModuleElement.Directive> directives)
Returns a list of uses
directives in directives
.
- Parameters:
-
directives
- the directives to filter - Returns:
- a list of
uses
directives indirectives
- Since:
- 9
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.compiler/javax/lang/model/util/ElementFilter.html