モジュール 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)
      elementsのレコード・コンポーネントのリストを戻します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elementsのレコード・コンポーネントのリスト
      導入されたバージョン:
      16
    • recordComponentsIn

      public static Set<RecordComponentElement> recordComponentsIn(Set<? extends Element> elements)
      elementsの一連のレコード・コンポーネントを返します。
      パラメータ:
      elements - フィルタ処理する要素
      戻り値:
      elementsのレコード・コンポーネントのセット
      導入されたバージョン:
      16
    • 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