|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A DataSource for a Template. This encapsulates what is the notion
of a template from the parser's point of view: some named entity, that
might change over time and thus has a modification time; an input reader
to access the contents.
So DataSource
is a general source where templates can come
from. You can think of Files, URLs, Database-BLOBS ..
Method Summary | |
java.lang.String |
getCanonicalName()
Returns a canonical name of this DataSource. |
java.lang.String |
getCharacterEncoding()
This returns the encoding of the DataSource. |
java.io.Reader |
getInputReader()
Gets an Reader of this DataSource. |
long |
lastModified()
Returns the time the content of this DataSource was last modified. |
Method Detail |
public java.lang.String getCanonicalName()
The name returned here is used to look up the parsing
result of the internal caching, so it should differ
for all different Sources :-)
May return null
if this Source is supposed
to be parsed each time. The canonical name would be something
like a filename or an URL.
public java.lang.String getCharacterEncoding()
public java.io.Reader getInputReader() throws java.io.IOException
Note that this method may be called twice if the page has to be parsed first. So you probably have to implement a buffer if your underlying source is transient ..
java.io.IOException
public long lastModified()
The return value is used to decide whether to reparse a Source or not. Reparsing is done if the value returned here differs from the value returned at the last processing time. This may not return a 'real' time, it needs just to be comparable to itself; so some sort of version counter would be perfect as well.
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |