Package org.apache.torque.generator.configuration

# Interface ConfigurationProvider

All Known Implementing Classes:
  `AbstractConfigurationProvider`, `ClasspathConfigurationProvider`, `DirectoryConfigurationProvider`, `JarConfigurationProvider`

public interface ConfigurationProvider
Defines how the configuration for a generation unit can be accessed. Implementing classes provide InputStreams to access the various parts of the configuration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InputStream`
  `getControlConfigurationInputStream()`
  Creates a reader to access the control configuration.
  `String`
  `getControlConfigurationLocation()`
  Returns the location of the control configuration as human readable String for debugging and error tracking purposes.
  `InputStream`
  `getOptionsInputStream(String name)`
  Creates a reader to access an options file.
  `InputStream`
  `getOutletConfigurationInputStream(String name)`
  Creates a reader to access the configuration for one outlet.
  `Collection<String>`
  `getOutletConfigurationNames()`
  Returns a list of all found outlet configuration files in the generation unit.
  `InputStream`
  `getResourceInputStream(String path)`
  Creates a reader to access a resource file.
  `InputStream`
  `getTemplateInputStream(String name)`
  Creates a reader to access a template.
  `Collection<String>`
  `getTemplateNames()`
  Lists all available template names.

- ## Method Details

  - ### getControlConfigurationInputStream

    InputStream getControlConfigurationInputStream() throws ConfigurationException
    Creates a reader to access the control configuration. It is the callers responsibility to close the reader after use.
    Returns:
      a reader to access the control configuration, never null.
    Throws:
      `ConfigurationException` - if the reader can not be created.

  - ### getControlConfigurationLocation

    String getControlConfigurationLocation() throws ConfigurationException
    Returns the location of the control configuration as human readable String for debugging and error tracking purposes.
    Returns:
      the location of the control configuration, not null.
    Throws:
      `ConfigurationException` - if the location name can not be created.

  - ### getTemplateNames

    Collection<String> getTemplateNames() throws ConfigurationException
    Lists all available template names.
    Returns:
      a collection of all available template names, not null.
    Throws:
      `ConfigurationException` - if the template names cannot be determined.

  - ### getTemplateInputStream

    InputStream getTemplateInputStream(String name) throws ConfigurationException
    Creates a reader to access a template. It is the callers responsibility to close the reader after use.
    Parameters:
      `name` - the name (==path to) of the template.
    Returns:
      a reader to access a template, never null.
    Throws:
      `ConfigurationException` - if the reader can not be created.

  - ### getOutletConfigurationNames

    Collection<String> getOutletConfigurationNames() throws ConfigurationException
    Returns a list of all found outlet configuration files in the generation unit.
    Returns:
      a list with the generation configuration files, not null.
    Throws:
      `ConfigurationException` - if the configuration can not be read.

  - ### getOutletConfigurationInputStream

    InputStream getOutletConfigurationInputStream(String name) throws ConfigurationException
    Creates a reader to access the configuration for one outlet. It is the callers responsibility to close the reader after use.
    Parameters:
      `name` - the name (==path to) of the outlet configuration.
    Returns:
      a reader to access the outlet configuration, never null.
    Throws:
      `ConfigurationException` - if the reader can not be created.

  - ### getOptionsInputStream

    InputStream getOptionsInputStream(String name) throws ConfigurationException
    Creates a reader to access an options file. It is the callers responsibility to close the reader after use.
    Parameters:
      `name` - the name (==path to) of the options file.
    Returns:
      a reader to access the options file, never null.
    Throws:
      `ConfigurationException` - if the reader can not be created.

  - ### getResourceInputStream

    InputStream getResourceInputStream(String path) throws ConfigurationException
    Creates a reader to access a resource file. It is the callers responsibility to close the reader after use.
    Parameters:
      `path` - the path to of the resource file.
    Returns:
      a reader to access the options file, never null.
    Throws:
      `ConfigurationException` - if the reader can not be created.