1 2 12 package com.versant.core.ejb.query; 13 14 import com.versant.core.metadata.FieldMetaData; 15 import com.versant.core.metadata.ClassMetaData; 16 17 20 public class NavField extends NavBase { 21 22 private FieldMetaData fmd; private boolean outer; private boolean fetch; 26 private NavBase parent; private NavField next; 29 32 public NavField(FieldMetaData fmd, NavBase parent, boolean outer, 33 boolean fetch) { 34 this.fmd = fmd; 35 this.outer = outer; 36 this.fetch = fetch; 37 setParent(parent); 38 } 39 40 43 public void setParent(NavBase np) { 44 if (parent == np) { 45 return; 46 } 47 if (parent != null) { 48 NavField p = null; 49 for (NavField i = parent.children; i != this; i = i.next); 50 if (p == null) { 51 parent.children = next; 52 } else { 53 p.next = next; 54 } 55 next = null; 56 } 57 parent = np; 58 if (parent != null) { 59 if (parent.children == null) { 60 parent.children = this; 61 } else { 62 NavField i; 63 for (i = parent.children; i.next != null; i = i.next); 64 i.next = this; 65 } 66 } 67 } 68 69 72 public FieldMetaData getFmd() { 73 return fmd; 74 } 75 76 public NavRoot getRoot() { 77 return parent == null ? null : parent.getRoot(); 78 } 79 80 public NavBase getParent() { 81 return parent; 82 } 83 84 public NavField getNext() { 85 return next; 86 } 87 88 public boolean isOuter() { 89 return outer; 90 } 91 92 public boolean isFetch() { 93 return fetch; 94 } 95 96 public ClassMetaData getNavClassMetaData() { 97 return fmd.getRefOrValueClassMetaData(); 98 } 99 100 public String toString() { 101 StringBuffer s = new StringBuffer (); 102 s.append(fmd.name); 103 childrenToString(s); 104 return s.toString(); 105 } 106 107 } 108 109 | Popular Tags |