Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 5 package xdoclet; 6 7 import java.util.Stack ; 8 9 import xjavadoc.XClass; 10 import xjavadoc.XConstructor; 11 import xjavadoc.XField; 12 import xjavadoc.XMethod; 13 import xjavadoc.XPackage; 14 import xjavadoc.XTag; 15 16 21 public abstract class DocletSupport 22 { 23 28 protected static XTag currentMethodTag; 29 30 protected static XTag currentClassTag; 31 32 protected static XTag currentFieldTag; 33 34 44 private transient Stack currentClassStack = null; 45 46 53 private transient XMethod currentMethod = null; 54 55 62 private transient XConstructor currentConstructor = null; 63 64 71 private transient XField currentField = null; 72 73 80 private transient XPackage currentPackage = null; 81 82 public DocletSupport() 83 { 84 currentClassStack = new Stack (); 85 } 86 87 92 public static XTag getCurrentMethodTag() 93 { 94 return currentMethodTag; 95 } 96 97 102 public static XTag getCurrentClassTag() 103 { 104 return currentClassTag; 105 } 106 107 112 public static XTag getCurrentFieldTag() 113 { 114 return currentFieldTag; 115 } 116 117 122 public static XTag getCurrentTag() 123 { 124 if (currentMethodTag != null) 125 return currentMethodTag; 126 else 127 return currentClassTag; 128 } 129 130 137 public static boolean isDocletGenerated(XClass clazz) 138 { 139 return clazz.getDoc().hasTag("xdoclet-generated", false); 140 } 141 142 148 public static void setCurrentMethodTag(XTag currentTag) 149 { 150 DocletSupport.currentMethodTag = currentTag; 151 } 152 153 159 public static void setCurrentClassTag(XTag currentTag) 160 { 161 DocletSupport.currentClassTag = currentTag; 162 } 163 164 170 public static void setCurrentFieldTag(XTag currentTag) 171 { 172 DocletSupport.currentFieldTag = currentTag; 173 } 174 175 181 public XClass getCurrentClass() 182 { 183 return currentClassStack.empty() ? null : (XClass) currentClassStack.peek(); 184 } 185 186 192 public XPackage getCurrentPackage() 193 { 194 return currentPackage; 195 } 196 197 203 public XMethod getCurrentMethod() 204 { 205 return currentMethod; 206 } 207 208 214 public XConstructor getCurrentConstructor() 215 { 216 return currentConstructor; 217 } 218 219 225 public XField getCurrentField() 226 { 227 return currentField; 228 } 229 230 237 public void setCurrentPackage(XPackage pakkage) 238 { 239 currentPackage = pakkage; 240 241 currentClassStack.clear(); 243 } 244 245 251 public void setCurrentMethod(XMethod method) 252 { 253 currentMethod = method; 254 } 255 256 262 public void setCurrentConstructor(XConstructor constructor) 263 { 264 currentConstructor = constructor; 265 } 266 267 273 public void setCurrentField(XField field) 274 { 275 currentField = field; 276 } 277 278 285 public void setCurrentClass(XClass clazz) 286 { 287 currentClassStack.clear(); 288 currentClassStack.push(clazz); 289 } 290 291 300 public XClass pushCurrentClass(XClass clazz) 301 { 302 return (XClass) currentClassStack.push(clazz); 303 } 304 305 313 public XClass popCurrentClass() 314 { 315 return (XClass) currentClassStack.pop(); 316 } 317 } 318
| Popular Tags
|