mustache 的 Java 实现 JMustache

码农软件 · 软件分类 · 模板引擎 · 2019-08-22 19:43:09

软件介绍

jmustache 是 Mustache 模板引擎的java实现。

使用方法:

String text = "One, two, {{three}}. Three sir!";
Template tmpl = Mustache.compiler().compile(text);
Map<String, String> data = new HashMap<String, String>();
data.put("three", "five");
System.out.println(tmpl.execute(data));
// result: "One, two, five. Three sir!"

示例2:

class Person {
    public final String name;
    public Person (String name, int age) {
        this.name = name;
        _age = age;
    }
    public int getAge () {
        return _age;
    }
    protected int _age;
}

String tmpl = "{{#persons}}{{name}}: {{age}}{{/persons}}\n";
Mustache.compiler().compile(tmpl).execute(new Object() {
    Object persons = Arrays.asList(new Person("Elvis", 75), new Person("Madonna", 52));
});

// result:
// Elvis: 75
// Madonna: 52

本文地址:https://codercto.com/soft/d/12947.html

技术管理之巅

技术管理之巅

黄哲铿 / 电子工业出版社 / 2015-6 / 49.00元

《技术管理之巅——如何从零打造高质效互联网技术团队?》为您解密国内顶级互联网公司技术团队管理的精髓。作者结合自己十余年在国内知名互联网公司MySteel、1号店等担任PMO总监、技术总监的丰富经验,进行归纳和总结。书中围绕着技术管理中的热点“如何搭建扁平化、去中心化的技术团队”、“大数据下的技术管理创新”、“目标管理方法OKR”、“阿米巴生产模式”、“Scrum和Kanban的实践”逐渐展开,从技......一起来看看 《技术管理之巅》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具