1 2 12 package com.versant.core.jdo.query; 13 14 import com.versant.core.metadata.ClassMetaData; 15 16 import com.versant.core.common.BindingSupportImpl; 17 18 22 public class ReservedFieldNode extends FieldNavNode { 23 24 private int type; 25 private ClassMetaData target; 26 27 public static final int TYPE_THIS = 1; 28 29 public ReservedFieldNode(int type, String lexeme) { 30 this.type = type; 31 this.lexeme = lexeme; 32 } 33 34 public Field visit(MemVisitor visitor, Object obj) { 35 return visitor.visitReservedFieldNode(this, obj); 36 } 37 38 public void normalizeImp() { 39 if (childList != null) childList.normalizeImp(); 40 } 41 42 public void resolve(QueryParser comp, ClassMetaData cmd, boolean ordering) { 43 if (type == TYPE_THIS) { 44 if (childList != null) { 45 parent.replaceChild(this, childList); 46 if (childList instanceof FieldNode) { 47 FieldNode fn = ((FieldNode)childList); 48 fn.resolved = true; 49 fn.useCandidateExtent = true; 50 } else if (childList instanceof FieldNavNode) { 51 ((FieldNavNode)childList).resolved = true; 52 } 53 childList.resolve(comp, cmd, false); 54 } else { target = cmd; 56 } 57 } else { 58 throw BindingSupportImpl.getInstance().unsupported("ReservedFieldNode of type " + 59 type + " is not supported"); 60 } 61 } 62 63 public ClassMetaData getTarget() { 64 return target; 65 } 66 67 public Object arrive(NodeVisitor v, Object msg) { 68 return v.arriveReservedFieldNode(this, msg); 69 } 70 } 71 72 | Popular Tags |