- 29 Jan, 2016 1 commit
-
-
serso authored
A javac option can be used for generating "reflective" event handlers: -Aotto-generate=reflective
-
- 28 Jan, 2016 1 commit
-
-
serso authored
As Otto library uses EventHandler's equals() and hashCode() methods, they should be implemented. For anonymous classes it's enough to check class names as each anonymous class will get a unique name. However, subscribers of the same type might be registered several times and additional "subscribers equal" check should be used. As Otto Compiler is a compile-time dependency GeneratedEventHandler must be written to the output during a round of annotation processing.
-
- 26 Jan, 2016 2 commits
-
-
serso authored
Initial commit containing draft implementation of annotation processor. The processor generates a class which implements HandlerFinder interface and returns event handlers in a constant time. Currently, this file has the following structure: public Map findAllSubscribers(final Object listener) { if (listener.getClass().equals(SomeClass1.class)) { final Map<Class<?>, Set<EventHandler>> handlers = new HashMap<Class<?>, Set<EventHandler>>(3); handlers.put(Event1.class, Collections.<EventHandler>singleton( new BaseEventHandler(){public void handleEvent(Object event){((SomeClass1)listener).onEvent1((Event1)event);}})); handlers.put(Event2.class, Collections.<EventHandler>singleton( new BaseEventHandler(){public void handleEvent(Object event){((SomeClass1)listener).onEvent2((Event2)event);}})); handlers.put(Event3.class, Collections.<EventHandler>singleton( new BaseEventHandler(){public void handleEvent(Object event){((SomeClass1)listener).onEvent3((Event3)event);}})); return handlers; } if (listener.getClass().equals(SomeClass2.class)) { final Map<Class<?>, Set<EventHandler>> handlers = new HashMap<Class<?>, Set<EventHandler>>(1); handlers.put(Event1.class, Collections.<EventHandler>singleton( new BaseEventHandler(){public void handleEvent(Object event){((SomeClass2)listener).onEvent1((Event1)event);}})); return handlers; } // etc throw new IllegalArgumentException(); }
-
serso authored
Bus class shouldn't depend on specific implementation of HandlerFinder/EventHandler. Thus: 1. EventHandler has been converted to an interface 2. Bus constructors now accept HandlerFinder parameter 3. EventHandler API has changed a bit (instead of InvocationTargetException a RuntimeException should be thrown)
-
- 20 Jan, 2016 1 commit
-
-
Jesse Wilson authored
-
- 16 Jan, 2016 2 commits
-
-
Jake Wharton authored
Deprecate Otto in favor of RxJava
-
Jesse Wilson authored
-
- 27 Oct, 2015 2 commits
-
-
Jake Wharton authored
Update links to Javadoc.
-
jwilson authored
-
- 17 Jun, 2015 3 commits
-
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
- 16 Jun, 2015 1 commit
-
-
Alex Shoykhet authored
-
- 08 May, 2015 3 commits
-
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
- 07 May, 2015 1 commit
-
-
Ben Sandee authored
-
- 20 Jan, 2015 4 commits
-
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
- 19 Jan, 2015 2 commits
-
-
Jesse Wilson authored
Do not allow the same instance to be registered twice.
-
Jake Wharton authored
-
- 20 Dec, 2014 3 commits
-
-
Jake Wharton authored
-
Jake Wharton authored
Auto-deploy snapshots from Travis CI to Sonatype.
-
Jake Wharton authored
-
- 19 Nov, 2014 2 commits
-
-
Jesse Wilson authored
Use new central artifact redirect link.
-
Jake Wharton authored
-
- 10 Jun, 2014 5 commits
-
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
Jake Wharton authored
-
- 09 Jun, 2014 3 commits
-
-
Jake Wharton authored
Fix proguard instructions to preserve annotations
-
Jake Wharton authored
-
Liam Miller-Cushon authored
-
- 12 May, 2014 2 commits
-
-
Logan Johnson authored
Link more detail to exceptions
-
Patrick Forhan authored
Fixes #116.
-
- 03 Mar, 2014 1 commit
-
-
Jake Wharton authored
Updated reference to sample application
-
- 02 Mar, 2014 1 commit
-
-
joeykrim authored
Updated sample reference to link to GitHub instead of the previously reference to the download, which only contains the .jar.
-