
com.hubspot.jinjava.el.ext.OrOperator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jinjava Show documentation
Show all versions of jinjava Show documentation
Jinja templating engine implemented in Java
package com.hubspot.jinjava.el.ext;
import de.odysseus.el.tree.Bindings;
import de.odysseus.el.tree.impl.ast.AstBinary.Operator;
import de.odysseus.el.tree.impl.ast.AstNode;
import javax.el.ELContext;
public class OrOperator implements Operator {
@Override
public Object eval(Bindings bindings, ELContext context, AstNode left, AstNode right) {
Object leftResult = left.eval(bindings, context);
if (bindings.convert(leftResult, Boolean.class)) {
return leftResult;
}
return right.eval(bindings, context);
}
public static final OrOperator OP = new OrOperator();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy