|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.inject.AbstractModule org.apache.camel.guice.support.GuiceyFruitModule
public abstract class GuiceyFruitModule
Adds some new helper methods to the base Guice module
Constructor Summary | |
---|---|
GuiceyFruitModule()
|
Method Summary | ||
---|---|---|
protected
|
bind(Class<T> type,
Annotation annotation)
A helper method to bind the given type with the binding annotation. |
|
protected
|
bind(Class<T> type,
Class<? extends Annotation> annotationType)
A helper method to bind the given type with the binding annotation. |
|
protected
|
bind(Class<T> type,
String namedText)
A helper method to bind the given type with the Named annotation of the given text value. |
|
protected
|
bindAnnotationInjector(Class<A> annotationType,
AnnotationMemberProvider annotationMemberProvider)
Binds a custom injection point for a given injection annotation to the annotation member provider so that occurrences of the annotation on fields and methods with a single parameter will be injected by Guice after the constructor and @Inject have been processed. |
|
protected
|
bindAnnotationInjector(Class<A> annotationType,
Class<? extends AnnotationMemberProvider> annotationMemberProviderType)
Binds a custom injection point for a given injection annotation to the annotation member provider so that occurrences of the annotation on fields and methods with a single parameter will be injected by Guice after the constructor and @Inject have been processed. |
|
protected
|
bindAnnotationInjector(Class<A> annotationType,
com.google.inject.Key<? extends AnnotationMemberProvider> annotationMemberProviderKey)
Binds a custom injection point for a given injection annotation to the annotation member provider so that occurrences of the annotation on fields and methods with a single parameter will be injected by Guice after the constructor and @Inject have been processed. |
|
protected
|
bindInstance(String name,
T instance)
A helper method which binds a named instance to a key defined by the given name and the instances type. |
|
protected
|
bindMethodHandler(Class<A> annotationType,
Class<? extends MethodHandler> methodHandlerType)
Binds a post injection hook method annotated with the given annotation to the given method handler. |
|
protected
|
bindMethodHandler(Class<A> annotationType,
com.google.inject.Key<? extends MethodHandler> methodHandlerKey)
Binds a post injection hook method annotated with the given annotation to the given method handler. |
|
protected
|
bindMethodHandler(Class<A> annotationType,
MethodHandler methodHandler)
Binds a post injection hook method annotated with the given annotation to the given method handler. |
|
protected
|
checkInjectedValueType(Object value,
Class<?> type,
com.google.inject.spi.TypeEncounter<I> encounter)
Returns true if the value to be injected is of the correct type otherwise an error is raised on the encounter and false is returned |
|
protected void |
configure()
|
|
protected Class<?> |
getParameterType(com.google.inject.TypeLiteral<?> type,
Method method,
int i)
|
Methods inherited from class com.google.inject.AbstractModule |
---|
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuiceyFruitModule()
Method Detail |
---|
protected void configure()
configure
in class com.google.inject.AbstractModule
protected <A extends Annotation> void bindMethodHandler(Class<A> annotationType, MethodHandler methodHandler)
protected <A extends Annotation> void bindMethodHandler(Class<A> annotationType, com.google.inject.Key<? extends MethodHandler> methodHandlerKey)
protected <A extends Annotation> void bindMethodHandler(Class<A> annotationType, Class<? extends MethodHandler> methodHandlerType)
protected <A extends Annotation> void bindAnnotationInjector(Class<A> annotationType, com.google.inject.Key<? extends AnnotationMemberProvider> annotationMemberProviderKey)
A
- the annotation type used as the injection pointannotationType
- the annotation class used to define the injection pointannotationMemberProviderKey
- the key of the annotation member provider which can be
instantiated and injected by guiceprotected <A extends Annotation> void bindAnnotationInjector(Class<A> annotationType, AnnotationMemberProvider annotationMemberProvider)
A
- the annotation type used as the injection pointannotationType
- the annotation class used to define the injection pointannotationMemberProvider
- the annotation member provider which can be instantiated and
injected by guiceprotected <A extends Annotation> void bindAnnotationInjector(Class<A> annotationType, Class<? extends AnnotationMemberProvider> annotationMemberProviderType)
A
- the annotation type used as the injection pointannotationType
- the annotation class used to define the injection pointannotationMemberProviderType
- the type of the annotation member provider which can be
instantiated and injected by guiceprotected Class<?> getParameterType(com.google.inject.TypeLiteral<?> type, Method method, int i)
protected <I> void checkInjectedValueType(Object value, Class<?> type, com.google.inject.spi.TypeEncounter<I> encounter)
protected <T> com.google.inject.binder.LinkedBindingBuilder<T> bind(Class<T> type, Class<? extends Annotation> annotationType)
bind(Key.get(MyType.class, SomeAnnotation.class))
with this bind(KMyType.class, SomeAnnotation.class)
protected <T> com.google.inject.binder.LinkedBindingBuilder<T> bind(Class<T> type, Annotation annotation)
bind(Key.get(MyType.class, someAnnotation))
with this bind(KMyType.class, someAnnotation)
protected <T> com.google.inject.binder.LinkedBindingBuilder<T> bind(Class<T> type, String namedText)
Named
annotation of the given text value.
This allows you to replace this code
bind(Key.get(MyType.class, Names.named("myName")))
with this bind(KMyType.class, "myName")
protected <T> void bindInstance(String name, T instance)
bind(instance.getClass(), name).toInstance(instance);
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |