Annotation
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
[[FrontPage]]
-SGen
~ XDocletのようなコードジェネレータ。Javadocの属性とJSR-1...
~http://www.beust.com/sgen/
-P.Anno
~JSR-175のアノテーションをパースするパーサ。現在のところ...
SabelCCがベース。JDK1.4でも動作。
~http://www.amberarcher.org/projects/panno/
サンプルは次のような感じ。
アノテーションを記述したファイル(anno.txt)
@Normal1(name="Foo", location="Bar", weight=200.1)
@Normal2(marker1 = @Marker1, marker2 = @Marker2()...
@Normal3(nested = @Nested(nestedInner = @Nested2(...
コード
Reader r = new FileReader(new File("anno.txt"));
AnnotationParser parser = new AnnotationParser();
Collection annos = parser.parse(r);
Iterator annoIter = annos.iterator();
Annotation anno = (Annotation)annoIter.next();
System.out.println("Name: " + anno.getName());
System.out.println("\tname="+anno.getValue("name"...
実行結果
Name: Normal1
name=Foo
終了行:
[[FrontPage]]
-SGen
~ XDocletのようなコードジェネレータ。Javadocの属性とJSR-1...
~http://www.beust.com/sgen/
-P.Anno
~JSR-175のアノテーションをパースするパーサ。現在のところ...
SabelCCがベース。JDK1.4でも動作。
~http://www.amberarcher.org/projects/panno/
サンプルは次のような感じ。
アノテーションを記述したファイル(anno.txt)
@Normal1(name="Foo", location="Bar", weight=200.1)
@Normal2(marker1 = @Marker1, marker2 = @Marker2()...
@Normal3(nested = @Nested(nestedInner = @Nested2(...
コード
Reader r = new FileReader(new File("anno.txt"));
AnnotationParser parser = new AnnotationParser();
Collection annos = parser.parse(r);
Iterator annoIter = annos.iterator();
Annotation anno = (Annotation)annoIter.next();
System.out.println("Name: " + anno.getName());
System.out.println("\tname="+anno.getValue("name"...
実行結果
Name: Normal1
name=Foo
ページ名: