~/talk

Java Annotation Processing

Talkat Java ON 2022 · 2022-10-17..10-20· [java, compilers-and-language-design]
links:none on file
slides:none on file

Creates a custom @Builder annotation and a processor that uses javax.annotation.processing.AbstractProcessor and Google auto-service to write .java files via the compiler Filer, keeping processing at compile-time generation instead of reflection. Demo project shows generated builder classes added during compilation, then measures runtime: reflection build ~39 ms vs generated builder ~3 ms (order-of-magnitude faster). Implementation uses a separate processor module, transforms javax Elements into plain descriptors, validates targets, and writes source files with PrintWriter; the approach works and improves performance.

AI-written summary · about

  1. 0:00Java annotation processing
  2. 6:02Java annotations importance
  3. 14:14Compile-time vs runtime
  4. 24:46Gradle setup for annotation processing
  5. 33:15Custom Builder annotation
  6. 42:46Generating classes from annotations
  7. 51:44Performance vs reflection
  8. 55:04Lombok and annotation processing
  9. 57:39Q&A with Oscar Camacho
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.