From 219ccf41db7a8e14021d6fff265587d33dcf34be Mon Sep 17 00:00:00 2001 From: Tobias Stamann Date: Wed, 12 Jul 2017 15:19:38 +0200 Subject: [PATCH] Add static accessor method for MessagerUtils. --- .../annotationprocessortoolkit/tools/MessagerUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/annotationprocessor/src/main/java/de/holisticon/annotationprocessortoolkit/tools/MessagerUtils.java b/annotationprocessor/src/main/java/de/holisticon/annotationprocessortoolkit/tools/MessagerUtils.java index 06d24316..dd9074ed 100644 --- a/annotationprocessor/src/main/java/de/holisticon/annotationprocessortoolkit/tools/MessagerUtils.java +++ b/annotationprocessor/src/main/java/de/holisticon/annotationprocessortoolkit/tools/MessagerUtils.java @@ -3,6 +3,7 @@ import de.holisticon.annotationprocessortoolkit.internal.FrameworkToolWrapper; import javax.annotation.processing.Messager; +import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.AnnotationValue; import javax.lang.model.element.Element; @@ -100,6 +101,10 @@ public static MessagerUtils getMessagerUtils(FrameworkToolWrapper frameworkToolW return new MessagerUtils(frameworkToolWrapper.getMessager()); } + public static MessagerUtils getMessagerUtils(ProcessingEnvironment processingEnvironment) { + return getMessagerUtils(new FrameworkToolWrapper(processingEnvironment)); + } + /** * Creates a message by using a custom templating mechanism. * Argument placeholder with the following format '${index}'