01: package org.obe.sql;
02:
03: import java.io.IOException;
04: import java.io.Writer;
05:
06: /**
07: * @author Adrian Price
08: */
09: public class SQLIsClause extends SQLInvertibleClause {
10: public SQLIsClause(int id) {
11: super (id);
12: }
13:
14: public void write(Writer out) throws IOException {
15: children[0].write(out);
16: out.write(invert ? " IS NOT NULL" : " IS NULL");
17: }
18:
19: public Object execute(Object context) {
20: boolean isNull = children[0].execute(context) == null;
21: return isNull ^ invert ? Boolean.TRUE : Boolean.FALSE;
22: }
23: }
|