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();
}
});
Copyright © 2020. All rights reserved.