public abstract class InputStreamSourceFileLocator extends Object implements ISourceFileLocator
ISourceFileLocator
locator implementations
based on InputStream
s. It handles the encoding and tab width.Modifier | Constructor and Description |
---|---|
protected |
InputStreamSourceFileLocator(String encoding,
int tabWidth)
Creates a new locator with the given specification.
|
Modifier and Type | Method and Description |
---|---|
Reader |
getSourceFile(String packageName,
String fileName)
Tries to locate the given source file and opens a reader with the
appropriate encoding.
|
protected abstract InputStream |
getSourceStream(String path)
Tries to locate the given source file and opens its binary content.
|
int |
getTabWidth()
Returns number of blank characters that represent a tab in source code.
|
protected InputStreamSourceFileLocator(String encoding, int tabWidth)
encoding
- encoding of the source files, null
for platform
default encodingtabWidth
- tab width in source files as number of blankspublic Reader getSourceFile(String packageName, String fileName) throws IOException
ISourceFileLocator
getSourceFile
in interface ISourceFileLocator
packageName
- VM name of the packagefileName
- name of the source filenull
otherwiseIOException
- in case of problems while opening the filepublic int getTabWidth()
ISourceFileLocator
getTabWidth
in interface ISourceFileLocator
protected abstract InputStream getSourceStream(String path) throws IOException
path
- local path to the resourcenull
otherwiseIOException
- in case of problems while opening the streamCopyright © 2019. All rights reserved.