2006-09-01から1ヶ月間の記事一覧
ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setKind(ASTParser.K_COMPILATION_UNIT); parser.setSource(new char[0]); CompilationUnit unit = (CompilationUnit) parser.createAST(null); // 変更点を保存する設定 unit.recordModification…
Eclipse JDTを使う第1段階 <eclipse-userlibraries version="2"> <library name="Eclipse JDT" systemlibrary="false"> <archive path="D:/Software/Eclipse3.2/plugins/org.eclipse.jdt.core_3.2.0.v_671.jar"/> </archive></library></eclipse-userlibraries>
まだ検証中 /** * = a / b * @param a dividend * @param b divider * @throws ArithmeticException */ @Override public int divide(int a, @NotZero int b) throws ArithmeticException { return a / b; }as Method m = AstBuilder .javadoc("= a / b") .t…
もっと単純な実装望む… private static Annotation annotation(String str) { Map<String, String> options = new HashMap<String, String>(); options.put(JavaCore.COMPILER_SOURCE, "1.5"); ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setCompilerOptions(options); parse</string,></string,>…