Class AbstractConfigurationProvider
java.lang.Object
org.apache.torque.generator.configuration.AbstractConfigurationProvider
- All Implemented Interfaces:
ConfigurationProvider
- Direct Known Subclasses:
ClasspathConfigurationProvider,DirectoryConfigurationProvider,JarConfigurationProvider
A base class for all ConfigurationProvider implementations.
- Version:
- $Id$
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractConfigurationProvider(TorqueGeneratorPaths configurationPaths) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionCreates a reader to access the control configuration.protected abstract InputStreamgetInputStream(String name, String directory, String fileDescription) getOptionsInputStream(String name) Creates a reader to access an options file.Creates a reader to access the configuration for one outlet.getResourceInputStream(String name) Creates a reader to access a resource file.getTemplateInputStream(String name) Creates a reader to access a template.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.torque.generator.configuration.ConfigurationProvider
getControlConfigurationLocation, getOutletConfigurationNames, getTemplateNames
-
Constructor Details
-
AbstractConfigurationProvider
Constructor.- Parameters:
configurationPaths- The internal directory structure of the Torque generator configuration files, not null.- Throws:
NullPointerException- if configurationPaths is null.
-
-
Method Details
-
getControlConfigurationInputStream
Description copied from interface:ConfigurationProviderCreates a reader to access the control configuration. It is the callers responsibility to close the reader after use.- Specified by:
getControlConfigurationInputStreamin interfaceConfigurationProvider- Returns:
- a reader to access the control configuration, never null.
- Throws:
ConfigurationException- if the reader can not be created.
-
getTemplateInputStream
Description copied from interface:ConfigurationProviderCreates a reader to access a template. It is the callers responsibility to close the reader after use.- Specified by:
getTemplateInputStreamin interfaceConfigurationProvider- 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.
-
getOutletConfigurationInputStream
Description copied from interface:ConfigurationProviderCreates a reader to access the configuration for one outlet. It is the callers responsibility to close the reader after use.- Specified by:
getOutletConfigurationInputStreamin interfaceConfigurationProvider- 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.
-
getResourceInputStream
Description copied from interface:ConfigurationProviderCreates a reader to access a resource file. It is the callers responsibility to close the reader after use.- Specified by:
getResourceInputStreamin interfaceConfigurationProvider- Parameters:
name- 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.
-
getOptionsInputStream
Description copied from interface:ConfigurationProviderCreates a reader to access an options file. It is the callers responsibility to close the reader after use.- Specified by:
getOptionsInputStreamin interfaceConfigurationProvider- 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.
-
getInputStream
protected abstract InputStream getInputStream(String name, String directory, String fileDescription) throws ConfigurationException - Parameters:
name- input stream namedirectory- locationfileDescription- describes the file- Returns:
- an InputStream
- Throws:
ConfigurationException- if unable to process
-