|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.locomotive.steam.CachedPageLoader
The CachedPageLoader evalutes templates from the filesystem or passed in as a string according to the rules of the LOCO Template Language. Templates are compiled the first time they are evaluated, then the compiled version is cached and used for subsequent re-evaluation. See the documentation for the template language for the details of its usage.
| Constructor Summary | |
CachedPageLoader(Log slog,
int id)
Contructs a CachedPageLoader with the specified debugging log/identifier for internal logging. |
|
| Method Summary | |
protected static org.locomotive.steam.MixedExpr |
cachedTemplateExpr(java.lang.String filename)
This method will get a template expression tree either from the cache or from a file. |
protected static org.locomotive.steam.MixedExpr |
cachedTemplateExpr(java.lang.String filename,
boolean evaluate)
This method will get a template expression tree either from the cache or from a file. |
static void |
clearTemplateCache()
This static method can be called to flush the template cache. |
java.lang.String |
evalString(java.lang.String string_to_eval,
java.util.Hashtable subs,
boolean allow_load_cmds)
Evaluate the following string. |
java.lang.String |
evalTemplate(java.lang.String t_path,
java.util.Hashtable subs)
Evaluate the given filename, relative to the given template root with the given substitution environment. |
static void |
initialize(java.lang.String templ_root,
int check_freq,
int initial_bufsize)
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public CachedPageLoader(Log slog,
int id)
slog - a destination log. May be null, in which case the
CPL will not logid - a unique id to be used in the output log. ignored if slog
is null;| Method Detail |
public static void initialize(java.lang.String templ_root,
int check_freq,
int initial_bufsize)
public java.lang.String evalTemplate(java.lang.String t_path,
java.util.Hashtable subs)
t_path - the path to the template, relative to the template_root
passed in via initialize()subs - The environment (in/out)
public java.lang.String evalString(java.lang.String string_to_eval,
java.util.Hashtable subs,
boolean allow_load_cmds)
string_to_eval - The string to evaluate.subs - The environment (in/out)allow_load_cmds - Whether or not to allow LOAD commands to load
in templates from files (using the template_root
passed in via initialize())protected static org.locomotive.steam.MixedExpr cachedTemplateExpr(java.lang.String filename)
If the file does not exist, or there were other problems, then it will return a tree with a single empty node which evaluates to "".
protected static org.locomotive.steam.MixedExpr cachedTemplateExpr(java.lang.String filename,
boolean evaluate)
If the file does not exist, or there were other problems, then it will return a tree with a single empty node which evaluates to "".
evaluate - whether or not to evaluate the file and parse it into
a template treepublic static void clearTemplateCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||