abstract class AbstractMethodTypeListener
extends java.lang.Object
implements com.google.inject.spi.TypeListener
TypeListener
to hear annotated methods with lifecycle annotations.Modifier and Type | Field and Description |
---|---|
protected java.util.List<? extends java.lang.Class<? extends java.lang.annotation.Annotation>> |
annotationTypes
The lifecycle annotations to search on methods in the order to be searched.
|
private static java.lang.String |
JAVA_PACKAGE
The
java package constants. |
Constructor and Description |
---|
AbstractMethodTypeListener(java.util.List<? extends java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes)
Creates a new methods listener instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract <I> void |
hear(java.lang.reflect.Method method,
com.google.inject.TypeLiteral<I> parentType,
com.google.inject.spi.TypeEncounter<I> encounter,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Allows implementations to define the behavior when lifecycle annotation is found on the method.
|
private <I> void |
hear(com.google.inject.TypeLiteral<I> parentType,
java.lang.Class<? super I> klass,
com.google.inject.spi.TypeEncounter<I> encounter)
Allows traverse the input klass hierarchy.
|
<I> void |
hear(com.google.inject.TypeLiteral<I> type,
com.google.inject.spi.TypeEncounter<I> encounter) |
private static final java.lang.String JAVA_PACKAGE
java
package constants.protected final java.util.List<? extends java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes
public AbstractMethodTypeListener(java.util.List<? extends java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes)
annotationTypes
- the lifecycle annotations to search on methods in the order to be searched.public final <I> void hear(com.google.inject.TypeLiteral<I> type, com.google.inject.spi.TypeEncounter<I> encounter)
hear
in interface com.google.inject.spi.TypeListener
private <I> void hear(com.google.inject.TypeLiteral<I> parentType, java.lang.Class<? super I> klass, com.google.inject.spi.TypeEncounter<I> encounter)
parentType
- the owning type being heardklass
- encountered by Guice.encounter
- the injection context.protected abstract <I> void hear(java.lang.reflect.Method method, com.google.inject.TypeLiteral<I> parentType, com.google.inject.spi.TypeEncounter<I> encounter, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
method
- encountered by this type handler.parentType
- the owning type being heardencounter
- the injection context.annotationType
- the annotation type that was specified.