We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,可以实现 继承了OperatorBase的Function加别名吗?比如 expressRunner().addFunction(name, alias, OperatorBase);
The text was updated successfully, but these errors were encountered:
试试看宏?
Sorry, something went wrong.
版本:3.3.2 可以使用addOperatorWithAlias给函数起别名,但是函数的实现类需要存在三个字符串入参的构造函数
public ConcatFunction(String aliasName, String name, String errorInfo) { this.name = name; this.aliasName = aliasName; this.errorInfo = errorInfo; }
@Test public void zsTest() throws Exception { ExpressRunner runner = new ExpressRunner(true, false); DefaultContext<String, Object> context = new DefaultContext<String, Object>(); runner.addFunction("concatFunc", new ConcatFunction()); runner.addOperatorWithAlias("拼接函数","concatFunc",""); // 定义表达式 String express = "拼接函数(\"A\",\"B\")"; System.out.println("表达式结果:" + runner.execute(express, context, null, true, true)); }
No branches or pull requests
您好,可以实现 继承了OperatorBase的Function加别名吗?比如 expressRunner().addFunction(name, alias, OperatorBase);
The text was updated successfully, but these errors were encountered: