com.go.teaservlet.util
Class RemoteCompiler

java.lang.Object
  |
  +--com.go.tea.compiler.Compiler
        |
        +--com.go.tea.util.AbstractFileCompiler
              |
              +--com.go.teaservlet.util.RemoteCompiler

public class RemoteCompiler
extends AbstractFileCompiler

RemoteCompiler compiles tea source files by reading them from a remote location specified by a URL. 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 URL, RemoteCompiler 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.

Version:
6 21 00/12/13
Author:
Jonathan Colwell
See Also:
ClassInjector

Inner Class Summary
 class RemoteCompiler.Unit
           
 
Constructor Summary
RemoteCompiler(java.lang.String[] rootSourceDirs, java.lang.String rootPackage, java.io.File rootDestDir, ClassInjector injector, java.lang.String encoding)
           
 
Method Summary
 java.lang.String[] compile(java.lang.String[] names)
          Overrides the method from Compiler to allow timestamp synchronization after the actual compilation has taken place.
protected  CompilationUnit createCompilationUnit(java.lang.String name)
           
 java.lang.String[] getAllTemplateNames()
          Returns all sources (template names) available from the source directory and in all sub-directories.
 void setForceCompile(boolean force)
           
 boolean sourceExists(java.lang.String name)
          Checks that the source code for a specified template exists.
 
Methods inherited from class com.go.tea.util.AbstractFileCompiler
compileAll
 
Methods inherited from class com.go.tea.compiler.Compiler
addErrorListener, addStatusListener, compile, createCodeGenerator, createParser, createScanner, createSourceReader, createTypeChecker, getClassLoader, getCompilationUnit, getErrorCount, getImportedPackages, getRuntimeContext, getRuntimeContextMethods, getRuntimeReceiver, getRuntimeStringConverter, getStringConverterMethods, isCodeGenerationEnabled, isExceptionGuardianEnabled, loadClass, preserveParseTree, removeErrorListener, removeStatusListener, setClassLoader, setCodeGenerationEnabled, setExceptionGuardianEnabled, setRuntimeContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteCompiler

public RemoteCompiler(java.lang.String[] rootSourceDirs,
                      java.lang.String rootPackage,
                      java.io.File rootDestDir,
                      ClassInjector injector,
                      java.lang.String encoding)
Method Detail

setForceCompile

public void setForceCompile(boolean force)
Parameters:
force - When true, compile all source, even if up-to-date

sourceExists

public boolean sourceExists(java.lang.String name)
Checks that the source code for a specified template exists.
Overrides:
sourceExists in class Compiler
Following copied from class: com.go.tea.compiler.Compiler
Returns:
true if source exists for the given qualified name

getAllTemplateNames

public java.lang.String[] getAllTemplateNames()
Description copied from class: AbstractFileCompiler
Returns all sources (template names) available from the source directory and in all sub-directories.
Overrides:
getAllTemplateNames in class AbstractFileCompiler

compile

public java.lang.String[] compile(java.lang.String[] names)
                           throws java.io.IOException
Overrides the method from Compiler to allow timestamp synchronization after the actual compilation has taken place.
Overrides:
compile in class Compiler
Following copied from class: com.go.tea.compiler.Compiler
Parameters:
names - an array of fully qualified template names
Returns:
The names of all the sources compiled by this compiler
Throws:
java.io.IOException -  

createCompilationUnit

protected CompilationUnit createCompilationUnit(java.lang.String name)
Overrides:
createCompilationUnit in class Compiler