文档管理中心

您当前正在浏览HarmonyOS开发者3.0版本配套的开发者文档,对应API能力级别为API 8 Release。此版本文档已归档不再维护,推荐您使用HarmonyOS NEXT版本

API参考Java API参考javax.lang.model.utilClassElementFilter

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.

Note that a static import statement can make the text of calls to the methods in this class more concise; for example:

     import static javax.lang.model.util.ElementFilter.*;
     ...
         List<VariableElement> fs = fieldsIn(someClass.getEnclosedElements());
 

Since:

1.6

Method Summary

展开

Modifier and Type

Method

Description

static List<ExecutableElement>

constructorsIn​(Iterable<? extends Element> elements)

Returns a list of constructors in elements.

static Set<ExecutableElement>

constructorsIn​(Set<? extends Element> elements)

Returns a set of constructors in elements.

static List<VariableElement>

fieldsIn​(Iterable<? extends Element> elements)

Returns a list of fields in elements.

static Set<VariableElement>

fieldsIn​(Set<? extends Element> elements)

Returns a set of fields in elements.

static List<ExecutableElement>

methodsIn​(Iterable<? extends Element> elements)

Returns a list of methods in elements.

static Set<ExecutableElement>

methodsIn​(Set<? extends Element> elements)

Returns a set of methods in elements.

static List<PackageElement>

packagesIn​(Iterable<? extends Element> elements)

Returns a list of packages in elements.

static Set<PackageElement>

packagesIn​(Set<? extends Element> elements)

Returns a set of packages in elements.

static List<TypeElement>

typesIn​(Iterable<? extends Element> elements)

Returns a list of types in elements.

static Set<TypeElement>

typesIn​(Set<? extends Element> elements)

Returns a set of types in elements.

展开

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

fieldsIn

public static List<VariableElement> fieldsIn​(Iterable<? extends Element> elements)

Returns a list of fields in elements.

Parameters:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

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:

展开

Parameter Name

Parameter Description

elements

the elements to filter

Returns:

a set of packages in elements

搜索
请输入您想要搜索的关键词