1 package org.apache.ojb.jdo.jdoql; 2 3 17 18 import org.apache.ojb.broker.metadata.*; 19 20 26 public class FieldAccess extends NameExpression 27 { 28 29 private AttributeDescriptorBase _descriptor; 30 31 37 public FieldAccess(Expression base, String name) 38 { 39 super(base, name); 40 } 41 42 45 public void accept(Visitor visitor) 46 { 47 visitor.visit(this); 48 } 49 50 56 public void setFieldDescriptor(AttributeDescriptorBase descriptor) 57 { 58 _descriptor = descriptor; 59 } 60 61 66 public AttributeDescriptorBase getFieldDescriptor() 67 { 68 return _descriptor; 69 } 70 71 74 public Class getType() 75 { 76 if (_descriptor instanceof FieldDescriptor) 77 { 78 return ((FieldDescriptor)_descriptor).getPersistentField().getType(); 79 } 80 else 81 { 82 return ((ObjectReferenceDescriptor)_descriptor).getItemClass(); 84 } 85 } 86 } 87 | Popular Tags |