org.teatrove.tea.util
Class ResourceCompiler

java.lang.Object
  extended by org.teatrove.tea.compiler.Compiler
      extended by org.teatrove.tea.util.AbstractCompiler
          extended by org.teatrove.tea.util.ResourceCompiler

public class ResourceCompiler
extends AbstractCompiler

ResourceCompiler compiles tea sources using the resource loading mechanism built into Java. The resource name must have the extension ".tea".

Author:
Brian S O'Neill
See Also:
Class.getResource(java.lang.String)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.teatrove.tea.util.AbstractCompiler
AbstractCompiler.AbstractUnit
 
Field Summary
 
Fields inherited from class org.teatrove.tea.util.AbstractCompiler
mEncoding, mForce, mInjector, mPrecompiledTolerance, mRootDestDir, mRootPackage
 
Constructor Summary
ResourceCompiler(ClassInjector injector)
           
ResourceCompiler(ClassInjector injector, String packagePrefix)
           
 
Method Summary
protected  CompilationUnit createCompilationUnit(String name)
           
 String[] getAllTemplateNames()
          Returns all sources (template names) available from the source directory and in all sub-directories.
 boolean sourceExists(String name)
           
 
Methods inherited from class org.teatrove.tea.util.AbstractCompiler
compile, compileAll, getRootPackage, setForceCompile
 
Methods inherited from class org.teatrove.tea.compiler.Compiler
addErrorListener, addImportedPackage, addImportedPackages, addStatusListener, compile, createCodeGenerator, createParser, createScanner, createSourceReader, createTypeChecker, getClassLoader, getCompilationUnit, getErrorCount, getImportedPackages, getParseTree, 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

ResourceCompiler

public ResourceCompiler(ClassInjector injector)
Parameters:
injector - ClassInjector to feed generated classes into

ResourceCompiler

public ResourceCompiler(ClassInjector injector,
                        String packagePrefix)
Parameters:
injector - ClassInjector to feed generated classes into
packagePrefix - The target package for the compiled templates
Method Detail

sourceExists

public boolean sourceExists(String name)
Specified by:
sourceExists in class Compiler
Returns:
true if source exists for the given qualified name

getAllTemplateNames

public String[] getAllTemplateNames()
                             throws IOException
Description copied from class: AbstractCompiler
Returns all sources (template names) available from the source directory and in all sub-directories.

Specified by:
getAllTemplateNames in class AbstractCompiler
Throws:
IOException

createCompilationUnit

protected CompilationUnit createCompilationUnit(String name)
Specified by:
createCompilationUnit in class Compiler


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