public interface Function
例如实现一个将字符创转为大写的函数 str.upcase
str.upcase 接收一个字符串参数,并将其转为大写,如下调用
hello,this is ${str.upcase(user.name)}
group.registerFunction("str.upcase", new Function() {
public String call(Object[] paras, Context ctx) {
String str = (String) paras[0];
return str.toUpperCase();
}
});
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Function.ChangeInput
如果Function实现了此接口,则入参会在解析的时候修改
|
static interface |
Function.ForceSafe
如果Function还实现了此接口,则此函数参数将使用安全输出符号
|
static interface |
Function.LineAware
如果Function实现了此接口,则会添加额当前外行参
|
Copyright © 2022. All rights reserved.