|
21 | 21 | import net.sf.jsqlparser.expression.operators.arithmetic.Modulo; |
22 | 22 | import net.sf.jsqlparser.expression.operators.arithmetic.Multiplication; |
23 | 23 | import net.sf.jsqlparser.expression.operators.arithmetic.Subtraction; |
| 24 | +import net.sf.jsqlparser.expression.operators.conditional.AndExpression; |
| 25 | +import net.sf.jsqlparser.expression.operators.conditional.OrExpression; |
| 26 | +import net.sf.jsqlparser.expression.operators.conditional.XorExpression; |
24 | 27 | import net.sf.jsqlparser.parser.ASTNodeAccessImpl; |
25 | 28 |
|
26 | 29 | import java.lang.reflect.InvocationTargetException; |
@@ -189,6 +192,36 @@ public static Expression subtract(Expression... expressions) { |
189 | 192 | } |
190 | 193 | } |
191 | 194 |
|
| 195 | + public static Expression or(Expression... expressions) { |
| 196 | + try { |
| 197 | + return build(OrExpression.class, expressions); |
| 198 | + } catch (NoSuchMethodException | InvocationTargetException | InstantiationException |
| 199 | + | IllegalAccessException e) { |
| 200 | + // this should never happen, at least I don't see how |
| 201 | + throw new RuntimeException(e); |
| 202 | + } |
| 203 | + } |
| 204 | + |
| 205 | + public static Expression xor(Expression... expressions) { |
| 206 | + try { |
| 207 | + return build(XorExpression.class, expressions); |
| 208 | + } catch (NoSuchMethodException | InvocationTargetException | InstantiationException |
| 209 | + | IllegalAccessException e) { |
| 210 | + // this should never happen, at least I don't see how |
| 211 | + throw new RuntimeException(e); |
| 212 | + } |
| 213 | + } |
| 214 | + |
| 215 | + public static Expression and(Expression... expressions) { |
| 216 | + try { |
| 217 | + return build(AndExpression.class, expressions); |
| 218 | + } catch (NoSuchMethodException | InvocationTargetException | InstantiationException |
| 219 | + | IllegalAccessException e) { |
| 220 | + // this should never happen, at least I don't see how |
| 221 | + throw new RuntimeException(e); |
| 222 | + } |
| 223 | + } |
| 224 | + |
192 | 225 | public Expression getLeftExpression() { |
193 | 226 | return leftExpression; |
194 | 227 | } |
|
0 commit comments