Package | Description |
---|---|
org.nutz.lang.tmpl |
Modifier and Type | Method and Description |
---|---|
static Tmpl |
Tmpl.parse(String tmpl)
解析模板对象
|
static Tmpl |
Tmpl.parse(String tmpl,
Pattern ptn,
int groupIndex,
int escapeIndex,
TmplEscapeStr getEscapeStr)
解析模板对象,并用上下文进行渲染。
你可以通过参数 ptn 指定自定义的正则表达式来声明自己的模板占位符形式。
默认的模板占位符是 (?<![$])[$][{]([^}]+)[}]
即,形式如 ${xxxx} 的会被当做占位符, 同时 $$ 可以逃逸 |
static Tmpl |
Tmpl.parse(String tmpl,
String startChar)
自定义占位符的开始字符,左右括号各为 "{" 和 "}"
|
static Tmpl |
Tmpl.parse(String tmpl,
String startChar,
String leftBrace,
String rightBrace)
解析模板对象, 并用上下文进行渲染。
|
static Tmpl |
Tmpl.parsef(String fmt,
Object... args) |
Copyright © 2017. All rights reserved.