Interface ConfigurationFormat

    • Method Detail

      • forExtension

        static @Nullable ConfigurationFormat forExtension​(java.lang.String extension)
        Get a configuration format that can handle the specified extension.

        If a format fails to load, it will be ignored when p

        Parameters:
        extension - the extension to handle
        Returns:
        a format, or null if none is known
        Since:
        4.2.0
      • supportedFormats

        static java.util.Set<ConfigurationFormatsupportedFormats()
        Get all supported configuration formats.

        If any exceptions were thrown while discovering or loading configuration format services, they will be rethrown on calling this method.

        Returns:
        all known formats
        Since:
        4.2.0
      • id

        java.lang.String id()
        An identifier describing this loader.

        This should match the naming used in other locations, such as the loader's artifact ID or class name.

        Returns:
        the loader identifier
        Since:
        4.2.0
      • supportedExtensions

        java.util.Set<java.lang.String> supportedExtensions()
        Get the file extensions known to be supported by this format.
        Returns:
        the supported extensions
        Since:
        4.2.0
      • create

        default ConfigurationLoader<? extends @NonNull java.lang.Object> create​(java.nio.file.Path file)
        Create a new loader configured to load from the provided file, with default style options.
        Parameters:
        file - the file to load from
        Returns:
        a newly configured loader
        Since:
        4.2.0
      • create

        ConfigurationLoader<? extends @NonNull java.lang.Object> create​(java.nio.file.Path file,
                                                                        ConfigurationNode options)
        Create a new loader configured to load from the provided file.
        Parameters:
        file - the file to load from
        options - the options to use to configure the node
        Returns:
        a newly configured loader
        Since:
        4.2.0
      • create

        default ConfigurationLoader<? extends @NonNull java.lang.Object> create​(java.net.URL url)
        Create a new loader configured to load from the provided URL, with default style options.

        This loader may not be able to write to the given URL

        Parameters:
        url - the URL to load from
        Returns:
        a newly configured loader
        Since:
        4.2.0
      • create

        ConfigurationLoader<? extends @NonNull java.lang.Object> create​(java.net.URL url,
                                                                        ConfigurationNode options)
        Create a new loader configured to load from the provided URL.

        This loader may not be able to write to the given URL.

        Parameters:
        url - the URL to load from
        options - the options to use to configure the node
        Returns:
        a newly configured loader
        Since:
        4.2.0