Package org.codehaus.commons.compiler
Class Cookable
java.lang.Object
org.codehaus.commons.compiler.Cookable
- All Implemented Interfaces:
ICookable
- Direct Known Subclasses:
ClassBodyEvaluator
,ClassBodyEvaluator
,MultiCookable
,SimpleCompiler
,SimpleCompiler
Base class for a simple
ICookable
.
Basically, it implements all those cook()
convewnience methods, and leaves only cook(String, Reader)
unimplemented.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
cook
(InputStream is) Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".final void
cook
(InputStream is, String encoding) Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.final void
Reads, scans, parses and compiles Java tokens from the givenReader
.final void
Reads, scans, parses and compiles Java tokens from the givenString
.final void
cook
(String fileName, InputStream is) Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".final void
cook
(String fileName, InputStream is, String encoding) Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.abstract void
Reads, scans, parses and compiles Java tokens from the givenReader
.final void
Reads, scans, parses and compiles Java tokens from the givenString
.final void
Reads, scans, parses and compiles Java tokens from the givenFile
, encoded in the "platform default encoding".final void
Reads, scans, parses and compiles Java tokens from the givenFile
with the givenencoding
.final void
Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".final void
Reads, scans, parses and compiles Java tokens from the named file with the given encoding.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.commons.compiler.ICookable
getBytecodes, setSourceVersion, setTargetVersion
-
Constructor Details
-
Cookable
public Cookable()
-
-
Method Details
-
cook
public abstract void cook(@Nullable String fileName, Reader reader) throws CompileException, IOException Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenReader
.- Specified by:
cook
in interfaceICookable
- Parameters:
fileName
- Used when reporting errors and warnings- Throws:
CompileException
IOException
-
cook
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenReader
.- Specified by:
cook
in interfaceICookable
- Throws:
CompileException
IOException
-
cook
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".- Specified by:
cook
in interfaceICookable
- Throws:
CompileException
IOException
-
cook
public final void cook(@Nullable String fileName, InputStream is) throws CompileException, IOException Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".- Specified by:
cook
in interfaceICookable
- Parameters:
fileName
- Used when reporting errors and warnings- Throws:
CompileException
IOException
-
cook
public final void cook(InputStream is, @Nullable String encoding) throws CompileException, IOException Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.- Specified by:
cook
in interfaceICookable
- Throws:
CompileException
IOException
-
cook
public final void cook(@Nullable String fileName, InputStream is, @Nullable String encoding) throws CompileException, IOException Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.- Specified by:
cook
in interfaceICookable
- Parameters:
fileName
- Used when reporting errors and warnings- Throws:
CompileException
IOException
-
cook
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenString
.- Specified by:
cook
in interfaceICookable
- Throws:
CompileException
-
cook
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenString
.- Specified by:
cook
in interfaceICookable
- Parameters:
fileName
- Used when reporting errors and warnings- Throws:
CompileException
-
cookFile
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenFile
, encoded in the "platform default encoding".- Specified by:
cookFile
in interfaceICookable
- Throws:
CompileException
IOException
-
cookFile
public final void cookFile(File file, @Nullable String encoding) throws CompileException, IOException Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenFile
with the givenencoding
.- Specified by:
cookFile
in interfaceICookable
- Throws:
CompileException
IOException
-
cookFile
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".- Specified by:
cookFile
in interfaceICookable
- Throws:
CompileException
IOException
-
cookFile
public final void cookFile(String fileName, @Nullable String encoding) throws CompileException, IOException Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the named file with the given encoding.- Specified by:
cookFile
in interfaceICookable
- Throws:
CompileException
IOException
-