ee.mare.indrek.jtlt.macros
Class EncloseMacro

Object
  extended byee.mare.indrek.jtlt.macros.MacroAdapter
      extended byee.mare.indrek.jtlt.macros.EncloseMacro
All Implemented Interfaces:
TemplateMacro

public class EncloseMacro
extends MacroAdapter

A macro constructor that takes macro name, and two arguments. The output of macro is macro argument between the two arguments. Macro is parsetime and non-recursive.


Constructor Summary
EncloseMacro(String name, String prefix, String sufix)
           
 
Method Summary
 String process(TemplateParams ctx, String name, String args)
          This method is called with given block context whenever a macro with registered name is found inside the tempalate.
 
Methods inherited from class ee.mare.indrek.jtlt.macros.MacroAdapter
getName, isParsetime, isRecursive
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncloseMacro

public EncloseMacro(String name,
                    String prefix,
                    String sufix)
Method Detail

process

public String process(TemplateParams ctx,
                      String name,
                      String args)
Description copied from interface: TemplateMacro
This method is called with given block context whenever a macro with registered name is found inside the tempalate. The macros are resolved immediately only if they are parsetime, otherwise on every Template.toString the data structures are parsed and macros expanded. If macro is parsetime the ctx is taken from the generator. You can add parameters into the template using the Template.addParam, for parsetime macros you'd have to extend the TemplateGenerator.

Specified by:
process in interface TemplateMacro
Overrides:
process in class MacroAdapter