モジュール java.compiler
パッケージ javax.lang.model.util

クラスElementFilter

java.lang.Object
javax.lang.model.util.ElementFilter

public class ElementFilter
extends Object
要素のコレクションから目的の要素だけを選択するためのフィルタです。 返されるセットおよびリストは新しいコレクションで、引数をバッキング・ストアとして使用します。 このクラスのメソッドは、引数が並行して変更されないように保護することはありません。 返されるセットおよびリストは可変ですが、並行アクセスに対して安全ではありません。 返されるセットの繰返し順序は、メソッドに設定される引数と同じです。

nullを含む反復可能なオブジェクトおよびセットがこのクラスのメソッドに引数として渡されると、NullPointerExceptionがスローされます。

導入されたバージョン:
1.6
  • メソッドの詳細

    • fieldsIn

      public static List<VariableElement> fieldsIn​(Iterable<? extends Element> elements)
      elements内のフィールドのリストを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のフィールドのリスト
    • fieldsIn

      public static Set<VariableElement> fieldsIn​(Set<? extends Element> elements)
      elements内のフィールドのセットを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のフィールドのセット
    • recordComponentsIn

      public static List<RecordComponentElement> recordComponentsIn​(Iterable<? extends Element> elements)
      このメソッドは、Java言語のプレビュー機能であるrecordに関連付けられています。 プレビュー機能は、将来のリリースで削除されるか、Java言語の永続機能にアップグレードされる可能性があります。

      elementsのレコード・コンポーネントのリストを戻します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elementsのレコード・コンポーネントのリスト
      導入されたバージョン:
      14
    • recordComponentsIn

      public static Set<RecordComponentElement> recordComponentsIn​(Set<? extends Element> elements)
      このメソッドは、Java言語のプレビュー機能であるrecordに関連付けられています。 プレビュー機能は、将来のリリースで削除されるか、Java言語の永続機能にアップグレードされる可能性があります。

      elementsの一連のレコード・コンポーネントを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elementsのレコード・コンポーネントのセット
      導入されたバージョン:
      14
    • constructorsIn

      public static List<ExecutableElement> constructorsIn​(Iterable<? extends Element> elements)
      elements内のコンストラクタのリストを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のコンストラクタのリスト
    • constructorsIn

      public static Set<ExecutableElement> constructorsIn​(Set<? extends Element> elements)
      elements内のコンストラクタのセットを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のコンストラクタのセット
    • methodsIn

      public static List<ExecutableElement> methodsIn​(Iterable<? extends Element> elements)
      elements内のメソッドのリストを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のメソッドのリスト
    • methodsIn

      public static Set<ExecutableElement> methodsIn​(Set<? extends Element> elements)
      elements内のメソッドのセットを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のメソッドのセット
    • typesIn

      public static List<TypeElement> typesIn​(Iterable<? extends Element> elements)
      elements内の型のリストを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内の型のリスト
    • typesIn

      public static Set<TypeElement> typesIn​(Set<? extends Element> elements)
      elements内の型のセットを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内の型のセット
    • packagesIn

      public static List<PackageElement> packagesIn​(Iterable<? extends Element> elements)
      elements内のパッケージのリストを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のパッケージのリスト
    • packagesIn

      public static Set<PackageElement> packagesIn​(Set<? extends Element> elements)
      elements内のパッケージのセットを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のパッケージのセット
    • modulesIn

      public static List<ModuleElement> modulesIn​(Iterable<? extends Element> elements)
      elements内のモジュールのリストを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elements内のモジュールのリスト
      導入されたバージョン:
      9
    • modulesIn

      public static Set<ModuleElement> modulesIn​(Set<? extends Element> elements)
      elements内のモジュールのセットを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elementsのモジュール・セット
      導入されたバージョン:
      9
    • exportsIn

      public static List<ModuleElement.ExportsDirective> exportsIn​(Iterable<? extends ModuleElement.Directive> directives)
      directivesexportsディレクティブのリストを返します。
      パラメータ:
      directives - フィルタへのディレクティブ
      戻り値:
      directivesexportsディレクティブのリスト
      導入されたバージョン:
      9
    • opensIn

      public static List<ModuleElement.OpensDirective> opensIn​(Iterable<? extends ModuleElement.Directive> directives)
      directivesopensディレクティブのリストを返します。
      パラメータ:
      directives - フィルタへのディレクティブ
      戻り値:
      directivesopensディレクティブのリスト
      導入されたバージョン:
      9
    • providesIn

      public static List<ModuleElement.ProvidesDirective> providesIn​(Iterable<? extends ModuleElement.Directive> directives)
      directivesprovidesディレクティブのリストを返します。
      パラメータ:
      directives - フィルタへのディレクティブ
      戻り値:
      directivesprovidesディレクティブのリスト
      導入されたバージョン:
      9
    • requiresIn

      public static List<ModuleElement.RequiresDirective> requiresIn​(Iterable<? extends ModuleElement.Directive> directives)
      directivesrequiresディレクティブのリストを返します。
      パラメータ:
      directives - フィルタへのディレクティブ
      戻り値:
      directivesrequiresディレクティブのリスト
      導入されたバージョン:
      9
    • usesIn

      public static List<ModuleElement.UsesDirective> usesIn​(Iterable<? extends ModuleElement.Directive> directives)
      directivesusesディレクティブのリストを返します。
      パラメータ:
      directives - フィルタへのディレクティブ
      戻り値:
      directivesusesディレクティブのリスト
      導入されたバージョン:
      9