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
public abstract class Cookable extends java.lang.Object implements ICookable
Base class for a simpleICookable
.Basically, it implements all those
cook()
convewnience methods, and leaves onlycook(String, Reader)
unimplemented.
-
-
Constructor Summary
Constructors Constructor Description Cookable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cook(java.io.InputStream is)
Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".void
cook(java.io.InputStream is, java.lang.String encoding)
Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.void
cook(java.io.Reader r)
Reads, scans, parses and compiles Java tokens from the givenReader
.void
cook(java.lang.String s)
Reads, scans, parses and compiles Java tokens from the givenString
.void
cook(java.lang.String fileName, java.io.InputStream is)
Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".void
cook(java.lang.String fileName, java.io.InputStream is, java.lang.String encoding)
Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.abstract void
cook(java.lang.String fileName, java.io.Reader reader)
Reads, scans, parses and compiles Java tokens from the givenReader
.void
cook(java.lang.String fileName, java.lang.String s)
Reads, scans, parses and compiles Java tokens from the givenString
.void
cookFile(java.io.File file)
Reads, scans, parses and compiles Java tokens from the givenFile
, encoded in the "platform default encoding".void
cookFile(java.io.File file, java.lang.String encoding)
Reads, scans, parses and compiles Java tokens from the givenFile
with the givenencoding
.void
cookFile(java.lang.String fileName)
Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".void
cookFile(java.lang.String fileName, java.lang.String encoding)
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
-
-
-
-
Method Detail
-
cook
public abstract void cook(@Nullable java.lang.String fileName, java.io.Reader reader) throws CompileException, java.io.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
java.io.IOException
-
cook
public final void cook(java.io.Reader r) throws CompileException, java.io.IOException
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenReader
.- Specified by:
cook
in interfaceICookable
- Throws:
CompileException
java.io.IOException
-
cook
public final void cook(java.io.InputStream is) throws CompileException, java.io.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
- Throws:
CompileException
java.io.IOException
-
cook
public final void cook(@Nullable java.lang.String fileName, java.io.InputStream is) throws CompileException, java.io.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
java.io.IOException
-
cook
public final void cook(java.io.InputStream is, @Nullable java.lang.String encoding) throws CompileException, java.io.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
java.io.IOException
-
cook
public final void cook(@Nullable java.lang.String fileName, java.io.InputStream is, @Nullable java.lang.String encoding) throws CompileException, java.io.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
java.io.IOException
-
cook
public final void cook(java.lang.String s) throws CompileException
Description copied from interface:ICookable
Reads, scans, parses and compiles Java tokens from the givenString
.- Specified by:
cook
in interfaceICookable
- Throws:
CompileException
-
cook
public final void cook(@Nullable java.lang.String fileName, java.lang.String s) throws CompileException
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
public final void cookFile(java.io.File file) throws CompileException, java.io.IOException
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
java.io.IOException
-
cookFile
public final void cookFile(java.io.File file, @Nullable java.lang.String encoding) throws CompileException, java.io.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
java.io.IOException
-
cookFile
public final void cookFile(java.lang.String fileName) throws CompileException, java.io.IOException
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
java.io.IOException
-
cookFile
public final void cookFile(java.lang.String fileName, @Nullable java.lang.String encoding) throws CompileException, java.io.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
java.io.IOException
-
-