public abstract class AbstractResourceLoader<T> extends Object implements ResourceLoader<T>
Constructor and Description |
---|
AbstractResourceLoader(String templateExtName,
String layoutExtName,
String macroLibraryExtName) |
Modifier and Type | Method and Description |
---|---|
ResourceLoader |
addTemplate(Template template)
添加模板对象
|
ClassLoader |
getClassLoader()
返回类加载器
|
Template |
getLayout(String path)
返回布局对象
|
String |
getLayoutExtName()
返回布局文件的扩展名
|
String |
getLayoutPath(String templatePath)
返回路径
|
Template |
getMacroLibrary(String path)
返回宏库文件
|
String |
getMacroLibraryExtName() |
Template |
getTemplate(String path)
返回模板对象,如果不存在则返回null
|
TemplateEngine |
getTemplateEngine()
获取模板引擎
|
String |
getTemplateExtName()
返回模板文件的扩展名
|
boolean |
isLayout(String path) |
boolean |
isLoadResource(String path)
是否引擎加载的资源
|
boolean |
isMacroLibrary(String path) |
boolean |
isTemplate(String path) |
protected abstract Template |
loadTemplateItem(String path) |
void |
setClassLoader(ClassLoader classLoader)
设置类加载器
|
void |
setLayoutExtName(String layoutExtName) |
void |
setMacroLibraryExtName(String macroLibraryExtName) |
void |
setTemplateEngine(TemplateEngine templateEngine)
注入模板引擎
|
void |
setTemplateExtName(String templateExtName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTemplate, getResourceContent, isModified, resetModified
public boolean isTemplate(String path)
public boolean isLayout(String path)
public boolean isMacroLibrary(String path)
public boolean isLoadResource(String path)
path
- public ClassLoader getClassLoader()
ResourceLoader
getClassLoader
in interface ResourceLoader<T>
public void setClassLoader(ClassLoader classLoader)
ResourceLoader
setClassLoader
in interface ResourceLoader<T>
public String getLayoutPath(String templatePath)
ResourceLoader
getLayoutPath
in interface ResourceLoader<T>
public String getTemplateExtName()
ResourceLoader
getTemplateExtName
in interface ResourceLoader<T>
public void setTemplateExtName(String templateExtName)
public String getLayoutExtName()
ResourceLoader
getLayoutExtName
in interface ResourceLoader<T>
public void setLayoutExtName(String layoutExtName)
public String getMacroLibraryExtName()
public void setMacroLibraryExtName(String macroLibraryExtName)
public Template getTemplate(String path) throws TemplateException
ResourceLoader
getTemplate
in interface ResourceLoader<T>
TemplateException
public Template getLayout(String path) throws TemplateException
ResourceLoader
getLayout
in interface ResourceLoader<T>
TemplateException
public Template getMacroLibrary(String path) throws TemplateException
ResourceLoader
getMacroLibrary
in interface ResourceLoader<T>
TemplateException
protected abstract Template loadTemplateItem(String path) throws TemplateException
TemplateException
public ResourceLoader addTemplate(Template template) throws TemplateException
ResourceLoader
addTemplate
in interface ResourceLoader<T>
TemplateException
public TemplateEngine getTemplateEngine()
ResourceLoader
getTemplateEngine
in interface ResourceLoader<T>
public void setTemplateEngine(TemplateEngine templateEngine)
ResourceLoader
setTemplateEngine
in interface ResourceLoader<T>
Copyright © 2006–2018 TinyGroup. All rights reserved.