1 12 13 package org.eclipse.jdt.internal.compiler.apt.dispatch; 14 15 import javax.annotation.processing.Messager; 16 import javax.lang.model.element.AnnotationMirror; 17 import javax.lang.model.element.AnnotationValue; 18 import javax.lang.model.element.Element; 19 import javax.tools.Diagnostic.Kind; 20 21 import org.eclipse.jdt.core.compiler.CategorizedProblem; 22 import org.eclipse.jdt.internal.compiler.batch.Main; 23 24 27 public class BatchMessagerImpl extends BaseMessagerImpl implements Messager { 28 29 private final Main _compiler; 30 private final BaseProcessingEnvImpl _processingEnv; 31 32 public BatchMessagerImpl(BaseProcessingEnvImpl processingEnv, Main compiler) { 33 _compiler = compiler; 34 _processingEnv = processingEnv; 35 } 36 37 40 @Override 41 public void printMessage(Kind kind, CharSequence msg) { 42 printMessage(kind, msg, null, null, null); 43 } 44 45 48 @Override 49 public void printMessage(Kind kind, CharSequence msg, Element e) { 50 printMessage(kind, msg, e, null, null); 51 } 52 53 56 @Override 57 public void printMessage(Kind kind, CharSequence msg, Element e, 58 AnnotationMirror a) { 59 printMessage(kind, msg, e, a, null); 60 61 } 62 63 66 @Override 67 public void printMessage(Kind kind, CharSequence msg, Element e, 68 AnnotationMirror a, AnnotationValue v) { 69 if (kind == Kind.ERROR) { 71 _processingEnv.setErrorRaised(true); 72 } 73 CategorizedProblem problem = createProblem(kind, msg, e); 74 if (problem != null) { 75 this._compiler.addExtraProblems(problem); 76 } 77 } 78 } 79 | Popular Tags |