|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISourceCodeEnhancer
Allow user application or more probably a framework plugin based on rythm to inject common import statements, render arguments and source code into generated java source code
Nested Class Summary | |
---|---|
static class |
ISourceCodeEnhancer.INSTS
This is used by RythmConfiguration and user application
should not use this static member |
Method Summary | |
---|---|
Map<String,?> |
getRenderArgDescriptions()
Return implicit render args type information indexed by render arg name. |
List<String> |
imports()
Return a list of import statement to be injected into the generated java source code. |
void |
setRenderArgs(ITemplate template)
Set implicit render arg values to a template instance . |
String |
sourceCode()
Return source code to be added to template class. |
Method Detail |
---|
List<String> imports()
Note, only package declaration part needs to be put inside the Strings. the
import
directive is not required. E.g.
List ls = new ArrayList();
ls.put("models.*");
ls.put("controllers.*);
This method is called by rythm when generating java source code out from a template souce code
String sourceCode()
Map<String,?> getRenderArgDescriptions()
Class
instance or a String
of the class name. E.g, if the implicit render args are
Map descs = new HashMap();
descs.put("_play", play.Play.class); // arg type with Class instance
descs.put("request", "play.mvc.Request"); // arg type with class name
The method is called when code builder
generating the java source out from the template source
void setRenderArgs(ITemplate template)
template instance
. Usually inside this
method, the implicit arguments to be set should be corresponding to the
render args described in getRenderArgDescriptions()
method. E.g.
template.__setRenderArg("_play", new play.Play());
template.__setRenderArg("request", play.mvc.Request.current());
This method is called before rythm engine
start
to execute a template instance
template
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |