Package com.scriptbasic.sourceproviders
Class StringSourceProvider
- java.lang.Object
-
- com.scriptbasic.sourceproviders.AbstractSourceProvider
-
- com.scriptbasic.sourceproviders.AbstractSingleIncludeSourceProvider
-
- com.scriptbasic.sourceproviders.SingleIncludeNonRelativeSourceProvider
-
- com.scriptbasic.sourceproviders.StringSourceProvider
-
- All Implemented Interfaces:
SourceProvider
public class StringSourceProvider extends SingleIncludeNonRelativeSourceProvider
This implementation provides the source from strings.- Author:
- Peter Verhas
-
-
Constructor Summary
Constructors Constructor Description StringSourceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSource(java.lang.String fileName, java.lang.String sourceCode)Add a new source to the set of available sources.SourceReadergetSource(java.lang.String sourceName)-
Methods inherited from class com.scriptbasic.sourceproviders.SingleIncludeNonRelativeSourceProvider
getKeyName, getKeyName, getSource
-
Methods inherited from class com.scriptbasic.sourceproviders.AbstractSingleIncludeSourceProvider
get, get, getSingleInclude, setSingleInclude
-
-
-
-
Method Detail
-
addSource
public void addSource(java.lang.String fileName, java.lang.String sourceCode)Add a new source to the set of available sources.- Parameters:
fileName- the name of the source. This name can be used in include statements in other BASIC sources and also this can be used to get the reader from the provider.sourceCode- The actual code of the source program.
-
getSource
public SourceReader getSource(java.lang.String sourceName) throws java.io.IOException
This implementation returns a
GenericSourceReader.- Specified by:
getSourcein classSingleIncludeNonRelativeSourceProvider- Throws:
java.io.IOException
-
-