Interface ConfigSource

All Known Implementing Classes:
JsonConfigSource, ListBackedConfigSource, MapBackedConfigSource, ParamsParserSource

public interface ConfigSource
A Config Source knows how to read a block of data and convert it into a stream of zero or more configuration elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRead(Object source)
    Test the input data format to see if it appears valid for reading with this config source.
    getAll(String injectedName, Object source)
    Read the source of data into a collection of config elements
    If an element was created with a name, this name must be returned as the canonical name.
  • Method Details

    • canRead

      boolean canRead(Object source)
      Test the input data format to see if it appears valid for reading with this config source.
      Parameters:
      source - An object of any kind
      Returns:
      true if the text is parsable by this config source
    • getAll

      List<ElementData> getAll(String injectedName, Object source)
      Read the source of data into a collection of config elements
      Parameters:
      source - An object of any kind
      Returns:
      a collection of Elements
    • getName

      String getName()
      If an element was created with a name, this name must be returned as the canonical name. If it was not, then the name field can provide the name.
      Returns:
      A name, or null if it is not given nor present in the name field