Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1027770 // velocityEval - directly evaluate template with Apache Velocity

JavaX fragment (include) [tags: use-pretranspiled]

Uses 1443K of libraries. Click here for Pure Java version (2511L/16K).

1  
!include once #1027769 // Velocity
2  
3  
sS velocityEval(S templateText, O... params) {
4  
  Velocity.init();
5  
  VelocityContext context = new(paramsToMap(params));
6  
  new StringWriter sw;
7  
  assertTrue("Velocity evaluate", Velocity.evaluate(context, sw, shorten(templateText, 50), templateText));
8  
  ret str(sw);
9  
}

Author comment

Began life as a copy of #1027768

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027770
Snippet name: velocityEval - directly evaluate template with Apache Velocity
Eternal ID of this version: #1027770/2
Text MD5: 4d9e9e9f5fec3aae506041163a5066f6
Transpilation MD5: aff690e9d966a43af9bed6b47c070ffb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-10 14:13:23
Source code size: 311 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 330
Version history: 1 change(s)
Referenced in: [show references]