@ SuppressWarnings ( "unchecked" ) public String renderString ( String key , String template , Object ... args ) { boolean typeInferenceEnabled = conf ( ) . typeInferenceEnabled ( ) ; if ( typeInferenceEnabled ) { ParamTypeInferencer . registerParams ( this , args ) ; } if ( typeInferenceEnabled ) { key += ParamTypeInferencer . uuid ( ) ; } try { TemplateClass tc = classes ( ) . getByTemplate ( key , false ) ; if ( null == tc ) { tc = new TemplateClass ( new StringTemplateResource ( key , template ) , this ) ; //classes().add(key, tc); } ITemplate t = tc . asTemplate ( this ) ; setRenderArgs ( t , args ) ; return t . render ( ) ; } finally { renderCleanUp ( ) ; } }
Render result from a direct template content . The template key has been provided as well