T
- service type.public interface NamedBindingBuilder<T> extends BindingBuilder<T>
Modifier and Type | Method and Description |
---|---|
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.key
- metadata key.value
- metadata value.NamedBindingBuilder<T> withMetadata(String key, List<String> values)
filter
binding
descriptors.key
- metadata key.values
- metadata values.NamedBindingBuilder<T> qualifiedBy(Annotation annotation)
annotation
- 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.Copyright © 2018 Oracle Corporation. All rights reserved.