Interface ConfigSource

All Known Subinterfaces:
MutableConfigSource
All Known Implementing Classes:
DefaultConfigSource

public interface ConfigSource
Interface that contains the source of configuration data. All configuration data is organized relative to handle paths so that a source is expected to know the handle paths of all the data it manages, as well as the configuration data relative to a handle path.
Since:
1.0
Version:
2022-08-30
  • Method Details

    • getName

      default String getName()
      Returns the name of the source. Generally speaking, this should be unique among the list of sources.
    • getRank

      int getRank()
      Returns the rank of the source, which is used to order sources. Sources with higher ranks override sources with lower ranks.
    • gatherConfigPaths

      void gatherConfigPaths(Set<String> paths)
      Put all available config bean handle paths into the supplied set.
    • gatherConfigForPath

      void gatherConfigForPath(String path, Map<String,String> config)
      Put all configuration data for the specified handle path into the supplied map. The keys in the map are bean attribute names in dotted notation, and the values are the corresponding values for the attributes.
      Parameters:
      path - the handle path to return data for
      config - map to hold the resulting config data
    • getConfigValue

      void getConfigValue(String path, String attr, ConfigValue value)
      Populate the specified value bean with the effective value of the specified attribute from this source.
      Parameters:
      path - the handle path to return data for
      attr - the attribute of the config to return
      value - the value to populate
    • gatherOptionsPaths

      default void gatherOptionsPaths(Set<String> paths)
      Put all available option bean handle paths into the supplied set. Most sources don't support this so by default it does nothing.
    • gatherOptionsForPath

      default void gatherOptionsForPath(String path, Map<String,String> map)
      Put all option data for the specified handle path into the supplied map. The keys in the map are bean attribute names in dotted notation, and the values are the corresponding options for the attributes. Map, list and array bean attributes will contain * wildcards as all values in the map, list or array are assumed to be the same type. Most sources don't suppor this so by default it does nothing.
      Parameters:
      path - the handle path to return data for
      map - map to put the options into