|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjavax.annotation.processing.AbstractProcessor
org.seasar.aptina.unit.PrintingProcessor
@SupportedSourceVersion(value=RELEASE_6) @SupportedAnnotationTypes(value="*") public class PrintingProcessor
コンパイル対象の Element
階層をコンソールに出力する Processor
です.
AptinaTestCase
のサブクラスで,
AptinaTestCase.addProcessor(Processor...)
にこのクラスを加えることで, コンパイル対象の
Element
階層を確認することができます.
次のサンプルは, src/test/java
フォルダにある TestSource.java
をコンパイルし,
PrintingProcessor
で Element
階層をコンソールに出力するテストクラスです.
public class XxxProcessorTest extends AptinaTestCase { @Override protected void setUp() throws Exception { super.setUp(); // ソースパスを追加 addSourcePath("src/test/java"); } public void test() throws Exception { // PrintingProcessor を生成して追加 addProcessor(new PrintingProcessor()); // コンパイル対象を追加 addCompilationUnit(TestSource.class); // コンパイル実行 compile(); } }
フィールドの概要 | |
---|---|
protected int |
depth
階層の深さ |
protected PrintWriter |
out
出力先 |
protected static char[] |
SPACES
インデント用の空白 (100 文字) |
クラス javax.annotation.processing.AbstractProcessor から継承されたフィールド |
---|
processingEnv |
コンストラクタの概要 | |
---|---|
PrintingProcessor()
インスタンスを構築します. |
|
PrintingProcessor(PrintWriter out)
インスタンスを構築します. |
メソッドの概要 | |
---|---|
protected void |
indent(int depth)
インデントを出力します. |
protected void |
printEnterMessage(Element e)
Element が開始されたことを出力します. |
protected void |
printLeaveMessage(Element e)
Element が終了したことを出力します. |
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
|
クラス javax.annotation.processing.AbstractProcessor から継承されたメソッド |
---|
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, init, isInitialized |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
protected static final char[] SPACES
protected PrintWriter out
protected int depth
コンストラクタの詳細 |
---|
public PrintingProcessor()
public PrintingProcessor(PrintWriter out)
out
- 出力先メソッドの詳細 |
---|
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
Processor
内の process
AbstractProcessor
内の process
protected void printEnterMessage(Element e)
Element
が開始されたことを出力します.
e
- Element
protected void printLeaveMessage(Element e)
Element
が終了したことを出力します.
e
- Element
protected void indent(int depth)
depth
- インデントの深さ
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |