T
- service type.public interface ScopedNamedBindingBuilder<T> extends BindingBuilder<T>
Modifier and Type | Method and Description |
---|---|
ScopedNamedBindingBuilder<T> |
analyzeWith(String analyzer)
Set the name of the
ClassAnalyzer on the binding. |
ScopedNamedBindingBuilder<T> |
loadedBy(HK2Loader loader)
Custom HK2 loader to be used when service class is about to be loaded.
|
ScopedNamedBindingBuilder<T> |
proxy(boolean proxiable)
Set proxy flag on the binding.
|
ScopedNamedBindingBuilder<T> |
qualifiedBy(Annotation annotation)
Add a binging qualifier annotation.
|
void |
ranked(int rank)
Rank the binding.
|
ScopedNamedBindingBuilder<T> |
to(Class<? super T> contract)
Bind a new contract to a service.
|
ScopedNamedBindingBuilder<T> |
to(TypeLiteral<?> contract)
Bind a new contract to a service.
|
ScopedNamedBindingBuilder<T> |
withMetadata(String key,
List<String> values)
Add binding descriptor metadata.
|
ScopedNamedBindingBuilder<T> |
withMetadata(String key,
String value)
Add binding descriptor metadata.
|
ScopedNamedBindingBuilder<T> to(Class<? super T> contract)
contract
- contract type.ScopedNamedBindingBuilder<T> to(TypeLiteral<?> contract)
contract
- contract type.ScopedNamedBindingBuilder<T> loadedBy(HK2Loader loader)
loader
- custom service loader.ScopedNamedBindingBuilder<T> withMetadata(String key, String value)
The metadata can be later used to e.g. 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()
method
key
- metadata key.value
- metadata value.ScopedNamedBindingBuilder<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.ScopedNamedBindingBuilder<T> qualifiedBy(Annotation annotation)
Factory
then both the
Factory Service and the Factory.provide()
method will get the qualifierannotation
- qualifier 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.ScopedNamedBindingBuilder<T> proxy(boolean proxiable)
proxiable
- flag to determine if the binding should be proxiable.ScopedNamedBindingBuilder<T> analyzeWith(String analyzer)
ClassAnalyzer
on the binding.analyzer
- The name of the analyzer that should be used. May be null
to indicate the default class analzyerCopyright © 2009–2019 Oracle Corporation. All rights reserved.