public class MessageCollector extends Object
While it might seem sufficient to use the ProcessingEnvironment.Messager for this, it is not... Eclipse tends to "forget" reported errors in some cases, especially, when annotated classes refer to generated classes and Eclipse has to compile them again after an annotation processor round. Thus, we collect all errors and report them in last annotation processing round. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=419769
| Constructor and Description |
|---|
MessageCollector() |
public void addMessage(Message m)
public void addMessage(Diagnostic.Kind kind, String msg, Element element, AnnotationMirror annotation, String annotationValueName)
public void printAllMessages()
public boolean supportsNestedAnnotations()
public boolean isEclipse()
public AnnotationMirror getNestedAnnotation(AnnotationMirror rootAnnotation, Path path)
public AnnotationValue getValue(AnnotationMirror am, String avName, Integer index)
public Set<Message> removeMessagesForAnnotatedClass(String annotatedClassFqn)
protected void _reportRuleError(CharSequence msg)
protected void _reportRuleError(Exception e)
protected void _reportRuleError(ELProviderException e, CharSequence metaAnnotationValueName)
protected void _reportRuleError(RuleException e, CharSequence metaAnnotationValueName)
protected void _reportRuleError(Exception e, CharSequence metaAnnotationValueName)
protected void _reportRuleError(CharSequence msg, CharSequence metaAnnotationValueName)
public void reportRuleError(Rule rule, CharSequence msg, CharSequence metaAnnotationValueName)
public void reportError(CharSequence msg, Exception ex, Element element, AnnotationMirror annotation, CharSequence annotationValueName)
public void reportError(CharSequence msg, Element element, AnnotationMirror annotation, CharSequence annotationValueName)
public void reportError(ProcessingException pe)
public void reportMessage(String msg, Element element, Diagnostic.Kind kind)
public void printDiagnosticMessage(org.eclipse.xtext.xbase.lib.Functions.Function1<? super Object,? extends CharSequence> cs)
public void printDiagnosticMessage(Element e, org.eclipse.xtext.xbase.lib.Functions.Function1<? super Object,? extends CharSequence> cs)
public void reportRuleError(Object e)
public void reportRuleError(Object e, CharSequence metaAnnotationValueName)
@Pure public boolean isDiagnosticLogging()
public void setDiagnosticLogging(boolean diagnosticLogging)
Copyright © 2018. All rights reserved.