ISourceFileLocator
DirectorySourceFileLocator
public abstract class InputStreamSourceFileLocator extends java.lang.Object implements ISourceFileLocator
ISourceFileLocator
locator implementations
based on InputStream
s. It handles the encoding and tab width.Modifier | Constructor | Description |
---|---|---|
protected |
InputStreamSourceFileLocator(java.lang.String encoding,
int tabWidth) |
Creates a new locator with the given specification.
|
Modifier and Type | Method | Description |
---|---|---|
java.io.Reader |
getSourceFile(java.lang.String packageName,
java.lang.String fileName) |
Tries to locate the given source file and opens a reader with the
appropriate encoding.
|
protected abstract java.io.InputStream |
getSourceStream(java.lang.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(java.lang.String encoding, int tabWidth)
encoding
- encoding of the source files, null
for platform
default encodingtabWidth
- tab width in source files as number of blankspublic java.io.Reader getSourceFile(java.lang.String packageName, java.lang.String fileName) throws java.io.IOException
ISourceFileLocator
getSourceFile
in interface ISourceFileLocator
packageName
- VM name of the packagefileName
- name of the source filenull
otherwisejava.io.IOException
- in case of problems while opening the filepublic int getTabWidth()
ISourceFileLocator
getTabWidth
in interface ISourceFileLocator
protected abstract java.io.InputStream getSourceStream(java.lang.String path) throws java.io.IOException
path
- local path to the resourcenull
otherwisejava.io.IOException
- in case of problems while opening the streamCopyright © 2018. All rights reserved.