@Eliminate("Boilerplate")
summary
Claim: compile-time annotation processing generates builders so you never handwrite boilerplate; implementation: a working annotation processor extends AbstractProcessor, uses the filer and messager, emits Java source with JavaPoet, and is discovered via META-INF/services. Tests use Google’s compile-testing. Practical details: collects non‑private fields, creates private fields plus public setter methods, writes a build() that new‑s the target type, and keeps generated code out of the runtime by using the Gradle apt configuration; works and repeats consistently.
AI-written summary · about
chapters (29)
- 0:00Introduction
- 0:30Who wrote Java boilerplate
- 0:51Model class
- 1:28Builder class
- 2:09Overview
- 2:24Annotation Processing
- 3:13Benefits
- 6:00Annotations
- 7:00Retention Policy
- 7:56Target
- 8:15Type Element
- 8:43Abstract Processor
- 9:08Annotation Processor
- 12:41Process Method
- 13:30Round Environment
- 15:13Service Loader
- 18:45Code Generation
- 19:08Java Poet
- 21:30Naming
- 22:59Fields
- 23:53Methods
- 26:16Class
- 27:29AnnotationProcessor
- 28:22Element Metadata
- 30:52Field and Method Spec
- 32:10Build Method
- 33:12Build Type
- 34:12Recap
- 35:35Questions
related talks
24mAnnotation Processing in Android
36mFact or kapt? Build your next annotation processor with KSP
46mCodegen with KSP: A Farewell to Stubs
40mIntroduction to Bytecode Instrumentation with AGP 8
32mWriting Android Libraries
48mGradle: Incremental compilation 101
40mMake The Android Gradle Plugin Work For You
37mThe Build Shrugged
