FileChooser.ExtensionFilter (JavaFX 17)

Module javafx.graphics
Package javafx.stage

## Class FileChooser.ExtensionFilter

- java.lang.Object
- - javafx.stage.FileChooser.ExtensionFilter

- Enclosing class:
    FileChooser

      public static final class FileChooser.ExtensionFilter
      extends Object

  Defines an extension filter, used for filtering which files can be chosen in a FileDialog based on the file name extensions.
  Since:
    JavaFX 2.0

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExtensionFilter​(String description, String... extensions)` | Creates an `ExtensionFilter` with the specified description and the file name extensions.
    `ExtensionFilter​(String description, List<String> extensions)` | Creates an `ExtensionFilter` with the specified description and the file name extensions.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getDescription()` | Gets the description for this `ExtensionFilter`.
    `List<String>` | `getExtensions()` | Gets the file name extensions for this `ExtensionFilter`.

    - ### Methods declared in class java.lang.Object

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

- - ### Constructor Detail

    - #### ExtensionFilter

          public ExtensionFilter​(String description,
                                 String... extensions)

      Creates an `ExtensionFilter` with the specified description and the file name extensions.

      File name extension should be specified in the `*.<extension>` format.

      Parameters:
        `description` - the textual description for the filter
        `extensions` - the accepted file name extensions
      Throws:
        `NullPointerException` - if the description or the extensions are `null`
        `IllegalArgumentException` - if the description or the extensions are empty

    - #### ExtensionFilter

          public ExtensionFilter​(String description,
                                 List<String> extensions)

      Creates an `ExtensionFilter` with the specified description and the file name extensions.

      File name extension should be specified in the `*.<extension>` format.

      Parameters:
        `description` - the textual description for the filter
        `extensions` - the accepted file name extensions
      Throws:
        `NullPointerException` - if the description or the extensions are `null`
        `IllegalArgumentException` - if the description or the extensions are empty

  - ### Method Detail

    - #### getDescription

          public String getDescription()

      Gets the description for this `ExtensionFilter`.
      Returns:
        the description

    - #### getExtensions

          public List<String> getExtensions()

      Gets the file name extensions for this `ExtensionFilter`.

      The returned list is unmodifiable and will throw `UnsupportedOperationException` on each modification attempt.

      Returns:
        the file name extensions