|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.peaseplate.internal.locator.InMemoryTemplateLocator
public class InMemoryTemplateLocator
Constructor Summary | |
---|---|
InMemoryTemplateLocator(char[] source)
|
Method Summary | |
---|---|
ResourceKey |
getKey()
Returns the key |
java.lang.Long |
getRawSize()
Returns the raw size of the resource. |
java.lang.Long |
getTimestamp()
Returns the timestamp of the resource. |
java.lang.String |
highlight(java.lang.String message,
int line,
int column)
Create a highlight from the resource with the position at line and column highlighted :) May return null. |
boolean |
isOutdated()
Returns true if the resource described by the locator got updated and needs to be reloaded |
char[] |
load()
Returns a char array with the raw template data Don't forget to update the timestamp and the rawSize properties when loading the data. |
Template |
resolve(TemplateEngine engine,
java.lang.String name,
java.util.Locale locale,
java.lang.String encoding)
Resolves the template with the specified name relative to this template. |
void |
setRawSize(java.lang.Long rawSize)
Sets the raw size |
void |
setTimestamp(java.lang.Long timestamp)
Sets the timestamp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.peaseplate.locator.Locator |
---|
toString |
Constructor Detail |
---|
public InMemoryTemplateLocator(char[] source)
Method Detail |
---|
public ResourceKey getKey()
Locator
getKey
in interface Locator
Locator.getKey()
public java.lang.Long getRawSize()
Locator
getRawSize
in interface Locator
Locator.getRawSize()
public java.lang.Long getTimestamp()
Locator
getTimestamp
in interface Locator
Locator.getTimestamp()
public boolean isOutdated()
Locator
isOutdated
in interface Locator
Locator.isOutdated()
public void setRawSize(java.lang.Long rawSize)
Locator
setRawSize
in interface Locator
rawSize
- the raw size, may be nullLocator.setRawSize(java.lang.Long)
public void setTimestamp(java.lang.Long timestamp)
Locator
setTimestamp
in interface Locator
timestamp
- the timestamp, may be nullLocator.setTimestamp(java.lang.Long)
public java.lang.String highlight(java.lang.String message, int line, int column)
TemplateLocator
highlight
in interface TemplateLocator
message
- TODOline
- the linecolumn
- the column
TemplateLocator.highlight(String, int, int)
public char[] load() throws TemplateException
TemplateLocator
load
in interface TemplateLocator
TemplateException
- on occasionTemplateLocator.load()
public Template resolve(TemplateEngine engine, java.lang.String name, java.util.Locale locale, java.lang.String encoding) throws TemplateException
TemplateLocator
resolve
in interface TemplateLocator
engine
- the enginename
- the name, relative or absolutelocale
- the localeencoding
- the locale for loading
TemplateException
- on occasionTemplateLocator.resolve(org.peaseplate.TemplateEngine, java.lang.String, java.util.Locale, java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |