Package com.scriptbasic.sourceproviders
Class AbstractSingleIncludeSourceProvider
java.lang.Object
com.scriptbasic.sourceproviders.AbstractSourceProvider
com.scriptbasic.sourceproviders.AbstractSingleIncludeSourceProvider
- All Implemented Interfaces:
SourceProvider
- Direct Known Subclasses:
SingleIncludeNonRelativeSourceProvider
An abstract class to be extended by the source provider implementations that
do not want to include one source more than once.
The implementations should not override the methods get() but should
implement the abstract methods getSource(). The method
getSource() is invoked only when it is ensured that the source was
not yet included.
- Author:
- Peter Verhas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SourceReaderGet a reader to a source when there is no referencing source.final SourceReaderGet a reader to a source specifying the source that references this source.protected abstract StringgetKeyName(String sourceName) protected abstract StringgetKeyName(String sourceName, String referencingSource) protected abstract SourceReaderprotected abstract SourceReadervoidsetSingleInclude(SingleIncludeChecker singleInclude)
-
Constructor Details
-
AbstractSingleIncludeSourceProvider
public AbstractSingleIncludeSourceProvider()
-
-
Method Details
-
getSingleInclude
-
setSingleInclude
-
get
Description copied from interface:SourceProviderGet a reader to a source when there is no referencing source. This is the main source.- Specified by:
getin interfaceSourceProvider- Specified by:
getin classAbstractSourceProvider- Parameters:
sourceName- the name of the source- Returns:
- reader reading the source file.
- Throws:
IOException- in case of exception
-
get
Description copied from interface:SourceProviderGet a reader to a source specifying the source that references this source.- Specified by:
getin interfaceSourceProvider- Specified by:
getin classAbstractSourceProvider- Parameters:
sourceName- the name of the source to get the reader to.referencingSource- the name of the source that is referencing the source to read.- Returns:
- return value
- Throws:
IOException- in case of exception
-
getSource
- Throws:
IOException
-
getSource
protected abstract SourceReader getSource(String sourceName, String referencingSource) throws IOException - Throws:
IOException
-
getKeyName
-
getKeyName
-