T
- service type.public interface ScopedBindingBuilder<T> extends BindingBuilder<T>
Modifier and Type | Method and Description |
---|---|
ScopedBindingBuilder<T> |
analyzeWith(String analyzer)
Set the name of the
ClassAnalyzer on the binding. |
ScopedBindingBuilder<T> |
loadedBy(HK2Loader loader)
Custom HK2 loader to be used when service class is about to be loaded.
|
ScopedNamedBindingBuilder<T> |
named(String name)
Name the binding. |
ScopedBindingBuilder<T> |
proxy(boolean proxiable)
Set proxy flag on the binding.
|
ScopedBindingBuilder<T> |
proxyForSameScope(boolean proxyForSameScope)
Set proxyForSameScope flag on the binding
|
ScopedBindingBuilder<T> |
qualifiedBy(Annotation annotation)
Add a binging qualifier annotation.
|
void |
ranked(int rank)
Rank the binding.
|
ScopedBindingBuilder<T> |
to(Class<? super T> contract)
Bind a new contract to a service.
|
ScopedBindingBuilder<T> |
to(TypeLiteral<?> contract)
Bind a new contract to a service.
|
ScopedBindingBuilder<T> |
withMetadata(String key,
List<String> values)
Add binding descriptor metadata.
|
ScopedBindingBuilder<T> |
withMetadata(String key,
String value)
Add binding descriptor metadata.
|
ScopedBindingBuilder<T> to(Class<? super T> contract)
contract
- contract type.ScopedBindingBuilder<T> to(TypeLiteral<?> contract)
contract
- contract type.ScopedBindingBuilder<T> loadedBy(HK2Loader loader)
loader
- custom service loader.ScopedBindingBuilder<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.ScopedBindingBuilder<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.ScopedBindingBuilder<T> qualifiedBy(Annotation annotation)
Factory
then both the
Factory Service and the Factory.provide()
method will get the qualifierannotation
- qualifier annotation.ScopedNamedBindingBuilder<T> named(String name)
Name
the binding.name
- new name value.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.ScopedBindingBuilder<T> proxy(boolean proxiable)
proxiable
- flag to determine if the binding should be proxiable.ScopedBindingBuilder<T> proxyForSameScope(boolean proxyForSameScope)
proxyForSameScope
- flag to determine if the binding should be proxiable
within the same scopeScopedBindingBuilder<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.