square/otto — pull request #69 by JakeWharton (2013-03-06 00:36:01+00:00)
Title: Introduce code generation via annotation processing.

# DO NOT MERGE

This pretty fundamentally changes how the event bus behaves with regard to registration and unregistration.

There is now a concept of a `Finder` whose job is to locate the `@Subscribe` and `@Produce`-annotated methods on instances of `T`. The annotation processor generates finders for each type which perform the installation and uninstallation of subscribers and producers onto the bus.

A `Subscriber` is an interface which represents something that can accept an event of type `T`. A `Producer` is an interface which represents something that can produce a new event of type `T`. The annotation processor's code for the `Finder` calls generated `Subscriber` and `Producer` classes which call real methods on the finder's `T` type.

Since we cannot guarantee the precense of annotation-generated classes at runtime, a reflection implementation is provided as a fallback which behaves exactly as the v1.x Otto `Bus` does.