public final class Bindings
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
Bindings() |
Modifier and Type | Method and Description |
---|---|
static java.util.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(java.lang.Class<T> serviceType)
Start building a new class-based service binding.
|
static <T> ClassBinding<T> |
service(javax.ws.rs.core.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(java.lang.Class<T> serviceType)
Start building a new class-based service binding.
|
static <T> ClassBinding<T> |
serviceAsContract(javax.ws.rs.core.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(java.lang.reflect.Type serviceType)
Start building a new generic type-based service binding.
|
static <T> SupplierClassBinding<T> |
supplier(java.lang.Class<? extends java.util.function.Supplier<T>> supplierType)
Start building a new supplier class-based service binding.
|
static <T> SupplierClassBinding<T> |
supplier(java.lang.Class<? extends java.util.function.Supplier<T>> supplierType,
java.lang.Class<? extends java.lang.annotation.Annotation> supplierScope)
Start building a new supplier class-based service binding.
|
static <T> SupplierInstanceBinding<T> |
supplier(java.util.function.Supplier<T> supplier)
Start building a new supplier instance-based service binding.
|
public static java.util.Collection<Binding> getBindings(InjectionManager injectionManager, Binder binder)
public static <T> ClassBinding<T> service(java.lang.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(java.lang.Class<T> serviceType)
Binds the service type itself as a contract type.
T
- service type.serviceType
- service class.public static <T> ClassBinding<T> service(javax.ws.rs.core.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(javax.ws.rs.core.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(java.lang.reflect.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(java.lang.Class<? extends java.util.function.Supplier<T>> supplierType, java.lang.Class<? extends java.lang.annotation.Annotation> supplierScope)
T
- service type.supplierType
- service supplier class.supplierScope
- factory scope.public static <T> SupplierClassBinding<T> supplier(java.lang.Class<? extends java.util.function.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(java.util.function.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.