pnuts.compiler
Class FileWriterHandler

java.lang.Object
  extended by pnuts.compiler.FileWriterHandler
All Implemented Interfaces:
java.io.Serializable, ClassFileHandler

public class FileWriterHandler
extends java.lang.Object
implements ClassFileHandler, java.io.Serializable

This class is a concrete class of ClassFileHandler. When this is passed to Compiler.compile(..., ClassFileHandler), compiled class files are saved in the directory specified with the constructor.

See Also:
Serialized Form

Constructor Summary
FileWriterHandler(java.io.File dir)
           
 
Method Summary
 java.lang.Object handle(ClassFile cf)
          This method is called with each compiled class file when Compiler.compile(Pnuts, ClassFileHandler) method is called.
protected  void handleException(java.lang.Exception e)
           
 void setVerbose(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileWriterHandler

public FileWriterHandler(java.io.File dir)
Method Detail

setVerbose

public void setVerbose(boolean flag)

handleException

protected void handleException(java.lang.Exception e)

handle

public java.lang.Object handle(ClassFile cf)
Description copied from interface: ClassFileHandler
This method is called with each compiled class file when Compiler.compile(Pnuts, ClassFileHandler) method is called. The first class file is supposed to be of pnuts.lang.Executable subclass. The compiled code can be executed with Executable.run(Context) method.

Specified by:
handle in interface ClassFileHandler