public interface ActiveDescriptorBuilder
Qualifier
or contracts that are not
marked with Contract
. An unreified ActiveDescriptor given
to a bind method need not implement the create or destroy method,
as they are automatically created and destroyed by the system.Modifier and Type | Method and Description |
---|---|
ActiveDescriptorBuilder |
analyzeWith(String serviceName)
Call this if the descriptor should be analyzed with the
ClassAnalyzer service of the given name |
ActiveDescriptorBuilder |
andLoadWith(HK2Loader loader)
Call this if this descriptor should be loaded with the given HK2Loader
|
ActiveDescriptorBuilder |
asType(Type t)
Call this if the parameterized type of the implementation
class is known.
|
<T> AbstractActiveDescriptor<T> |
build()
Generates a descriptor that can be used in binding operations
|
<T> AbstractActiveDescriptor<T> |
buildFactory()
Deprecated.
Use buildProvideMethod instead
|
<T> AbstractActiveDescriptor<T> |
buildProvideMethod()
Generates a descriptor that can be used in binding operations that
describes a factorys provide method
|
ActiveDescriptorBuilder |
has(String key,
List<String> values)
An instance of data to be associated with this descriptor
|
ActiveDescriptorBuilder |
has(String key,
String value)
An instance of data to be associated with this descriptor
|
ActiveDescriptorBuilder |
in(Annotation scope)
A scope to be associated with this descriptor object.
|
ActiveDescriptorBuilder |
in(Class<? extends Annotation> scope)
A scope to be associated with this descriptor object.
|
ActiveDescriptorBuilder |
localOnly()
This will cause the descriptorVisibility field of the returned
descriptor to return LOCAL
|
ActiveDescriptorBuilder |
named(String name)
The name for this descriptor object.
|
ActiveDescriptorBuilder |
ofRank(int rank)
The rank to be associated with this descriptor.
|
ActiveDescriptorBuilder |
proxy()
This will cause the isProxiable field of the returned
descriptor to return true (it will force this
descriptor to use proxies).
|
ActiveDescriptorBuilder |
proxy(boolean forceProxy)
This will cause the isProxiable field of the returned
descriptor to return the given value.
|
ActiveDescriptorBuilder |
proxyForSameScope()
This will cause the isProxyForSameScope field of the returned
descriptor to return true (it will force this
descriptor to use proxies even when injecting into
the same scope).
|
ActiveDescriptorBuilder |
proxyForSameScope(boolean forceProxyForSameScope)
This will cause the isProxyForSameScope field of the returned
descriptor to return the given value.
|
ActiveDescriptorBuilder |
qualifiedBy(Annotation annotation)
A qualifier to be associated with this descriptor object
|
ActiveDescriptorBuilder |
to(Type contract)
A contract to be associated with this descriptor object.
|
ActiveDescriptorBuilder |
visibility(DescriptorVisibility visibility)
This will set the descriptorVisibility field of the returned
descriptor
|
ActiveDescriptorBuilder named(String name) throws IllegalArgumentException
name
- The name to be associated with this DescriptorIllegalArgumentException
- if there is more than one name on the predicateActiveDescriptorBuilder to(Type contract) throws IllegalArgumentException
contract
- A class that is annotated with Contract to
be associated with this DescriptorIllegalArgumentException
- on failuresActiveDescriptorBuilder in(Annotation scope) throws IllegalArgumentException
scope
- The class of the scope this descriptor is to have.IllegalArgumentException
- If in is called more than onceActiveDescriptorBuilder in(Class<? extends Annotation> scope) throws IllegalArgumentException
scope
- The class of the scope this descriptor is to have.IllegalArgumentException
- If in is called more than onceActiveDescriptorBuilder qualifiedBy(Annotation annotation) throws IllegalArgumentException
annotation
- The annotation to be associated with this descriptorIllegalArgumentException
- on failuresActiveDescriptorBuilder has(String key, String value) throws IllegalArgumentException
key
- The key for the data to be associated with this descriptorvalue
- The value this key should take (single value metadata)IllegalArgumentException
ActiveDescriptorBuilder has(String key, List<String> values) throws IllegalArgumentException
key
- The key for the data to be associated with this descriptorvalues
- The values this key should take (single value metadata)IllegalArgumentException
ActiveDescriptorBuilder ofRank(int rank)
rank
- The rank to be associated with this descriptor.ActiveDescriptorBuilder localOnly()
ActiveDescriptorBuilder visibility(DescriptorVisibility visibility)
visibility
- The non-null visibility that this descriptor should takeActiveDescriptorBuilder proxy()
ActiveDescriptorBuilder proxy(boolean forceProxy)
forceProxy
- if true then this descriptor will be proxied,
if false then this descriptor will NOT be proxiedActiveDescriptorBuilder proxyForSameScope()
ActiveDescriptorBuilder proxyForSameScope(boolean forceProxyForSameScope)
forceProxyForSameScope
- if true then this descriptor will be
proxied even if the scope of the injectee is the same,
if false then this descriptor will NOT be proxied, even if the
scope of the injectee is the sameActiveDescriptorBuilder andLoadWith(HK2Loader loader) throws IllegalArgumentException
loader
- The loader to use with this descriptorIllegalArgumentException
- if the HK2Loader is set non-null more than onceActiveDescriptorBuilder analyzeWith(String serviceName)
ClassAnalyzer
service of the given nameserviceName
- the name of the ClassAnalyzer
service
that should be used to analyze this serviceActiveDescriptorBuilder asType(Type t)
t
- The non-null ParameterizedType describing the implementation<T> AbstractActiveDescriptor<T> build() throws IllegalArgumentException
IllegalArgumentException
- if the built descriptor is invalid@Deprecated <T> AbstractActiveDescriptor<T> buildFactory() throws IllegalArgumentException
IllegalArgumentException
- if the built descriptor is invalid<T> AbstractActiveDescriptor<T> buildProvideMethod() throws IllegalArgumentException
IllegalArgumentException
- if the built descriptor is invalidCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.