public static class RestletGuice.Module extends com.google.inject.AbstractModule implements FinderFactory
FinderFactory
. On first use of the
methods of this facility, if the module hasn't been used to create an
Injector
, this module creates its own Injector.Constructor and Description |
---|
Module(java.lang.Iterable<? extends com.google.inject.Module> modules)
Creates a RestletGuice.Module that will install the given modules.
|
Module(com.google.inject.Module... modules)
Creates a RestletGuice.Module that will install the given modules.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configure() |
Finder |
finder(java.lang.Class<?> cls)
Returns a
Finder that will obtain a dependency-injected instance
of the ServerResource subtype bound to the type associated with the given
class. |
Finder |
finder(java.lang.Class<?> cls,
java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)
Returns a
Finder that will obtain a dependency-injected instance
of the ServerResource subtype bound to the type and qualifier associated
with the given class. |
protected com.google.inject.Provider<Application> |
newApplicationProvider()
Creates a
Provider r for the current Application . |
protected com.google.inject.Provider<Context> |
newContextProvider()
Creates a
Provider for the current Context . |
protected com.google.inject.Provider<Request> |
newRequestProvider()
Creates a
Provider for the current Request . |
protected com.google.inject.Provider<Response> |
newResponseProvider()
Creates a
Provider for the current Response . |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
public Module(com.google.inject.Module... modules)
public Module(java.lang.Iterable<? extends com.google.inject.Module> modules)
protected final void configure()
configure
in class com.google.inject.AbstractModule
public Finder finder(java.lang.Class<?> cls)
FinderFactory
Finder
that will obtain a dependency-injected instance
of the ServerResource subtype bound to the type associated with the given
class.finder
in interface FinderFactory
cls
- The class to instantiate.Finder
.public Finder finder(java.lang.Class<?> cls, java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)
FinderFactory
Finder
that will obtain a dependency-injected instance
of the ServerResource subtype bound to the type and qualifier associated
with the given class.finder
in interface FinderFactory
cls
- The class to instantiate.qualifier
- The qualifier associated with the given class.Finder
.protected com.google.inject.Provider<Application> newApplicationProvider()
Provider
r for the current Application
.
Override to use a custom Application provider.Provider
for the current Application
.protected com.google.inject.Provider<Context> newContextProvider()
Provider
for the current Context
. Override
to use a custom Context provider.Provider
for the current Context
.protected com.google.inject.Provider<Request> newRequestProvider()
Provider
for the current Request
. Override
to use a custom Request provider.Provider
for the current Request
.Copyright © 2005-2020 Restlet.