fc.util
Interface CustomCode

All Known Implementing Classes:
TestCustomCode

public interface CustomCode

Should be implemented for custom code functionality inside a Template. Implementing classes must have a no-arg constructor. It is guaranteed that only one instance of this class will be instantiated by the engine, although multiple threads may possible use this class at the same time.


Method Summary
 void code(Writer writer, Template env)
          Called back from the template engine while substiting data inside a template.
 

Method Detail

code

void code(Writer writer,
          Template env)
          throws IOException
Called back from the template engine while substiting data inside a template.

Parameters:
writer - can be used to write data at the point in the merged file where the custom code was called. This writer should not be closed, otherwise the template engine will not be able to proceed after this method is invoked (since the template engine also uses the same writer.
env - a reference to the template engine, can be used to invoke methods in the engine.
Throws:
IOException