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​(java.lang.Object source)
    Test the input data format to see if it appears valid for reading with this config source.
    java.util.List<ElementData> getAll​(java.lang.String injectedName, java.lang.Object source)
    Read the source of data into a collection of config elements
    java.lang.String getName()
    If an element was created with a name, this name must be returned as the canonical name.
  • Method Details

    • canRead

      boolean canRead​(java.lang.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

      java.util.List<ElementData> getAll​(java.lang.String injectedName, java.lang.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

      java.lang.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