org.apache.tapestry.engine
Class DefaultTemplateSource

java.lang.Object
  extended by org.apache.tapestry.engine.DefaultTemplateSource
All Implemented Interfaces:
ITemplateSource, IRenderDescription

public class DefaultTemplateSource
extends Object
implements ITemplateSource, IRenderDescription

Default implementation of ITemplateSource. Templates, once parsed, stay in memory until explicitly cleared.

An instance of this class acts as a singleton shared by all sessions, so it must be threadsafe.

Version:
$Id: DefaultTemplateSource.java 243931 2004-07-22 14:19:37Z hlship $
Author:
Howard Lewis Ship

Field Summary
 
Fields inherited from interface org.apache.tapestry.engine.ITemplateSource
TEMPLATE_ASSET_NAME, TEMPLATE_TAG_PARAMETER_NAME
 
Constructor Summary
DefaultTemplateSource()
           
 
Method Summary
 ComponentTemplate getTemplate(IRequestCycle cycle, IComponent component)
          Reads the template for the component.
 void renderDescription(IMarkupWriter writer)
          Object should render a description of itself to the writer.
 void reset()
          Clears the template cache.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTemplateSource

public DefaultTemplateSource()
Method Detail

reset

public void reset()
Clears the template cache. This is used during debugging.

Specified by:
reset in interface ITemplateSource

getTemplate

public ComponentTemplate getTemplate(IRequestCycle cycle,
                                     IComponent component)
Reads the template for the component.

Returns null if the template can't be found.

Specified by:
getTemplate in interface ITemplateSource
Parameters:
cycle - The request cycle loading the template; this is required in some cases when the template is loaded from an IAsset.
component - The component for which a template should be loaded.

toString

public String toString()
Overrides:
toString in class Object

renderDescription

public void renderDescription(IMarkupWriter writer)
Description copied from interface: IRenderDescription
Object should render a description of itself to the writer.

Specified by:
renderDescription in interface IRenderDescription
Since:
1.0.6