[英]Where does Eclipse print messages that it outputs within an annotation processor?
Eclipse Juno在哪里打印下面的注释处理器ComplexityProcessor
在编译类SimpleAnnotationTest
时输出的消息? 编译后,我希望在“控制台”窗格中看到这些消息,但它是空的。
public @interface Complexity
{
public enum Level
{
VERY_SIMPLE,
SIMPLE,
MEDIUM,
COMPLEX,
VERY_COMPLEX;
}
Level value() default Level.MEDIUM;
}
@SupportedAnnotationTypes("com.intelerad.annotations.Complexity")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class ComplexityProcessor extends AbstractProcessor
{
@Override
public boolean process( final Set<? extends TypeElement> annotations,
final RoundEnvironment environment )
{
for ( final Element element : environment.getElementsAnnotatedWith( Complexity.class ) )
{
final Complexity complexity = element.getAnnotation( Complexity.class );
String message =
"Annotation found in " + element.getSimpleName() + " with complexity " +
complexity.value();
// Where does Eclipse print this message?
processingEnv.getMessager().printMessage( Diagnostic.Kind.NOTE, message );
}
return true;
}
}
@Complexity(Level.VERY_SIMPLE)
public class SimpleAnnotationTest
{
@Complexity()
public void theMethod()
{
System.out.println( "console output" );
}
}
我在Eclipse .metadata/.log
找到了输出:
!ENTRY org.eclipse.jdt.apt.pluggable.core 1 1 2013-01-23 16:45:35.102
!MESSAGE Annotation found in SimpleAnnotationTest with complexity VERY_SIMPLE
!ENTRY org.eclipse.jdt.apt.pluggable.core 1 1 2013-01-23 16:45:35.102
!MESSAGE Annotation found in theMethod with complexity MEDIUM
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.