org.rythmengine.resource
Class ResourceLoaderBase
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static ILogger logger
ResourceLoaderBase
public ResourceLoaderBase()
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.