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 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 voidcook(InputStream is)Reads, scans, parses and compiles Java tokens from the givenInputStream, encoded in the "platform default encoding".voidcook(InputStream is, String encoding)Reads, scans, parses and compiles Java tokens from the givenInputStreamwith the givenencoding.voidcook(Reader r)Reads, scans, parses and compiles Java tokens from the givenReader.voidcook(String s)Reads, scans, parses and compiles Java tokens from the givenString.voidcook(String fileName, InputStream is)Reads, scans, parses and compiles Java tokens from the givenInputStream, encoded in the "platform default encoding".voidcook(String fileName, InputStream is, String encoding)Reads, scans, parses and compiles Java tokens from the givenInputStreamwith the givenencoding.abstract voidcook(String fileName, Reader reader)Reads, scans, parses and compiles Java tokens from the givenReader.voidcook(String fileName, String s)Reads, scans, parses and compiles Java tokens from the givenString.voidcookFile(File file)Reads, scans, parses and compiles Java tokens from the givenFile, encoded in the "platform default encoding".voidcookFile(File file, String encoding)Reads, scans, parses and compiles Java tokens from the givenFilewith the givenencoding.voidcookFile(String fileName)Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".voidcookFile(String fileName, 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 String fileName, Reader reader) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenReader.- Specified by:
cookin interfaceICookable- Parameters:
fileName- Used when reporting errors and warnings- Throws:
CompileExceptionIOException
-
cook
public final void cook(Reader r) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenReader.- Specified by:
cookin interfaceICookable- Throws:
CompileExceptionIOException
-
cook
public final void cook(InputStream is) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenInputStream, encoded in the "platform default encoding".- Specified by:
cookin interfaceICookable- Throws:
CompileExceptionIOException
-
cook
public final void cook(@Nullable String fileName, InputStream is) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenInputStream, encoded in the "platform default encoding".- Specified by:
cookin interfaceICookable- Parameters:
fileName- Used when reporting errors and warnings- Throws:
CompileExceptionIOException
-
cook
public final void cook(InputStream is, @Nullable String encoding) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenInputStreamwith the givenencoding.- Specified by:
cookin interfaceICookable- Throws:
CompileExceptionIOException
-
cook
public final void cook(@Nullable String fileName, InputStream is, @Nullable String encoding) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenInputStreamwith the givenencoding.- Specified by:
cookin interfaceICookable- Parameters:
fileName- Used when reporting errors and warnings- Throws:
CompileExceptionIOException
-
cook
public final void cook(String s) throws CompileException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenString.- Specified by:
cookin interfaceICookable- Throws:
CompileException
-
cook
public final void cook(@Nullable String fileName, String s) throws CompileException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenString.- Specified by:
cookin interfaceICookable- Parameters:
fileName- Used when reporting errors and warnings- Throws:
CompileException
-
cookFile
public final void cookFile(File file) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenFile, encoded in the "platform default encoding".- Specified by:
cookFilein interfaceICookable- Throws:
CompileExceptionIOException
-
cookFile
public final void cookFile(File file, @Nullable String encoding) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the givenFilewith the givenencoding.- Specified by:
cookFilein interfaceICookable- Throws:
CompileExceptionIOException
-
cookFile
public final void cookFile(String fileName) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".- Specified by:
cookFilein interfaceICookable- Throws:
CompileExceptionIOException
-
cookFile
public final void cookFile(String fileName, @Nullable String encoding) throws CompileException, IOException
Description copied from interface:ICookableReads, scans, parses and compiles Java tokens from the named file with the given encoding.- Specified by:
cookFilein interfaceICookable- Throws:
CompileExceptionIOException
-
-