Uses of Class
com.google.inject.TypeLiteral
Packages that use TypeLiteral
Package
Description
Google Guice (pronounced "juice") is an ultra-lightweight dependency injection framework.
Interfaces which make up
Binder
's expression language.Guice (sounds like "juice")
Extension for binding multiple instances in a collection; this extension requires
guice-multibindings.jar
.Guice service provider interface
-
Uses of TypeLiteral in com.google.inject
Methods in com.google.inject that return TypeLiteralModifier and TypeMethodDescriptionstatic <T> TypeLiteral
<T> Gets type literal for the givenClass
instance.static TypeLiteral
<?> 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
.final TypeLiteral
<T> Key.getTypeLiteral()
Gets the key type.Methods in com.google.inject that return types with arguments of type TypeLiteralModifier and TypeMethodDescriptionMap
<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 TypeLiteralModifier and TypeMethodDescriptionprotected <T> AnnotatedBindingBuilder
<T> AbstractModule.bind
(TypeLiteral<T> typeLiteral) <T> AnnotatedBindingBuilder
<T> Binder.bind
(TypeLiteral<T> typeLiteral) See the EDSL examples atBinder
.protected final <T> AnnotatedBindingBuilder
<T> PrivateModule.bind
(TypeLiteral<T> typeLiteral) PrivateBinder.expose
(TypeLiteral<?> type) Makes a binding fortype
available to the enclosing environment.protected final AnnotatedElementBuilder
PrivateModule.expose
(TypeLiteral<?> type) Makes a binding fortype
available to other modules and the injector.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 TypeLiteralModifier and TypeMethodDescriptionprotected 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 final void
PrivateModule.convertToTypes
(Matcher<? super TypeLiteral<?>> typeMatcher, TypeConverter converter) -
Uses of TypeLiteral in com.google.inject.binder
Methods in com.google.inject.binder with parameters of type TypeLiteralModifier and TypeMethodDescriptionLinkedBindingBuilder.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
.LinkedBindingBuilder.toProvider
(TypeLiteral<? extends javax.inject.Provider<? extends T>> providerType) See the EDSL examples atBinder
. -
Uses of TypeLiteral in com.google.inject.internal
Methods in com.google.inject.internal that return TypeLiteralModifier and TypeMethodDescriptionstatic <T> TypeLiteral
<T> MoreTypes.canonicalizeForKey
(TypeLiteral<T> typeLiteral) Returns an type that's appropriate for use in a key.Methods in com.google.inject.internal with parameters of type TypeLiteralModifier and TypeMethodDescriptionErrors.ambiguousTypeConversion
(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding a, TypeConverterBinding b) Errors.atInjectRequired
(TypeLiteral<?> type) static <T> TypeLiteral
<T> MoreTypes.canonicalizeForKey
(TypeLiteral<T> typeLiteral) Returns an type that's appropriate for use in a key.Errors.constructorNotDefinedByType
(Constructor<?> constructor, TypeLiteral<?> type) Errors.conversionError
(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding typeConverterBinding, RuntimeException cause) Errors.conversionTypeError
(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding typeConverterBinding, Object converted) Errors.converterReturnedNull
(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding typeConverterBinding) static InternalProvisionException
InternalProvisionException.errorInUserInjector
(MembersInjector<?> listener, TypeLiteral<?> type, RuntimeException cause) static InternalProvisionException
InternalProvisionException.errorNotifyingInjectionListener
(InjectionListener<?> listener, TypeLiteral<?> type, RuntimeException cause) Errors.errorNotifyingTypeListener
(TypeListenerBinding listener, TypeLiteral<?> type, Throwable cause) static Key
<?> Annotations.getKey
(TypeLiteral<?> type, Member member, Annotation[] annotations, Errors errors) Gets a key for the given type, member and annotations.Errors.keyNotFullySpecified
(TypeLiteral<?> typeLiteral) Errors.missingConstructor
(TypeLiteral<?> type) static <K,
V> RealMapBinder <K, V> RealMapBinder.newMapRealBinder
(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> RealMapBinder <K, V> RealMapBinder.newRealMapBinder
(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> RealMapBinder <K, V> RealMapBinder.newRealMapBinder
(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
.BindingBuilder.to
(TypeLiteral<? extends T> implementation) <S extends T>
ScopedBindingBuilderBindingBuilder.toConstructor
(Constructor<S> constructor, TypeLiteral<? extends S> type) BindingBuilder.toProvider
(TypeLiteral<? extends javax.inject.Provider<? extends T>> providerType) -
Uses of TypeLiteral in com.google.inject.multibindings
Methods in com.google.inject.multibindings that return TypeLiteralModifier and TypeMethodDescriptionTypeLiteral
<?> 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 TypeLiteralModifier and TypeMethodDescriptionstatic <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 TypeLiteralModifier and TypeMethodDescriptionTypeLiteral
<?> InjectionPoint.getDeclaringType()
Returns the generic type that defines this injection point.InjectionRequest.getType()
MembersInjectorLookup.getType()
Gets the type containing the members to be injected.Methods in com.google.inject.spi that return types with arguments of type TypeLiteralModifier and TypeMethodDescriptionMatcher
<? 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 TypeLiteralModifier and TypeMethodDescriptionTypeConverter.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 TypeLiteralModifierConstructorDescriptionInjectionRequest
(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 TypeLiteralModifierConstructorDescriptionTypeConverterBinding
(Object source, Matcher<? super TypeLiteral<?>> typeMatcher, TypeConverter typeConverter)