Interface ConfigSourceProvider

    • Method Detail

      • createMulti

        default List<ConfigSource> createMulti​(String type,
                                               Config metaConfig)
        Create a list of configuration sources from a single configuration.

        This method is called (only) when the meta configuration property multi-source is set to true.

        Example: for classpath config source, we may want to read all instances of the resource on classpath.

        type - type of the config source
        metaConfig - meta configuration of the config source
        a list of config sources, at least one MUST be returned, so we can correctly validate optional/mandatory sources.
      • supports

        boolean supports​(String type)
        Return true if this provider supports the type of meta-configurable object.
        type - type that is supported (such as file for ConfigSource meta configurable)
        true if this provider can create instances of the type
      • create

        T create​(String type,
                 Config metaConfig)
        Create an instance of the meta configurable using the provided meta configuration.
        type - type of the meta configurable
        metaConfig - meta configuration
        meta configurable configured from the metaConfig
      • supported

        Set<String> supported()
        Return a set of supported types. Used for error handling.
        a set of types supported by this provider