roboguice.event
Class ObservesTypeListener
java.lang.Object
roboguice.event.ObservesTypeListener
- All Implemented Interfaces:
- com.google.inject.spi.TypeListener
public class ObservesTypeListener
- extends Object
- implements com.google.inject.spi.TypeListener
Guice driven type listener which scans for the @Observes annotations.
Registers these methods with the EventManager.
- Author:
- Adam Tybor, John Ericksen
Method Summary |
protected void |
checkMethodParameters(Method method)
Error checking method, verifies that the method has the correct number of parameters. |
protected
|
findContextObserver(Method method,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
|
|
hear(com.google.inject.TypeLiteral<I> iTypeLiteral,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
|
protected
|
registerContextObserver(com.google.inject.spi.TypeEncounter<I> iTypeEncounter,
Method method,
Class parameterType)
Error checks the observed method and registers method with typeEncounter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eventManager
protected EventManager eventManager
contextProvider
protected com.google.inject.Provider<android.content.Context> contextProvider
ObservesTypeListener
public ObservesTypeListener(com.google.inject.Provider<android.content.Context> contextProvider,
EventManager eventManager)
hear
public <I> void hear(com.google.inject.TypeLiteral<I> iTypeLiteral,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
- Specified by:
hear
in interface com.google.inject.spi.TypeListener
findContextObserver
protected <I> void findContextObserver(Method method,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
registerContextObserver
protected <I> void registerContextObserver(com.google.inject.spi.TypeEncounter<I> iTypeEncounter,
Method method,
Class parameterType)
- Error checks the observed method and registers method with typeEncounter
- Type Parameters:
I
- - Parameters:
iTypeEncounter
- method
- parameterType
-
checkMethodParameters
protected void checkMethodParameters(Method method)
- Error checking method, verifies that the method has the correct number of parameters.
- Parameters:
method
-
Copyright © 2011. All Rights Reserved.