1 19 20 package org.netbeans.modules.java.bridge; 21 22 import java.util.StringTokenizer ; 23 24 import org.openide.src.*; 25 26 30 class JavaDocImpl extends Object implements JavaDoc, java.io.Serializable { 31 32 33 JavaDoc javaDoc; 34 35 38 ElementImpl impl; 39 40 private static final long serialVersionUID = -4007873715598624939L; 41 42 45 47 48 JavaDocImpl( ElementImpl impl ) { 49 this.impl = impl; 50 } 51 52 57 JavaDocImpl(String rawText, ElementImpl impl) { 58 javaDoc = JavaDocSupport.createJavaDoc( rawText ); 59 this.impl = impl; 60 } 61 62 public void clearJavaDoc() throws SourceException { 63 javaDoc.clearJavaDoc(); 64 impl.setJavaDocText (null, true); 65 } 66 67 public boolean isEmpty() { 68 return javaDoc.isEmpty(); 69 } 70 71 74 public String getRawText () { 75 return javaDoc.getRawText(); 76 } 77 78 79 83 public void setRawText (String s) throws SourceException { 84 impl.setJavaDocText(s, true); 85 } 86 87 88 private void updateTags() { 89 } 91 92 95 public String getText () { 96 return javaDoc.getText(); 97 } 98 99 100 104 public void setText (String s) throws SourceException { 105 impl.setJavaDocText(s, false); 106 116 } 117 118 protected void changeJavaDocText(String s, boolean raw) throws SourceException { 119 if (raw) { 120 javaDoc.setRawText(s); 121 } else { 122 javaDoc.setText(s); 123 } 124 } 125 126 128 public JavaDocTag[] getTags() { 129 return javaDoc.getTags(); 130 } 131 132 134 public JavaDocTag[] getTags(String name) { 135 return javaDoc.getTags( name ); 136 } 137 138 143 public void changeTags(JavaDocTag[] tags, int action) throws SourceException { 144 impl.changeJavaDocTags(tags, action); 145 } 146 147 protected void changeJavaDocTags(JavaDocTag[] tags, int action) 148 throws SourceException { 149 javaDoc.changeTags(tags, action); 150 } 151 152 154 public JavaDocTag.See[] getSeeTags() { 155 return javaDoc.getSeeTags(); 156 } 157 158 164 165 168 static class Class extends JavaDocImpl implements JavaDoc.Class { 169 170 private static final long serialVersionUID = 5651952150233392489L; 171 172 public Class(String rawText, ElementImpl impl) { 173 super( impl ); 174 javaDoc = JavaDocSupport.createClassJavaDoc( rawText ); 175 } 176 } 177 178 181 static class Field extends JavaDocImpl implements JavaDoc.Field { 182 183 private static final long serialVersionUID = -7737074261842273983L; 184 185 public Field(String rawText, ElementImpl impl) { 186 super( impl ); 187 javaDoc = JavaDocSupport.createFieldJavaDoc( rawText ); 188 } 189 190 192 public JavaDocTag.SerialField[] getSerialFieldTags() { 193 return ((JavaDoc.Field)javaDoc).getSerialFieldTags(); 194 } 195 196 } 197 198 200 static class Method extends JavaDocImpl implements JavaDoc.Method { 201 202 private static final long serialVersionUID = 6902210486353445027L; 203 204 public Method(String rawText, CallableImpl impl) { 205 super( impl ); 206 javaDoc = JavaDocSupport.createMethodJavaDoc( rawText ); 207 } 208 209 211 public JavaDocTag.Param[] getParamTags() { 212 return ((JavaDoc.Method)javaDoc).getParamTags(); 213 } 214 215 217 public JavaDocTag.Throws[] getThrowsTags() { 218 return ((JavaDoc.Method)javaDoc).getThrowsTags(); 219 } 220 } 221 } 222 | Popular Tags |