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
想重写!方法,支持not和!同时使用。
参考一些案例写出来了OR、And方法,是可以用的。
最后可以在表达式里面直接写语法:
true and false; true or false; not true;
但是not函数却不行了
/** * 处理!和 not */ public class NotFunction extends AbstractFunction { @Override public String getName() { return "not"; } @Override @SuppressWarnings("all") public AviatorObject call(Map<String, Object> env, AviatorObject arg1) { Boolean left = FunctionUtils.getBooleanValue(arg1, env); return AviatorBoolean.valueOf(!left); } }
执行时加上:
AviatorEvaluator.getInstance().aliasOperator(OperatorType.NOT, "not"); AviatorEvaluator.addOpFunction(OperatorType.NOT, new NotFunction());
最后报了错误: Caused by: java.lang.IllegalArgumentException at com.googlecode.aviator.AviatorEvaluatorInstance.aliasOperator(AviatorEvaluatorInstance.java:235)
求解。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
想重写!方法,支持not和!同时使用。
参考一些案例写出来了OR、And方法,是可以用的。
最后可以在表达式里面直接写语法:
但是not函数却不行了
执行时加上:
最后报了错误:
Caused by: java.lang.IllegalArgumentException
at com.googlecode.aviator.AviatorEvaluatorInstance.aliasOperator(AviatorEvaluatorInstance.java:235)
求解。
The text was updated successfully, but these errors were encountered: