public final class Bindings extends Object
Modifier and Type | Method and Description |
---|---|
static Collection<Binding> |
getBindings(InjectionManager injectionManager,
Binder binder) |
static <T extends InjectionResolver> |
injectionResolver(T resolver)
Start building a new injection resolver binding.
|
static <T> ClassBinding<T> |
service(Class<T> serviceType)
Start building a new class-based service binding.
|
static <T> ClassBinding<T> |
service(GenericType<T> serviceType)
Start building a new generic type-based service binding.
|
static <T> InstanceBinding<T> |
service(T service)
Start building a new instance-based service binding.
|
static <T> ClassBinding<T> |
serviceAsContract(Class<T> serviceType)
Start building a new class-based service binding.
|
static <T> ClassBinding<T> |
serviceAsContract(GenericType<T> serviceType)
Start building a new generic type-based service binding.
|
static <T> InstanceBinding<T> |
serviceAsContract(T service)
Start building a new instance-based service binding.
|
static <T> ClassBinding<T> |
serviceAsContract(Type serviceType)
Start building a new generic type-based service binding.
|
static <T> SupplierClassBinding<T> |
supplier(Class<? extends Supplier<T>> supplierType)
Start building a new supplier class-based service binding.
|
static <T> SupplierClassBinding<T> |
supplier(Class<? extends Supplier<T>> supplierType,
Class<? extends Annotation> supplierScope)
Start building a new supplier class-based service binding.
|
static <T> SupplierInstanceBinding<T> |
supplier(Supplier<T> supplier)
Start building a new supplier instance-based service binding.
|
public static Collection<Binding> getBindings(InjectionManager injectionManager, Binder binder)
public static <T> ClassBinding<T> service(Class<T> serviceType)
Does NOT service the service type itself as a contract type.
T
- service type.serviceType
- service class.public static <T> ClassBinding<T> serviceAsContract(Class<T> serviceType)
Binds the service type itself as a contract type.
T
- service type.serviceType
- service class.public static <T> ClassBinding<T> service(GenericType<T> serviceType)
Binds the generic service type itself as a contract type.
T
- service type.serviceType
- generic service type information.public static <T> ClassBinding<T> serviceAsContract(GenericType<T> serviceType)
Binds the generic service type itself as a contract type.
T
- service type.serviceType
- generic service type information.public static <T> ClassBinding<T> serviceAsContract(Type serviceType)
Binds the generic service type itself as a contract type.
T
- service type.serviceType
- generic service type information.public static <T> InstanceBinding<T> service(T service)
singleton-scoped
.
Does NOT service the service type itself as a contract type.
T
- service type.service
- service instance.public static <T> InstanceBinding<T> serviceAsContract(T service)
singleton-scoped
.
Binds the generic service type itself as a contract type.
T
- service type.service
- service instance.public static <T> SupplierClassBinding<T> supplier(Class<? extends Supplier<T>> supplierType, Class<? extends Annotation> supplierScope)
T
- service type.supplierType
- service supplier class.supplierScope
- factory scope.public static <T> SupplierClassBinding<T> supplier(Class<? extends Supplier<T>> supplierType)
The supplier itself is bound in a per-lookup scope.
T
- service type.supplierType
- service supplier class.public static <T> SupplierInstanceBinding<T> supplier(Supplier<T> supplier)
T
- service type.supplier
- service instance.public static <T extends InjectionResolver> InjectionResolverBinding<T> injectionResolver(T resolver)
singleton-scoped
.
There is no need to provide any additional information. Other method on Binding
will be ignored.
T
- type of the injection resolver.resolver
- injection resolver instance.Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.