public abstract class StartupRegisterable
extends java.lang.Object
| Constructor and Description |
|---|
StartupRegisterable() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> void |
addAnnotatedBinding(java.lang.Class<? super T> interfaze,
java.lang.annotation.Annotation annotation,
T instance)
Add a binding to guice that's only injectable when a specific annotation is provided.
|
protected <T> void |
addAnnotatedBinding(java.lang.Class<? super T> interfaze,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
T instance)
Add a binding to guice that's only injectable when a specific annotation is provided.
|
protected <T> void |
addBinding(java.lang.Class<? super T> interfaze,
T instance)
Add a binding to guice with a specific class and instance.
|
protected void |
addBinding(java.lang.Object instance)
Add a binding to guice, reference class is deduced from the instance itself.
|
protected <T> void |
addBinding(com.google.inject.TypeLiteral<? super T> interfaze,
T instance)
Add a binding to guice with a specific class & generic, and instance.
|
protected abstract void |
execute()
Code to be ran on the registerable's execution.
|
java.util.List<AnnotatedBinding<?>> |
getAnnotatedBindings()
Get a list of annotated binding objects set by the registerable
|
java.util.Map<java.lang.Class<?>,java.lang.Object> |
getBindings()
Get a map of bindings to be made
|
java.util.Map<com.google.inject.TypeLiteral<?>,java.lang.Object> |
getGenericBindings() |
java.util.List<java.lang.Class<?>> |
getStaticInjections()
Get any static injections requested by the registerable
|
protected void |
requestStaticInjections(java.lang.Class<?>... classes)
Request classes to have their static injection honoured
|
void |
run(Injector injector)
Run the registerable
|
protected Injector injector
protected abstract void execute()
protected <T> void addBinding(java.lang.Class<? super T> interfaze,
T instance)
T - Object typeinterfaze - Class the object will be referenced byinstance - Object that will be binded to the classprotected void addBinding(java.lang.Object instance)
instance - Object of the instance to be bindedprotected <T> void addBinding(com.google.inject.TypeLiteral<? super T> interfaze,
T instance)
T - Type parameter belonging to interfazeinterfaze - Class the object will be referenced byinstance - Object that will be bindedprotected <T> void addAnnotatedBinding(java.lang.Class<? super T> interfaze,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
T instance)
T - Object typeinterfaze - Reference class to be binded toannotation - Class extending annotationinstance - Instance of the object to be binded.protected <T> void addAnnotatedBinding(java.lang.Class<? super T> interfaze,
java.lang.annotation.Annotation annotation,
T instance)
T - Object typeinterfaze - Reference class to be binded toannotation - Annotation instanceinstance - Instance of the object to be bindedprotected void requestStaticInjections(java.lang.Class<?>... classes)
classes - Varargs of classespublic void run(Injector injector)
injector - Injector instance that will be provided to the registerablepublic java.util.Map<java.lang.Class<?>,java.lang.Object> getBindings()
public java.util.Map<com.google.inject.TypeLiteral<?>,java.lang.Object> getGenericBindings()
public java.util.List<AnnotatedBinding<?>> getAnnotatedBindings()
public java.util.List<java.lang.Class<?>> getStaticInjections()