Interface ScopedNamedBindingBuilder<T>
-
- Type Parameters:
T
- service type.
- All Superinterfaces:
BindingBuilder<T>
public interface ScopedNamedBindingBuilder<T> extends BindingBuilder<T>
Scoped and named service binding builder.- Author:
- Marek Potociar (marek.potociar at oracle.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScopedNamedBindingBuilder<T>
analyzeWith(String analyzer)
Set the name of theClassAnalyzer
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, String value)
Add binding descriptor metadata.ScopedNamedBindingBuilder<T>
withMetadata(String key, List<String> values)
Add binding descriptor metadata.
-
-
-
Method Detail
-
to
ScopedNamedBindingBuilder<T> to(Class<? super T> contract)
Bind a new contract to a service.- Parameters:
contract
- contract type.- Returns:
- updated binder.
-
to
ScopedNamedBindingBuilder<T> to(TypeLiteral<?> contract)
Bind a new contract to a service.- Parameters:
contract
- contract type.- Returns:
- updated binder.
-
loadedBy
ScopedNamedBindingBuilder<T> loadedBy(HK2Loader loader)
Custom HK2 loader to be used when service class is about to be loaded.- Parameters:
loader
- custom service loader.- Returns:
- updated binder.
-
withMetadata
ScopedNamedBindingBuilder<T> withMetadata(String key, String value)
Add binding descriptor metadata.The metadata can be later used to e.g.
filter
binding descriptors. If this is forFactory
descriptors the metadata will be placed on both the Factory as a service and on the FactoriesFactory.provide()
method- Parameters:
key
- metadata key.value
- metadata value.- Returns:
- updated binder.
-
withMetadata
ScopedNamedBindingBuilder<T> withMetadata(String key, List<String> values)
Add binding descriptor metadata. The metadata can be later used to e.g.filter
binding descriptors. If this is forFactory
descriptors the metadata will be placed on both the Factory as a service and on the FactoriesFactory.provide()
method- Parameters:
key
- metadata key.values
- metadata values.- Returns:
- updated binder.
-
qualifiedBy
ScopedNamedBindingBuilder<T> qualifiedBy(Annotation annotation)
Add a binging qualifier annotation. If this is being used with aFactory
then both the Factory Service and theFactory.provide()
method will get the qualifier- Parameters:
annotation
- qualifier annotation.- Returns:
- updated binder.
-
ranked
void ranked(int rank)
Rank the binding. The higher rank, the more prominent position in an injectediterable provider
for a contract.- Parameters:
rank
- binding rank to be used to resolve ordering in case of multiple services are bound to the same contract.
-
proxy
ScopedNamedBindingBuilder<T> proxy(boolean proxiable)
Set proxy flag on the binding.- Parameters:
proxiable
- flag to determine if the binding should be proxiable.
-
analyzeWith
ScopedNamedBindingBuilder<T> analyzeWith(String analyzer)
Set the name of theClassAnalyzer
on the binding.- Parameters:
analyzer
- The name of the analyzer that should be used. May be null to indicate the default class analzyer
-
-