Tom Wellbrock
Tom Wellbrock

Reputation: 3042

Implementation of NonNull Annotation

I thought I delve deeper into older Java Features such as Annotations. I encountered Java 8s Type Annotations which enable us to extend Javas type system. The most common annotation 'NonNull' or 'NotNull' by IntelliJ's Annotation Libary or the Checkerframework are still a mystery to me. In the Docs I can only find the declaration of the interface, but never how the Annotation processor is realised. I like to write my own custom Annotations, that checks for specific Types on compiletime, but I dont know how to start.

Does anybody know how 'NonNull' or 'NotNull' are generally realized within the Annotation processor?. Or point me to a resource or documentation that answeres my question?

Your help is much appreciated.

Upvotes: 1

Views: 597

Answers (1)

mernst
mernst

Reputation: 8137

You mentioned IntelliJ IDEA and the Checker Framework. The IDEA source code and the Checker Framework source code are available for you to read and learn from. The Checker Framework manual explains how to create a new checker and links to publications that explain more of the theory.

Upvotes: 2

Related Questions