org.rythmengine.extension
Interface ITemplateResourceLoader

All Known Implementing Classes:
ClasspathResourceLoader, FileResourceLoader, ResourceLoaderBase

public interface ITemplateResourceLoader

Defines the behavior of a template resource loader


Method Summary
 RythmEngine getEngine()
           
 String getResourceLoaderRoot()
          Return root path of this resource loader
 ITemplateResource load(String path)
          Load template resource by path
 void scan(TemplateResourceManager manager)
          Scan the folder and try to load all template files under the folder.
 void setEngine(RythmEngine engine)
           
 TemplateClass tryLoadTemplate(String tmplName, RythmEngine engine, TemplateClass callerTemplateClass)
          Try to load a template tag with tag name.
 

Method Detail

setEngine

void setEngine(RythmEngine engine)

getEngine

RythmEngine getEngine()

getResourceLoaderRoot

String getResourceLoaderRoot()
Return root path of this resource loader

Returns:
the root path

load

ITemplateResource load(String path)
Load template resource by path

Parameters:
path -
Returns:
Loaded template resource

tryLoadTemplate

TemplateClass tryLoadTemplate(String tmplName,
                              RythmEngine engine,
                              TemplateClass callerTemplateClass)
Try to load a template tag with tag name.

Parameters:
tmplName -
engine -
callerTemplateClass -
Returns:
template class if found, or null if not found

scan

void scan(TemplateResourceManager manager)
Scan the folder and try to load all template files under the folder. Once a resource is located, it should be passed to the resource manager by TemplateResourceManager.resourceLoaded(ITemplateResource) call

Note it is up to the loader implementation to decide the root path where to start the scan

Parameters:
manager - the resource manager


Copyright © 2014. All Rights Reserved.