org.teatrove.tea.compiler
Class JavaClassGenerator

java.lang.Object
  extended by org.teatrove.tea.compiler.CodeGenerator
      extended by org.teatrove.tea.compiler.JavaClassGenerator

public class JavaClassGenerator
extends CodeGenerator

The JavaClassGenerator compiles a template into a single Java class file. A template is compiled such that it has two static methods, execute and getTemplateParameterNames. The signatures are:

     public static void execute(RuntimeContext, params ...) throws Exception;

     public static String[] getTemplateParameterNames();
 

Author:
Brian S O'Neill

Field Summary
static String EXECUTE_METHOD_NAME
           
static String PARAMETER_METHOD_NAME
           
 
Constructor Summary
JavaClassGenerator(CompilationUnit unit)
           
 
Method Summary
protected  void generateTemplate(Template t, String className, ClassFile classFile)
           
protected  void generateTemplateParameters(Template t, ClassFile classFile)
           
 void writeTo(OutputStream out)
           
 
Methods inherited from class org.teatrove.tea.compiler.CodeGenerator
getParseTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXECUTE_METHOD_NAME

public static final String EXECUTE_METHOD_NAME
See Also:
Constant Field Values

PARAMETER_METHOD_NAME

public static final String PARAMETER_METHOD_NAME
See Also:
Constant Field Values
Constructor Detail

JavaClassGenerator

public JavaClassGenerator(CompilationUnit unit)
Method Detail

writeTo

public void writeTo(OutputStream out)
             throws IOException
Specified by:
writeTo in class CodeGenerator
Throws:
IOException

generateTemplateParameters

protected void generateTemplateParameters(Template t,
                                          ClassFile classFile)

generateTemplate

protected void generateTemplate(Template t,
                                String className,
                                ClassFile classFile)


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.