Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deeply locate the problem of Annotation Processor processor

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

In view of how to locate the problem of Annotation Processor processor in depth, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

What is the Annotation Processor build problem

At first glance, veteran drivers who have written custom annotation processors feel that this problem is quite simple, yes, because the whole article on the Internet is basically teaching you how to log, but have you ever thought about how to locate if you can't even print the log? For example, the following code:

/ / confirm that META-INF/services/javax.annotation.processing.Processor is fine / / confirm that the build script is fine, and confirm that the annotation Bridge is used and participated in the construction of @ AutoService (Processor.class) public class TestAnnotationProcessor extends AbstractProcessor {public TestAnnotationProcessor () {System.out.println ("TestAnnotationProcessor constrator");} @ Override public synchronized void init (ProcessingEnvironment processingEnvironment) {super.init (processingEnvironment) System.out.println ("TestAnnotationProcessor init");} @ Override public Set getSupportedAnnotationTypes () {System.out.println ("TestAnnotationProcessor getSupportedAnnotationTypes"); Set supported = new HashSet (); supported.add (Bridge.class.getCanonicalName ()); return supported;} @ Override public boolean process (Set)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report