T
- service type.public interface NamedBindingBuilder<T> extends BindingBuilder<T>
Modifier and Type | Method and Description |
---|---|
ScopedNamedBindingBuilder<T> |
in(java.lang.Class<? extends java.lang.annotation.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(java.lang.annotation.Annotation annotation)
Add a binging qualifier annotation.
|
void |
ranked(int rank)
Rank the binding.
|
NamedBindingBuilder<T> |
to(java.lang.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(java.lang.String key,
java.util.List<java.lang.String> values)
Add binding descriptor metadata.
|
NamedBindingBuilder<T> |
withMetadata(java.lang.String key,
java.lang.String value)
Add binding descriptor metadata.
|
NamedBindingBuilder<T> to(java.lang.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(java.lang.String key, java.lang.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.NamedBindingBuilder<T> withMetadata(java.lang.String key, java.util.List<java.lang.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.NamedBindingBuilder<T> qualifiedBy(java.lang.annotation.Annotation annotation)
Factory
then both the
Factory Service and the Factory.provide()
method will get the qualifierannotation
- qualifier annotation.ScopedNamedBindingBuilder<T> in(java.lang.Class<? extends java.lang.annotation.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.