|
Web Site | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.janino.Cookable
public abstract class Cookable
"Cooking" means scanning a sequence of JavaTM tokens with a Scanner
and turning them into some artifact. For example, if you cook a
ClassBodyEvaluator
, then the tokens are interpreted as a class body and compiled into
a Class
which is accessible through ClassBodyEvaluator.getClazz()
.
This class declares numerous cook*()
methods
that use a String
, a File
, an InputStream
or
a Reader
as the source of characters for scanning.
The cook*()
methods eventually invoke the abstract cook(Scanner)
method with a correctly configured Scanner
.
Constructor Summary | |
---|---|
Cookable()
|
Method Summary | |
---|---|
void |
cook(java.io.InputStream is)
Cook tokens from an InputStream , encoded in the "platform default encoding". |
void |
cook(java.io.InputStream is,
java.lang.String optionalEncoding)
|
void |
cook(java.io.Reader r)
|
abstract void |
cook(Scanner scanner)
To be implemented by the derived classes. |
void |
cook(java.lang.String s)
Cook tokens from a String . |
void |
cook(java.lang.String optionalFileName,
java.io.InputStream is)
Cook tokens from an InputStream , encoded in the "platform default encoding". |
void |
cook(java.lang.String optionalFileName,
java.io.InputStream is,
java.lang.String optionalEncoding)
|
void |
cook(java.lang.String optionalFileName,
java.io.Reader r)
|
void |
cookFile(java.io.File file)
Cook tokens from the given File , encoded in the "platform default encoding". |
void |
cookFile(java.io.File file,
java.lang.String optionalEncoding)
|
void |
cookFile(java.lang.String fileName)
Cook tokens from the named file, encoded in the "platform default encoding". |
void |
cookFile(java.lang.String fileName,
java.lang.String optionalEncoding)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cookable()
Method Detail |
---|
public abstract void cook(Scanner scanner) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.io.Reader r) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.lang.String optionalFileName, java.io.Reader r) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
optionalFileName
- Used when reporting errors and warnings.
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.io.InputStream is) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
InputStream
, encoded in the "platform default encoding".
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.lang.String optionalFileName, java.io.InputStream is) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
InputStream
, encoded in the "platform default encoding".
optionalFileName
- Used when reporting errors and warnings.
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.io.InputStream is, java.lang.String optionalEncoding) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.lang.String optionalFileName, java.io.InputStream is, java.lang.String optionalEncoding) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
optionalFileName
- Used when reporting errors and warnings.
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cook(java.lang.String s) throws CompileException, Parser.ParseException, Scanner.ScanException
String
.
Notice: If you pass a string literal, be sure to escape all JavaTM special characters, especially backslashes.
CompileException
Parser.ParseException
Scanner.ScanException
public final void cookFile(java.io.File file) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
File
, encoded in the "platform default encoding".
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cookFile(java.io.File file, java.lang.String optionalEncoding) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cookFile(java.lang.String fileName) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
public final void cookFile(java.lang.String fileName, java.lang.String optionalEncoding) throws CompileException, Parser.ParseException, Scanner.ScanException, java.io.IOException
CompileException
Parser.ParseException
Scanner.ScanException
java.io.IOException
|
Web Site | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |