|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rythmengine.resource.TemplateResourceBase
public abstract class TemplateResourceBase
Encapsulate the common logic of an ITemplateResource implementation
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
TemplateResourceBase()
There are certain cases that a type of resource does not need a specific loader. |
|
TemplateResourceBase(ITemplateResourceLoader loader)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.rythmengine.resource.ITemplateResource |
|---|
getKey, isValid |
| Field Detail |
|---|
protected static final ILogger logger
protected final ITemplateResourceLoader loader
protected boolean isProdMode
protected String cache
protected long nextCheckPoint
| Constructor Detail |
|---|
public TemplateResourceBase()
ToStringTemplateResource
public TemplateResourceBase(ITemplateResourceLoader loader)
| Method Detail |
|---|
protected RythmEngine getEngine()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectprotected abstract long defCheckInterval()
protected Long userCheckInterval()
protected abstract long lastModified()
protected abstract String reload()
public String asTemplateContent()
ITemplateResource
asTemplateContent in interface ITemplateResourcepublic final boolean refresh()
ITemplateResource
refresh in interface ITemplateResourcepublic String getSuggestedClassName()
ITemplateResource
getSuggestedClassName in interface ITemplateResource
public static ICodeType getTypeOfPath(RythmEngine engine,
String s)
public ICodeType codeType(RythmEngine engine)
ITemplateResource
codeType in interface ITemplateResourcepublic ITemplateResourceLoader getLoader()
ITemplateResource
getLoader in interface ITemplateResourceprotected static String path2CN(String path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||