~/talk

Annotation Processing 101

Talkat droidcon Berlin 2015 · 2015-06-15..06-17· [compilers-and-language-design]
speakerdeck:sockeqwe
slides:none on file

Explains how an annotation processor is written to generate a type-based Factory (rules: only classes, empty constructor, unique ID, must inherit the specified type), using JavaPoet to emit a create(id) method and writing processors via AbstractProcessor and the services file. Demonstrates compile-time benefits versus reflection: Logan Square cuts JSON parsing from ~60–70ms to 17ms, Dagger2 saves ~13% CPU, EventBus registrations rise to ~7,000/sec. Notes limitation: can only create new files and is no runtime reflection, so generated code is debuggable.

AI-written summary · about

  1. 0:00Annotation processing intro
  2. 3:38Why it matters
  3. 9:21Limitations and debugging
  4. 17:01First annotation processor
  5. 21:20Handling errors and edge cases
  6. 29:13Code generation with JavaPoet
  7. 31:43Common pitfalls and fixes
  8. 35:18Performance trade-offs
~/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.