org.rythmengine.resource
Class ResourceLoaderBase

java.lang.Object
  extended by org.rythmengine.resource.ResourceLoaderBase
All Implemented Interfaces:
ITemplateResourceLoader
Direct Known Subclasses:
ClasspathResourceLoader, FileResourceLoader

public abstract class ResourceLoaderBase
extends Object
implements ITemplateResourceLoader

Implement common logic of an ITemplateResourceLoader


Field Summary
protected static ILogger logger
           
 
Constructor Summary
ResourceLoaderBase()
           
 
Method Summary
protected  RythmEngine getDefaultEngine()
           
 RythmEngine getEngine()
           
 String getFullName(TemplateClass tc)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rythmengine.extension.ITemplateResourceLoader
getResourceLoaderRoot, load
 

Field Detail

logger

protected static ILogger logger
Constructor Detail

ResourceLoaderBase

public ResourceLoaderBase()
Method Detail

getEngine

public RythmEngine getEngine()
Specified by:
getEngine in interface ITemplateResourceLoader

setEngine

public void setEngine(RythmEngine engine)
Specified by:
setEngine in interface ITemplateResourceLoader

getFullName

public String getFullName(TemplateClass tc)

getDefaultEngine

protected RythmEngine getDefaultEngine()

tryLoadTemplate

public TemplateClass tryLoadTemplate(String tmplName,
                                     RythmEngine engine,
                                     TemplateClass callerTemplateClass)
Description copied from interface: ITemplateResourceLoader
Try to load a template tag with tag name.

Specified by:
tryLoadTemplate in interface ITemplateResourceLoader
Returns:
template class if found, or null if not found

scan

public void scan(TemplateResourceManager manager)
Description copied from interface: ITemplateResourceLoader
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

Specified by:
scan in interface ITemplateResourceLoader
Parameters:
manager - the resource manager


Copyright © 2014. All Rights Reserved.