1 package org.netbeans.modules.tasklist.javadoc; 2 3 import org.openide.src.ClassElement; 4 import org.openide.src.ElementFormat; 5 import org.openide.src.JavaDoc; 6 import org.openide.src.SourceException; 7 import org.netbeans.modules.tasklist.javadoc.ext.JavaTagNames; 8 9 public class AutoCommenterClass extends AutoCommenterElement { 10 private static final String [] NOT_PERMITTED_TAGS = { 11 JavaTagNames.TAG_EXCEPTION, 12 JavaTagNames.TAG_PARAM, 13 JavaTagNames.TAG_RETURN, 14 JavaTagNames.TAG_SERIAL, 15 JavaTagNames.TAG_SERIALDATA, 16 JavaTagNames.TAG_SERIALFIELD, 17 JavaTagNames.TAG_THROWS, 18 }; 19 20 private static final ElementFormat nameFormat = new ElementFormat( "{m} {C}" ); 22 public AutoCommenterClass( ClassElement element ) { 23 super( element ); 24 } 25 26 String [] getNotPermittedTags() { 27 return NOT_PERMITTED_TAGS; 28 } 29 30 boolean elementTagsOk() { 31 boolean error = false; 32 if (this.isMultipleTags(JavaTagNames.TAG_VERSION)) { 33 error = true; 34 } 35 return !error; 36 } 37 38 void autoCorrect() throws SourceException { 39 super.autoCorrect( getJavaDoc() ); 40 } 41 42 boolean isCorrectable() { 43 return super.isCorrectable(); 44 } 45 46 String typeToString() { 47 return ((ClassElement)srcElement).isInterface() ? "interface" : "class"; } 49 50 JavaDoc getJavaDoc() { 51 return ((ClassElement)srcElement).getJavaDoc(); 52 } 53 54 ElementFormat getNameFormat () { 55 return nameFormat; 56 } 57 } 58 | Popular Tags |