org.jamon.compiler
Class RecompilingTemplateManager
java.lang.Object
org.jamon.compiler.RecompilingTemplateManager
- All Implemented Interfaces:
- org.jamon.TemplateManager
public class RecompilingTemplateManager
- extends java.lang.Object
- implements org.jamon.TemplateManager
An implementation of the TemplateManager interface which
supports dynamic regeneration and recompilation of templates as
they are changed, much as JSP does.
RecompilingTemplateManager instances are thread-safe. In
your applications, you generally want exactly one instance of a
RecompilingTemplateManager (i.e. a singleton).
Configuration of a RecompilingTemplateManager occurs only
at construction time, and is determined by the
RecompilingTemplateManager.Data object passed to the
constructor. The properties on the Data are:
- setSourceDir - determines where the
RecompilingTemplateManager looks for template source
files. Default is the current directory, which is most likely
unsuitable for most situations.
- setWorkDir - determines where the generated Java
source files corresponding to templates are placed. Default is
uniquely generated subdirectory under the directory specified by
the system property java.io.tmpdir.
- setJavaCompiler - determines what program to execute
to compile the generated Java source files. Default is
bin/javac under the directory specified by the system
property java.home.
- setClasspath - used to specify additional components
to prepend to the classpath when compiling generated Java source
files. Default is null.
- setClassLoader - used to set the class loader
explicitly. Default is use the class loader of the
RecompilingTemplateManager instance.
|
Method Summary |
org.jamon.AbstractTemplateProxy.Intf |
constructImpl(org.jamon.AbstractTemplateProxy p_proxy)
|
org.jamon.AbstractTemplateProxy |
constructProxy(java.lang.String p_path)
Given a template path, return a proxy for that template. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecompilingTemplateManager
public RecompilingTemplateManager()
RecompilingTemplateManager
public RecompilingTemplateManager(RecompilingTemplateManager.Data p_data)
constructImpl
public org.jamon.AbstractTemplateProxy.Intf constructImpl(org.jamon.AbstractTemplateProxy p_proxy)
- Specified by:
constructImpl in interface org.jamon.TemplateManager
constructProxy
public org.jamon.AbstractTemplateProxy constructProxy(java.lang.String p_path)
- Given a template path, return a proxy for that template.
- Specified by:
constructProxy in interface org.jamon.TemplateManager
- Parameters:
p_path - the path to the template
- Returns:
- a
Template proxy instance
jamon