public abstract class TemplateResourceBase extends Object implements ITemplateResource
ITemplateResource implementation| Modifier 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, waitgetKey, isValidprotected static final ILogger logger
protected final ITemplateResourceLoader loader
protected boolean isProdMode
protected String cache
protected long nextCheckPoint
public TemplateResourceBase()
ToStringTemplateResourcepublic TemplateResourceBase(ITemplateResourceLoader loader)
protected RythmEngine getEngine()
protected abstract long defCheckInterval()
protected Long userCheckInterval()
protected abstract long lastModified()
protected abstract String reload()
public String asTemplateContent()
ITemplateResourceasTemplateContent in interface ITemplateResourcepublic final boolean refresh()
ITemplateResourcerefresh in interface ITemplateResourcepublic String getSuggestedClassName()
ITemplateResourcegetSuggestedClassName in interface ITemplateResourcepublic static ICodeType getTypeOfPath(RythmEngine engine, String s)
public ICodeType codeType(RythmEngine engine)
ITemplateResourcecodeType in interface ITemplateResourcepublic ITemplateResourceLoader getLoader()
ITemplateResourcegetLoader in interface ITemplateResourceCopyright © 2015. All Rights Reserved.