Uses of Class
com.google.inject.TypeLiteral
-
Packages that use TypeLiteral Package Description com.google.inject Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.com.google.inject.assistedinject Extension for combining factory interfaces with injection; this extension requiresguice-assistedinject.jar
.com.google.inject.binder Interfaces which make upBinder
's expression language.com.google.inject.multibindings Extension for binding multiple instances in a collection; this extension requiresguice-multibindings.jar
.com.google.inject.spi Guice service provider interfacecom.google.inject.testing.fieldbinder com.google.inject.throwingproviders Extension for injecting objects that may throw at provision time; this extension requiresguice-throwingproviders.jar
. -
-
Uses of TypeLiteral in com.google.inject
Methods in com.google.inject that return TypeLiteral Modifier and Type Method Description static <T> TypeLiteral<T>
TypeLiteral. get(Class<T> type)
Gets type literal for the givenClass
instance.static TypeLiteral<?>
TypeLiteral. get(Type type)
Gets type literal for the givenType
instance.TypeLiteral<?>
TypeLiteral. getFieldType(Field field)
Returns the resolved generic type offield
.TypeLiteral<?>
TypeLiteral. getReturnType(Method method)
Returns the resolved generic return type ofmethod
.TypeLiteral<?>
TypeLiteral. getSupertype(Class<?> supertype)
Returns the generic form ofsupertype
.TypeLiteral<T>
Key. getTypeLiteral()
Gets the key type.Methods in com.google.inject that return types with arguments of type TypeLiteral Modifier and Type Method Description Map<TypeLiteral<?>,List<InjectionPoint>>
Injector. getAllMembersInjectorInjectionPoints()
Returns the injection points created for calls toInjector.getMembersInjector(com.google.inject.TypeLiteral<T>)
(either directly or indirectly, e.g.List<TypeLiteral<?>>
TypeLiteral. getExceptionTypes(Member methodOrConstructor)
Returns the resolved generic exception types thrown byconstructor
.List<TypeLiteral<?>>
TypeLiteral. getParameterTypes(Member methodOrConstructor)
Returns the resolved generic parameter types ofmethodOrConstructor
.Methods in com.google.inject with parameters of type TypeLiteral Modifier and Type Method Description protected <T> AnnotatedBindingBuilder<T>
AbstractModule. bind(TypeLiteral<T> typeLiteral)
<T> AnnotatedBindingBuilder<T>
Binder. bind(TypeLiteral<T> typeLiteral)
See the EDSL examples atBinder
.protected <T> AnnotatedBindingBuilder<T>
PrivateModule. bind(TypeLiteral<T> typeLiteral)
AnnotatedElementBuilder
PrivateBinder. expose(TypeLiteral<?> type)
Makes a binding fortype
available to the enclosing environment.protected AnnotatedElementBuilder
PrivateModule. expose(TypeLiteral<?> type)
Makes a binding fortype
available to other modules and the injector.<T> List<Binding<T>>
Injector. findBindingsByType(TypeLiteral<T> type)
Returns all explicit bindings fortype
.static <T> Key<T>
Key. get(TypeLiteral<T> typeLiteral)
Gets a key for an injection type.static <T> Key<T>
Key. get(TypeLiteral<T> typeLiteral, Annotation annotation)
Gets a key for an injection type and an annotation.static <T> Key<T>
Key. get(TypeLiteral<T> typeLiteral, Class<? extends Annotation> annotationType)
Gets a key for an injection type and an annotation type.protected <T> MembersInjector<T>
AbstractModule. getMembersInjector(TypeLiteral<T> type)
<T> MembersInjector<T>
Binder. getMembersInjector(TypeLiteral<T> typeLiteral)
Returns the members injector used to inject dependencies into methods and fields on instances of the given typeT
.<T> MembersInjector<T>
Injector. getMembersInjector(TypeLiteral<T> typeLiteral)
Returns the members injector used to inject dependencies into methods and fields on instances of the given typeT
.protected <T> MembersInjector<T>
PrivateModule. getMembersInjector(TypeLiteral<T> type)
<U> Key<U>
Key. ofType(TypeLiteral<U> type)
Returns a new key of the specified type with the same annotation as this key.<T> void
Binder. requestInjection(TypeLiteral<T> type, T instance)
Upon successful creation, theInjector
will inject instance fields and methods of the given object.Method parameters in com.google.inject with type arguments of type TypeLiteral Modifier and Type Method Description protected void
AbstractModule. bindListener(Matcher<? super TypeLiteral<?>> typeMatcher, TypeListener listener)
void
Binder. bindListener(Matcher<? super TypeLiteral<?>> typeMatcher, TypeListener listener)
Registers a listener for injectable types.protected void
PrivateModule. bindListener(Matcher<? super TypeLiteral<?>> typeMatcher, TypeListener listener)
protected void
AbstractModule. convertToTypes(Matcher<? super TypeLiteral<?>> typeMatcher, TypeConverter converter)
void
Binder. convertToTypes(Matcher<? super TypeLiteral<?>> typeMatcher, TypeConverter converter)
Binds a type converter.protected void
PrivateModule. convertToTypes(Matcher<? super TypeLiteral<?>> typeMatcher, TypeConverter converter)
-
Uses of TypeLiteral in com.google.inject.assistedinject
Methods in com.google.inject.assistedinject that return TypeLiteral Modifier and Type Method Description TypeLiteral<?>
AssistedMethod. getImplementationType()
Returns the implementation type that will be created when the method is used.Methods in com.google.inject.assistedinject with parameters of type TypeLiteral Modifier and Type Method Description <F> Module
FactoryModuleBuilder. build(TypeLiteral<F> factoryInterface)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(Key<T> source, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(TypeLiteral<T> source, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(TypeLiteral<T> source, Annotation annotation, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(TypeLiteral<T> source, Annotation annotation, Class<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(TypeLiteral<T> source, Class<? extends Annotation> annotationType, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(TypeLiteral<T> source, Class<? extends Annotation> annotationType, Class<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(TypeLiteral<T> source, Class<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(Class<T> source, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(Class<T> source, Annotation annotation, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.<T> FactoryModuleBuilder
FactoryModuleBuilder. implement(Class<T> source, Class<? extends Annotation> annotationType, TypeLiteral<? extends T> target)
See the factory configuration examples atFactoryModuleBuilder
.static <F> Provider<F>
FactoryProvider. newFactory(TypeLiteral<F> factoryType, TypeLiteral<?> implementationType)
Deprecated. -
Uses of TypeLiteral in com.google.inject.binder
Methods in com.google.inject.binder with parameters of type TypeLiteral Modifier and Type Method Description ScopedBindingBuilder
LinkedBindingBuilder. to(TypeLiteral<? extends T> implementation)
See the EDSL examples atBinder
.<S extends T>
ScopedBindingBuilderLinkedBindingBuilder. toConstructor(Constructor<S> constructor, TypeLiteral<? extends S> type)
See the EDSL examples atBinder
.ScopedBindingBuilder
LinkedBindingBuilder. toProvider(TypeLiteral<? extends javax.inject.Provider<? extends T>> providerType)
See the EDSL examples atBinder
. -
Uses of TypeLiteral in com.google.inject.multibindings
Methods in com.google.inject.multibindings that return TypeLiteral Modifier and Type Method Description TypeLiteral<?>
MultibinderBinding. getElementTypeLiteral()
Returns the TypeLiteral that describes the type of elements in the set.TypeLiteral<?>
MapBinderBinding. getKeyTypeLiteral()
Returns the TypeLiteral describing the keys of the map.TypeLiteral<?>
MapBinderBinding. getValueTypeLiteral()
Returns the TypeLiteral describing the values of the map.Methods in com.google.inject.multibindings with parameters of type TypeLiteral Modifier and Type Method Description static <K,V>
MapBinder<K,V>MapBinder. newMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType)
Returns a new mapbinder that collects entries ofkeyType
/valueType
in aMap
that is itself bound with no binding annotation.static <K,V>
MapBinder<K,V>MapBinder. newMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Annotation annotation)
Returns a new mapbinder that collects entries ofkeyType
/valueType
in aMap
that is itself bound withannotation
.static <K,V>
MapBinder<K,V>MapBinder. newMapBinder(Binder binder, TypeLiteral<K> keyType, TypeLiteral<V> valueType, Class<? extends Annotation> annotationType)
Returns a new mapbinder that collects entries ofkeyType
/valueType
in aMap
that is itself bound withannotationType
.static <T> OptionalBinder<T>
OptionalBinder. newOptionalBinder(Binder binder, TypeLiteral<T> type)
static <T> Multibinder<T>
Multibinder. newSetBinder(Binder binder, TypeLiteral<T> type)
Returns a new multibinder that collects instances oftype
in aSet
that is itself bound with no binding annotation.static <T> Multibinder<T>
Multibinder. newSetBinder(Binder binder, TypeLiteral<T> type, Annotation annotation)
Returns a new multibinder that collects instances oftype
in aSet
that is itself bound withannotation
.static <T> Multibinder<T>
Multibinder. newSetBinder(Binder binder, TypeLiteral<T> type, Class<? extends Annotation> annotationType)
Returns a new multibinder that collects instances oftype
in aSet
that is itself bound withannotationType
. -
Uses of TypeLiteral in com.google.inject.spi
Methods in com.google.inject.spi that return TypeLiteral Modifier and Type Method Description TypeLiteral<?>
InjectionPoint. getDeclaringType()
Returns the generic type that defines this injection point.TypeLiteral<T>
InjectionRequest. getType()
TypeLiteral<T>
MembersInjectorLookup. getType()
Gets the type containing the members to be injected.Methods in com.google.inject.spi that return types with arguments of type TypeLiteral Modifier and Type Method Description Matcher<? super TypeLiteral<?>>
TypeConverterBinding. getTypeMatcher()
Matcher<? super TypeLiteral<?>>
TypeListenerBinding. getTypeMatcher()
Returns the type matcher which chooses which types the listener should be notified of.Methods in com.google.inject.spi with parameters of type TypeLiteral Modifier and Type Method Description Object
TypeConverter. convert(String value, TypeLiteral<?> toType)
Converts a string value.static <T> InjectionPoint
InjectionPoint. forConstructor(Constructor<T> constructor, TypeLiteral<? extends T> type)
Returns a new injection point for the specified constructor oftype
.static InjectionPoint
InjectionPoint. forConstructorOf(TypeLiteral<?> type)
Returns a new injection point for the injectable constructor oftype
.static InjectionPoint
InjectionPoint. forConstructorOf(TypeLiteral<?> type, boolean atInjectRequired)
Returns a new injection point for the injectable constructor oftype
.static Set<InjectionPoint>
InjectionPoint. forInstanceMethodsAndFields(TypeLiteral<?> type)
Returns all instance method and field injection points ontype
.static <T> InjectionPoint
InjectionPoint. forMethod(Method method, TypeLiteral<T> type)
Returns a new injection point for the specified method oftype
.static Set<InjectionPoint>
InjectionPoint. forStaticMethodsAndFields(TypeLiteral<?> type)
Returns all static method and field injection points ontype
.<T> MembersInjector<T>
TypeEncounter. getMembersInjector(TypeLiteral<T> typeLiteral)
Returns the members injector used to inject dependencies into methods and fields on instances of the given typeT
.<I> void
TypeListener. hear(TypeLiteral<I> type, TypeEncounter<I> encounter)
Invoked when Guice encounters a new type eligible for constructor or members injection.Constructors in com.google.inject.spi with parameters of type TypeLiteral Constructor Description InjectionRequest(Object source, TypeLiteral<T> type, T instance)
MembersInjectorLookup(Object source, TypeLiteral<T> type)
Constructor parameters in com.google.inject.spi with type arguments of type TypeLiteral Constructor Description TypeConverterBinding(Object source, Matcher<? super TypeLiteral<?>> typeMatcher, TypeConverter typeConverter)
-
Uses of TypeLiteral in com.google.inject.testing.fieldbinder
Methods in com.google.inject.testing.fieldbinder that return TypeLiteral Modifier and Type Method Description TypeLiteral<?>
BoundFieldModule.BoundFieldInfo. getFieldType()
The actual type of the field. -
Uses of TypeLiteral in com.google.inject.throwingproviders
Methods in com.google.inject.throwingproviders with parameters of type TypeLiteral Modifier and Type Method Description <P extends CheckedProvider,T>
ThrowingProviderBinder.SecondaryBinder<P,T>ThrowingProviderBinder. bind(Class<P> interfaceType, TypeLiteral<T> typeLiteral)
static <T,P extends CheckedProvider<? super T>>
PCheckedProviders. of(TypeLiteral<P> providerType, T instance)
Returns aCheckedProvider
which always providesinstance
.ScopedBindingBuilder
ThrowingProviderBinder.SecondaryBinder. providing(TypeLiteral<? extends T> cxtorLiteral)
static <T,P extends CheckedProvider<? super T>>
PCheckedProviders. throwing(TypeLiteral<P> providerType, Class<? extends Throwable> throwable)
Returns aCheckedProvider
which always throws exceptions.
-