国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

刪除java的注釋信息

瀏覽:90日期:2024-06-11 17:57:05
內容: import java.util.regex.*;import java.io.*;import util9.*;//某些java文件注釋信息過多從而影響了可讀性。利用此類可解決這個問題。//使用方法略。public class DelNoteInJavaFile { static BufferedReader br; static BufferedWriter bw; static String suffix='.noNote.java'; public DelNoteInJavaFile() { String message='input file name:'; String ret=Read9.stringFromControl(message); if(inJava(new File(ret)))System.out.println('successed'); else System.out.println('failed'); } public DelNoteInJavaFile(String f) { if(inJava(new File(f)))System.out.println('successed'); else System.out.println('failed'); } public DelNoteInJavaFile(File f) { if(inJava(f)) System.out.println('successed'); else System.out.println('failed'); } public static boolean check(File f) { if (!f.exists()) { System.err.println('wrong1.file not exists'); return false; } if (!f.isFile()) { System.err.println('wrong2.abstract file is not a file'); return false; } return true; } public static boolean inJava(File f) { if(check(f)==false ) return false ; File ff = new File(f.getName() + suffix); if (ff.exists()) { System.out.println('wrong3'); return false; } String s, ss; try { ff.createNewFile(); br = new BufferedReader(new FileReader(f)); bw = new BufferedWriter(new FileWriter(ff)); //the slash is char '/',the star is char '*'. Pattern slash_star_start = Pattern.compile('/*.*');//just like:/*.... Pattern star_slash = Pattern.compile('^.**/'); Pattern slash_star_both = Pattern.compile('/*.**/'); Pattern slash2 = Pattern.compile('s{0,}//'); // Pattern star = Pattern.compile('s{0,}*'); Matcher mat; int i = 0; boolean note = false; while ( (s = br.readLine()) != null) { //deal with such string:... /*...*/.... if(s.trim().length()==0) continue; s = s.replaceAll(slash_star_both.pattern(), ''); //deal with:....//.... mat = slash2.matcher(s); if (mat.find()&¬e==false) { System.out.println('s1='+s); s = s.substring(0, mat.start()); if (s.trim().length() == 0)continue; bw.write(s); bw.newLine(); continue; } //deal with:...*/... mat = star_slash.matcher(s); if (mat.find()) { note = false; System.out.println('s2='+s); s = s.substring(mat.end()); if (s.trim().length() == 0) { continue; } } if (note == true) { continue; } //deal with:..../*.... mat = slash_star_start.matcher(s); if (mat.find()) { note = true; System.out.println('s=' + s); s = s.substring(0, mat.start()); System.out.println('s1=' + s + ',mat.start()=' + mat.start()); if (s.trim().length() == 0) { continue; } } bw.write(s); bw.newLine(); } br.close(); bw.close(); /* if (f.renameTo(new File(ff.getName() + '.bak'))) { System.out.println('backup file is:' + ff.getName() + '.bak'); if( ff.renameTo(f)) System.out.println('output file is:'+f.getName()); else {System.out.println('wrong53');return false;} } else { System.out.println('wrong55'); return false; } */ } catch (IOException e) { e.getMessage(); return false; } return true; } public static boolean inJava(String s) { return inJava(new File(s)); } public static void main(String a[]) {if(a.length==0)new DelNote9(); else new DelNoteInJavaFile(a[0]); }} Java, java, J2SE, j2se, J2EE, j2ee, J2ME, j2me, ejb, ejb3, JBOSS, jboss, spring, hibernate, jdo, struts, webwork, ajax, AJAX, mysql, MySQL, Oracle, Weblogic, Websphere, scjp, scjd
標簽: Java
相關文章:
主站蜘蛛池模板: 香蕉国产人午夜视频在线观看 | 成年视频国产免费观看 | 欧美一级毛片俄罗斯 | 91精品国产91久久久久久 | 日产一一到六区网站免费 | 91最新地址永久入口 | 欧美精品99久久久久久人 | www中文字幕 | 亚洲欧美一区二区三区综合 | 国产一区在线观看免费 | 成人二区| 欧美成人性色生活片免费在线观看 | 自拍三级视频 | 国产一区二区三区亚洲综合 | 久久久精品国产免费观看同学 | 国产精品久久久久久久久免费hd | 男女视频免费看 | 97久久精品| 日韩欧美亚洲国产 | 欧美精品一区二区精品久久 | 91久热| 另类视频综合 | 99精品这里只有精品高清视频 | 国产精品久久久久毛片真精品 | 欧美日韩一区二区三在线 | 日韩永久在线观看免费视频 | 精品在线免费观看 | 日韩精品一区二区三区视频 | 久草中文在线视频 | 夜色成人免费观看 | 免费一级毛片正在播放 | 国产精品所毛片视频 | 免费看香港一级毛片 | 国产男女 爽爽爽爽视频 | 亚洲日本va午夜中文字幕一区 | 久久99亚洲精品久久99 | 欧美亚洲欧美区 | 中文成人在线 | xxxxfreexxxx人妖 | 亚洲成在线 | 深夜爽爽爽gif福利免费 |