Explaining annotation magic
summary
Shows how @Target and @Retention actually change where and when metadata lives (Source vs Class vs Runtime), builds a custom annotation processor (extends AbstractProcessor, supported annotations, ProcessingEnvironment) and demonstrates runtime reflection vs classpath scanning (Reflections library vs ClassIndex indexing), implements a simple test runner with an @Ignore boolean attribute, and compares code generation approaches such as Lombok annotations versus Java records for value objects.
AI-written summary · about
chapters (16)
- 0:00Introduction to annotations
- 1:43What are annotations
- 3:50Annotation basics
- 5:38Where annotations target
- 9:14Retention policy explained
- 13:09Built-in annotations
- 17:26Suppress warnings deep dive
- 20:38Testing with annotations
- 26:18Manual vs automated testing
- 28:03Reflections library overview
- 30:33Class index optimization
- 33:50Package-level annotations
- 35:12Lombok and code generation
- 38:03Records vs Lombok
- 39:27Annotation processing intro
- 44:30Q&A and closing
related talks
50mRevealing the magic behind Java annotations
46mJava annotation processing magic for muggles
42mRevealing the Magic Behind Java Annotations
30mYour own @Annotation processor
56mThe Wonders of Java Annotation Processing at Compile Time
52mAnnotation Processing
36mAnnotation Processing 101
45mMaking Java more dynamic
