|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object ee.mare.indrek.jtlt.Template
Template class is the basic building block to generate templated content.
Constructor Summary | |
Template(TemplateGenerator gen)
Create a template using given template generator as base. |
Method Summary | |
void |
addParam(String key,
Object val)
Set macro parameters for given block and sub-blocks to val. |
boolean |
exists(String name)
To find out whether a given subblock exists. |
TemplateGenerator |
getBase()
Get the base generator template. |
boolean |
instance(String sub_name)
Lock and unlock given block name in one call. |
void |
instance(String sub_name,
Map map)
Lock given sub and do tlt.replace (map). |
boolean |
lock_back(String sub_name)
Lock and create another block of given subtemplate for replacements, placing the block at the back of other blocks previously created. |
boolean |
lock_front(String sub_name)
Lock and create another block of given subtemplate for replacements, placing the block at the front of other blocks previously created. |
boolean |
lock(String sub_name)
Lock and create another block of given subtemplate for replacements. |
void |
nreplace(String key,
String value)
Replace given key in the template with value in this block and all subblocks. |
void |
output(Writer out)
Output the template contents. |
void |
replace(Map map)
Replace all keys-values inside the map. |
void |
replace(String key,
String value)
Replace given key in the template with value in the currently active block. |
String |
toString()
Convert the template to string. |
void |
unlock()
Unlock previously locked block of subtemplate moving up in scope. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Template(TemplateGenerator gen)
Method Detail |
public void addParam(String key, Object val)
public boolean exists(String name)
public TemplateGenerator getBase()
public boolean instance(String sub_name)
public void instance(String sub_name, Map map)
replace(Map)
public boolean lock_back(String sub_name)
public boolean lock_front(String sub_name)
public boolean lock(String sub_name)
TemplateContext.setComplainTo(java.io.PrintStream)
public void nreplace(String key, String value)
public void output(Writer out) throws IOException
IOException
public void replace(Map map)
public void replace(String key, String value)
public String toString()
public void unlock()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |