| Constructor and Description |
|---|
Scanner(File file)
Deprecated.
This method is deprecated because it leaves the input file open
|
Scanner(File file,
String optionalEncoding)
Deprecated.
This method is deprecated because it leaves the input file open
|
Scanner(String fileName)
Deprecated.
This method is deprecated because it leaves the input file open
|
Scanner(String optionalFileName,
InputStream is)
Sets up a scanner that reads tokens from the given
InputStream in the platform default encoding. |
Scanner(String optionalFileName,
InputStream is,
String optionalEncoding)
Sets up a scanner that reads tokens from the given
InputStream with the given
optionalEncoding (null means platform default encoding). |
Scanner(String optionalFileName,
Reader in)
Sets up a scanner that reads tokens from the given
Reader. |
Scanner(String optionalFileName,
Reader in,
int initialLineNumber,
int initialColumnNumber)
Creates a
Scanner that counts lines and columns from non-default initial values. |
Scanner(String fileName,
String encoding)
Deprecated.
This method is deprecated because it leaves the input file open
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
This method is deprecated, because the concept described above is confusing. An application should
close the underlying
InputStream or Reader itself |
String |
getFileName() |
Location |
location() |
Token |
produce()
Produces and returns the next token.
|
void |
setIgnoreWhiteSpace(boolean value)
If value is
true, then white space in the input stream is ignored, rather than
scanned as a TokenType.WHITE_SPACE token. |
@Deprecated public Scanner(String fileName) throws IOException
IOException@Deprecated public Scanner(String fileName, String encoding) throws IOException
IOException@Deprecated public Scanner(File file) throws IOException
IOException@Deprecated public Scanner(File file, @Nullable String optionalEncoding) throws IOException
IOExceptionpublic Scanner(@Nullable String optionalFileName, InputStream is) throws IOException
InputStream in the platform default encoding.
The fileName is solely used for reporting in thrown exceptions.
IOExceptionpublic Scanner(@Nullable String optionalFileName, InputStream is, @Nullable String optionalEncoding) throws IOException
InputStream with the given
optionalEncoding (null means platform default encoding).
The optionalFileName is used for reporting errors during compilation and for source level
debugging, and should name an existing file. If null is passed, and the system property
org.codehaus.janino.source_debugging.enable is set to "true", then a temporary file in
org.codehaus.janino.source_debugging.dir or the system's default temp dir is created in order to
make the source code available to a debugger.
IOExceptionpublic Scanner(@Nullable String optionalFileName, Reader in) throws IOException
Reader.
The optionalFileName is used for reporting errors during compilation and for source level
debugging, and should name an existing file. If null is passed, and the system property org.codehaus.janino.source_debugging.enable is set to "true", then a temporary file in org.codehaus.janino.source_debugging.dir or the system's default temp dir is created in order to make the
source code available to a debugger.
IOExceptionpublic Scanner(@Nullable String optionalFileName, Reader in, int initialLineNumber, int initialColumnNumber) throws IOException
Scanner that counts lines and columns from non-default initial values.IOExceptionpublic void setIgnoreWhiteSpace(boolean value)
true, then white space in the input stream is ignored, rather than
scanned as a TokenType.WHITE_SPACE token. Since white space is typically quite numerous, this
optimization may save considerable overhead.@Nullable public String getFileName()
@Deprecated public void close() throws IOException
InputStream or Reader itselfInputStream, Reader) associated with this object. The results
of future calls to produce() are undefined.IOExceptionpublic Token produce() throws CompileException, IOException
null
product, but by an TokenType.END_OF_INPUT-type token.CompileExceptionIOExceptionCopyright © 2019. All rights reserved.