T
- service type.public interface NamedBindingBuilder<T> extends BindingBuilder<T>
Modifier and Type | Method and Description |
---|---|
NamedBindingBuilder<T> |
asType(Type t)
Call this if the parameterized type of the implementation
class is known.
|
ScopedNamedBindingBuilder<T> |
in(Class<? extends Annotation> scopeAnnotation)
Scope a binding.
|
NamedBindingBuilder<T> |
loadedBy(HK2Loader loader)
Custom HK2 loader to be used when service class is about to be loaded.
|
NamedBindingBuilder<T> |
proxy(boolean proxiable)
Set proxy flag on the binding.
|
NamedBindingBuilder<T> |
qualifiedBy(Annotation annotation)
Add a binging qualifier annotation.
|
void |
ranked(int rank)
Rank the binding.
|
NamedBindingBuilder<T> |
to(Class<? super T> contract)
Bind a new contract to a service.
|
NamedBindingBuilder<T> |
to(TypeLiteral<?> contract)
Bind a new contract to a service.
|
NamedBindingBuilder<T> |
withMetadata(String key,
List<String> values)
Add binding descriptor metadata.
|
NamedBindingBuilder<T> |
withMetadata(String key,
String value)
Add binding descriptor metadata.
|
NamedBindingBuilder<T> to(Class<? super T> contract)
contract
- contract type.NamedBindingBuilder<T> to(TypeLiteral<?> contract)
contract
- contract type.NamedBindingBuilder<T> loadedBy(HK2Loader loader)
loader
- custom service loader.NamedBindingBuilder<T> withMetadata(String key, String value)
filter
binding
descriptors. If this is for Factory
descriptors the metadata
will be placed on both the Factory as a service and on the
Factories Factory.provide()
methodkey
- metadata key.value
- metadata value.NamedBindingBuilder<T> withMetadata(String key, List<String> values)
filter
binding
descriptors. If this is for Factory
descriptors the metadata
will be placed on both the Factory as a service and on the
Factories Factory.provide()
methodkey
- metadata key.values
- metadata values.NamedBindingBuilder<T> qualifiedBy(Annotation annotation)
Factory
then both the
Factory Service and the Factory.provide()
method will get the qualifierannotation
- qualifier annotation.ScopedNamedBindingBuilder<T> in(Class<? extends Annotation> scopeAnnotation)
scopeAnnotation
- scope annotation.void ranked(int rank)
iterable provider
for a contract.rank
- binding rank to be used to resolve ordering in case of multiple services
are bound to the same contract.NamedBindingBuilder<T> proxy(boolean proxiable)
proxiable
- flag to determine if the binding should be proxiable.NamedBindingBuilder<T> asType(Type t)
t
- The non-null ParameterizedType describing the implementationCopyright © 2009–2019 Oracle Corporation. All rights reserved.