public abstract class TemplateResourceBase extends Object implements ITemplateResource
ITemplateResource
implementationModifier and Type | Field and Description |
---|---|
protected String |
cache |
protected boolean |
isProdMode |
protected ITemplateResourceLoader |
loader
When this field is set to null, it assumes using Rythm's singleton mode
This field should be set to null if needs to serialize the template resource to some where, e.g.
|
protected static ILogger |
logger |
protected long |
nextCheckPoint |
Constructor and Description |
---|
TemplateResourceBase()
There are certain cases that a type of resource does not need a specific loader.
|
TemplateResourceBase(ITemplateResourceLoader loader) |
Modifier and Type | Method and Description |
---|---|
String |
asTemplateContent()
Return template content as a string.
|
ICodeType |
codeType(RythmEngine engine)
Return code type suggested by this resource, e.g.
|
protected abstract long |
defCheckInterval() |
boolean |
equals(Object obj) |
protected RythmEngine |
getEngine() |
ITemplateResourceLoader |
getLoader()
Return the loader that loaded this resource
|
String |
getSuggestedClassName()
Propose a name of generated java class for this resource
|
static ICodeType |
getTypeOfPath(RythmEngine engine,
String s) |
int |
hashCode() |
protected abstract long |
lastModified() |
protected static String |
path2CN(String path) |
boolean |
refresh()
Refresh resource if necessary
|
protected abstract String |
reload() |
protected Long |
userCheckInterval() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getKey, isValid
protected static final ILogger logger
protected final ITemplateResourceLoader loader
protected boolean isProdMode
protected String cache
protected long nextCheckPoint
public TemplateResourceBase()
ToStringTemplateResource
public TemplateResourceBase(ITemplateResourceLoader loader)
protected RythmEngine getEngine()
protected abstract long defCheckInterval()
protected Long userCheckInterval()
protected abstract long lastModified()
protected abstract String reload()
public String asTemplateContent()
ITemplateResource
asTemplateContent
in interface ITemplateResource
public final boolean refresh()
ITemplateResource
refresh
in interface ITemplateResource
public String getSuggestedClassName()
ITemplateResource
getSuggestedClassName
in interface ITemplateResource
public static ICodeType getTypeOfPath(RythmEngine engine, String s)
public ICodeType codeType(RythmEngine engine)
ITemplateResource
codeType
in interface ITemplateResource
public ITemplateResourceLoader getLoader()
ITemplateResource
getLoader
in interface ITemplateResource
Copyright © 2015. All Rights Reserved.