T
- service type.public interface ServiceBindingBuilder<T> extends BindingBuilder<T>
Modifier and Type | Method and Description |
---|---|
ServiceBindingBuilder<T> |
analyzeWith(String analyzer)
Set the name of the
ClassAnalyzer on the binding. |
ScopedBindingBuilder<T> |
in(Class<? extends Annotation> scopeAnnotation)
Scope a binding.
|
ServiceBindingBuilder<T> |
loadedBy(HK2Loader loader)
Custom HK2 loader to be used when service class is about to be loaded.
|
NamedBindingBuilder<T> |
named(String name)
Name the binding. |
ServiceBindingBuilder<T> |
proxy(boolean proxiable)
Set proxy flag on the binding.
|
ServiceBindingBuilder<T> |
qualifiedBy(Annotation annotation)
Add a binging qualifier annotation.
|
void |
ranked(int rank)
Rank the binding.
|
ServiceBindingBuilder<T> |
to(Class<? super T> contract)
Bind a new contract to a service.
|
ServiceBindingBuilder<T> |
to(TypeLiteral<?> contract)
Bind a new contract to a service.
|
ServiceBindingBuilder<T> |
withMetadata(String key,
List<String> values)
Add binding descriptor metadata.
|
ServiceBindingBuilder<T> |
withMetadata(String key,
String value)
Add binding descriptor metadata.
|
ServiceBindingBuilder<T> to(Class<? super T> contract)
contract
- contract type.ServiceBindingBuilder<T> to(TypeLiteral<?> contract)
contract
- contract type.ServiceBindingBuilder<T> loadedBy(HK2Loader loader)
loader
- custom service loader.ServiceBindingBuilder<T> withMetadata(String key, String value)
filter
binding
descriptors.key
- metadata key.value
- metadata value.ServiceBindingBuilder<T> withMetadata(String key, List<String> values)
filter
binding
descriptors.key
- metadata key.values
- metadata values.ServiceBindingBuilder<T> qualifiedBy(Annotation annotation)
annotation
- qualifier annotation.ScopedBindingBuilder<T> in(Class<? extends Annotation> scopeAnnotation)
scopeAnnotation
- scope annotation.NamedBindingBuilder<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.ServiceBindingBuilder<T> proxy(boolean proxiable)
proxiable
- flag to determine if the binding should be proxiable.ServiceBindingBuilder<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 © 2014 Oracle Corporation. All rights reserved.