KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectstyle > cayenne > exp > parser > ConditionNode


1 package org.objectstyle.cayenne.exp.parser;
2
3 import org.objectstyle.cayenne.exp.ExpressionException;
4
5 /**
6  * Superclass of conditional expressions.
7  *
8  * @since 1.1
9  * @author Andrei Adamchik
10  */

11 public abstract class ConditionNode extends SimpleNode {
12
13     public ConditionNode(int i) {
14         super(i);
15     }
16
17     public void jjtSetParent(Node n) {
18         // this is a check that we can't handle properly
19
// in the grammar... do it here...
20

21         // disallow non-aggregated condition parents...
22
if (!(n instanceof AggregateConditionNode)) {
23             String JavaDoc label = (n instanceof SimpleNode) ? ((SimpleNode)n).expName() : String.valueOf(n);
24             throw new ExpressionException(expName() + ": invalid parent - " + label);
25         }
26
27         super.jjtSetParent(n);
28     }
29 }
30
Popular Tags