| java.lang.Object java.lang.Compiler com.go.tea.util.AbstractFileCompiler com.go.tea.util.FileCompiler
All known Subclasses: com.go.tea.util.TestCompiler,
FileCompiler | public class FileCompiler extends AbstractFileCompiler (Code) | | FileCompiler compiles tea source files by reading them from a file or a
directory. The compiled code can be written as class files to a given
destination directory, they can be passed to a ClassInjector, or they
can be sent to both.
When given a directory, FileCompiler compiles all files with the
extension ".tea". If a destination directory is used, tea files that have a
matching class file that is more up-to-date will not be compiled, unless
they are forced to be re-compiled.
author: Brian S O'Neill version: 42 21 01/02/06 See Also: ClassInjector |
Constructor Summary | |
public | FileCompiler(File rootSourceDir, String rootPackage, File rootDestDir, ClassInjector injector) | public | FileCompiler(File rootSourceDir, String rootPackage, File rootDestDir, ClassInjector injector, String encoding) | public | FileCompiler(File[] rootSourceDirs, String rootPackage, File rootDestDir, ClassInjector injector) | public | FileCompiler(File[] rootSourceDirs, String rootPackage, File rootDestDir, ClassInjector injector, String encoding) | public | FileCompiler(File[] rootSourceDirs, String rootPackage, File rootDestDir, ClassInjector injector, String encoding, Map parseTreeMap) Parameters: rootSourceDirs - Required root source directories Parameters: rootPackage - Optional root package to compile source to Parameters: rootDestDir - Optional directory to place generated class files Parameters: injector - Optional ClassInjector to feed generated classes into Parameters: encoding - Optional character encoding used by source files Parameters: parseTreeMap - Optional map should be thread-safe. |
FileCompiler | public FileCompiler(File rootSourceDir, String rootPackage, File rootDestDir, ClassInjector injector)(Code) | | Parameters: rootSourceDir - Required root source directory Parameters: rootPackage - Optional root package to compile source to Parameters: rootDestDir - Optional directory to place generated class files Parameters: injector - Optional ClassInjector to feed generated classes into |
FileCompiler | public FileCompiler(File rootSourceDir, String rootPackage, File rootDestDir, ClassInjector injector, String encoding)(Code) | | Parameters: rootSourceDir - Required root source directory Parameters: rootPackage - Optional root package to compile source to Parameters: rootDestDir - Optional directory to place generated class files Parameters: injector - Optional ClassInjector to feed generated classes into Parameters: encoding - Optional character encoding used by source files |
FileCompiler | public FileCompiler(File[] rootSourceDirs, String rootPackage, File rootDestDir, ClassInjector injector)(Code) | | Parameters: rootSourceDirs - Required root source directories Parameters: rootPackage - Optional root package to compile source to Parameters: rootDestDir - Optional directory to place generated class files Parameters: injector - Optional ClassInjector to feed generated classes into |
FileCompiler | public FileCompiler(File[] rootSourceDirs, String rootPackage, File rootDestDir, ClassInjector injector, String encoding)(Code) | | Parameters: rootSourceDirs - Required root source directories Parameters: rootPackage - Optional root package to compile source to Parameters: rootDestDir - Optional directory to place generated class files Parameters: injector - Optional ClassInjector to feed generated classes into Parameters: encoding - Optional character encoding used by source files |
FileCompiler | public FileCompiler(File[] rootSourceDirs, String rootPackage, File rootDestDir, ClassInjector injector, String encoding, Map parseTreeMap)(Code) | | Parameters: rootSourceDirs - Required root source directories Parameters: rootPackage - Optional root package to compile source to Parameters: rootDestDir - Optional directory to place generated class files Parameters: injector - Optional ClassInjector to feed generated classes into Parameters: encoding - Optional character encoding used by source files Parameters: parseTreeMap - Optional map should be thread-safe. SeeCompiler for details. |
compileAll | public String[] compileAll(boolean recurse) throws IOException(Code) | | Compiles all files in the source directory.
Parameters: recurse - When true, recursively compiles all files and directories The names of all the compiled sources |
createCompilationUnit | protected CompilationUnit createCompilationUnit(String name)(Code) | | Always returns an instance of FileCompiler.Unit. Any errors reported
by the compiler that have a reference to a CompilationUnit will have
been created by this factory method. Casting this to FileCompiler.Unit
allows error reporters to access the source file via the getSourceFile
method.
See Also: FileCompiler.Unit.getSourceFile |
main | public static void main(String[] args) throws Exception(Code) | | Entry point for a command-line tool suitable for compiling Tea
templates to be bundled with a product. Templates are read from files
that must have the extension ".tea", and any compilation error messages
are sent to standard out.
Usage: java com.go.tea.util.FileCompiler {options}
<template root directory> {templates}
where {options} includes:
-context <class> Specify a runtime context class to compile against.
-dest <directory> Specify where to place generated class files.
-force Compile all templates, even if up-to-date.
-package <package> Root package to compile templates into.
-encoding <encoding> Specify character encoding used by source files.
-guardian Enable the exception guardian.
|
setForceCompile | public void setForceCompile(boolean force)(Code) | | Parameters: force - When true, compile all source, even if up-to-date |
|
|