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 simple `ICookable`.

Basically, it implements all those `cook()` convewnience methods, and leaves only `cook(String, Reader)` unimplemented.

## Constructor Summary

Constructors
Constructor
Description
`Cookable()`

## Method Summary

Modifier and Type
Method
Description
`final void`
`cook(InputStream is)`
Reads, scans, parses and compiles Java tokens from the given `InputStream`, encoded in the "platform default encoding".
`final void`
`cook(InputStream is, String encoding)`
Reads, scans, parses and compiles Java tokens from the given `InputStream` with the given `encoding`.
`final void`
`cook(Reader r)`
Reads, scans, parses and compiles Java tokens from the given `Reader`.
`final void`
`cook(String s)`
Reads, scans, parses and compiles Java tokens from the given `String`.
`final void`
`cook(String fileName, InputStream is)`
Reads, scans, parses and compiles Java tokens from the given `InputStream`, encoded in the "platform default encoding".
`final void`
`cook(String fileName, InputStream is, String encoding)`
Reads, scans, parses and compiles Java tokens from the given `InputStream` with the given `encoding`.
`abstract void`
`cook(String fileName, Reader reader)`
Reads, scans, parses and compiles Java tokens from the given `Reader`.
`final void`
`cook(String fileName, String s)`
Reads, scans, parses and compiles Java tokens from the given `String`.
`final void`
`cookFile(File file)`
Reads, scans, parses and compiles Java tokens from the given `File`, encoded in the "platform default encoding".
`final void`
`cookFile(File file, String encoding)`
Reads, scans, parses and compiles Java tokens from the given `File` with the given `encoding`.
`final void`
`cookFile(String fileName)`
Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".
`final void`
`cookFile(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`

## 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 given `Reader`.

Specified by:
  `cook` in interface `ICookable`
Parameters:
  `fileName` - Used when reporting errors and warnings
Throws:
  `CompileException`
  `IOException`

### cook

public final void cook(Reader r) throws CompileException, IOException
Description copied from interface: `ICookable`
Reads, scans, parses and compiles Java tokens from the given `Reader`.

Specified by:
  `cook` in interface `ICookable`
Throws:
  `CompileException`
  `IOException`

### cook

public final void cook(InputStream is) throws CompileException, IOException
Description copied from interface: `ICookable`
Reads, scans, parses and compiles Java tokens from the given `InputStream`, encoded in the "platform default encoding".

Specified by:
  `cook` in interface `ICookable`
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 given `InputStream`, encoded in the "platform default encoding".

Specified by:
  `cook` in interface `ICookable`
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 given `InputStream` with the given `encoding`.

Specified by:
  `cook` in interface `ICookable`
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 given `InputStream` with the given `encoding`.

Specified by:
  `cook` in interface `ICookable`
Parameters:
  `fileName` - Used when reporting errors and warnings
Throws:
  `CompileException`
  `IOException`

### cook

public final void cook(String s) throws CompileException
Description copied from interface: `ICookable`
Reads, scans, parses and compiles Java tokens from the given `String`.

Specified by:
  `cook` in interface `ICookable`
Throws:
  `CompileException`

### cook

public final void cook(@Nullable String fileName, String s) throws CompileException
Description copied from interface: `ICookable`
Reads, scans, parses and compiles Java tokens from the given `String`.

Specified by:
  `cook` in interface `ICookable`
Parameters:
  `fileName` - Used when reporting errors and warnings
Throws:
  `CompileException`

### cookFile

public final void cookFile(File file) throws CompileException, IOException
Description copied from interface: `ICookable`
Reads, scans, parses and compiles Java tokens from the given `File`, encoded in the "platform default encoding".

Specified by:
  `cookFile` in interface `ICookable`
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 given `File` with the given `encoding`.

Specified by:
  `cookFile` in interface `ICookable`
Throws:
  `CompileException`
  `IOException`

### cookFile

public final void cookFile(String fileName) throws CompileException, 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 interface `ICookable`
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 interface `ICookable`
Throws:
  `CompileException`
  `IOException`