1 36 37 package com.caucho.doc.javadoc; 38 39 import com.caucho.log.Log; 40 import com.caucho.util.CharBuffer; 41 import com.caucho.util.L10N; 42 43 import java.util.logging.Logger ; 44 45 48 public class JavadocItem { 49 static protected final Logger log = Log.open(JavadocItem.class); 50 static final L10N L = new L10N(JavadocItem.class); 51 52 public final static int PACKAGE=0x01; 53 public final static int CLASS=0x02; 54 public final static int METHOD=0x04; 55 public final static int VARIABLE=0x08; 56 public final static int ANY=PACKAGE | CLASS | METHOD | VARIABLE; 57 58 String _name; 59 String _fullName; 60 int _type; 61 JavadocFile _file; 62 String _anchor; 63 String _description; 64 65 boolean _exact = false; 66 67 public JavadocItem(String name, String fullName, int type, String anchor, String description, JavadocFile file) 68 { 69 _name = name; 70 _fullName = fullName; 71 _type = type; 72 _file = file; 73 _anchor = anchor; 74 _description = description; 75 } 76 77 public String getName() 78 { 79 return _name; 80 } 81 82 public String getFullName() 83 { 84 return _fullName; 85 } 86 87 public int getType() 88 { 89 return _type; 90 } 91 92 public String getTypeString() 93 { 94 switch (_type) { 95 case PACKAGE: 96 return "package"; 97 case CLASS: 98 return "class"; 99 case METHOD: 100 return "method"; 101 case VARIABLE: 102 return "var"; 103 } 104 return "unknown"; 105 } 106 107 public JavadocFile getFile() 108 { 109 return _file; 110 } 111 112 public String getAnchor() 113 { 114 return _anchor; 115 } 116 117 public String getDescription() 118 { 119 return _description; 120 } 121 122 void setExact(boolean exact) 123 { 124 _exact = exact; 125 } 126 127 132 public boolean getExact() 133 { 134 return _exact; 135 } 136 137 public String getHref() 138 { 139 CharBuffer cb = CharBuffer.allocate(); 140 cb.append(_file.getHref()); 141 if (_anchor != null) { 142 cb.append('#'); 143 cb.append(_anchor); 144 } 145 return cb.close(); 146 } 147 } 148 149 | Popular Tags |