public class GuiceComponentProviderFactory extends Object implements IoCComponentProviderFactory
IoCComponentProviderFactory
.Constructor and Description |
---|
GuiceComponentProviderFactory(ResourceConfig config,
com.google.inject.Injector injector)
Creates a new GuiceComponentProviderFactory.
|
Modifier and Type | Method and Description |
---|---|
Map<com.google.inject.Scope,ComponentScope> |
createScopeMap()
Maps a Guice scope to a Jersey scope.
|
IoCComponentProvider |
getComponentProvider(Class<?> c)
Get the IoC component provider for a class.
|
IoCComponentProvider |
getComponentProvider(ComponentContext cc,
Class<?> clazz)
Get the IoC component provider for a class with additional context.
|
boolean |
isGuiceConstructorInjected(Class<?> c)
Determine if a class is an implicit Guice component that can be
instantiated by Guice and the life-cycle managed by Jersey.
|
boolean |
isGuiceFieldOrMethodInjected(Class<?> c)
Determine if a class uses field or method injection via Guice
using the
Inject annotation |
boolean |
isImplicitGuiceComponent(Class<?> c)
Deprecated.
|
public GuiceComponentProviderFactory(ResourceConfig config, com.google.inject.Injector injector)
config
- the resource configurationinjector
- the Guice injectorpublic IoCComponentProvider getComponentProvider(Class<?> c)
IoCComponentProviderFactory
getComponentProvider
in interface ComponentProviderFactory<IoCComponentProvider>
getComponentProvider
in interface IoCComponentProviderFactory
c
- the classpublic IoCComponentProvider getComponentProvider(ComponentContext cc, Class<?> clazz)
IoCComponentProviderFactory
The additional context will be associated with the annotations and
optionally an annotated object. For example, a component provider may
be requested for a class that is the type of a Field
, or be
requested for a class that is the type of a method parameter.
getComponentProvider
in interface IoCComponentProviderFactory
cc
- the component context to obtain annotations and
the annotated object (if present).clazz
- the class@Deprecated public boolean isImplicitGuiceComponent(Class<?> c)
isGuiceConstructorInjected(java.lang.Class)
c
- the class.public boolean isGuiceConstructorInjected(Class<?> c)
c
- the class.public boolean isGuiceFieldOrMethodInjected(Class<?> c)
Inject
annotationc
- the class.public Map<com.google.inject.Scope,ComponentScope> createScopeMap()
Copyright © 2013 Oracle Corporation. All rights reserved.