|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DescriptorBuilder
This is an object that uses the Builder pattern in order to generate a Descriptor (for binding) or a Filter (for searching). It is intended to facilitate query strings of method calls that is simple to understand and read.
| Method Summary | |
|---|---|
DescriptorBuilder |
andLoadWith(HK2Loader loader)
Call this if this descriptor should be loaded with the given HK2Loader |
DescriptorImpl |
build()
Generates a descriptor that can be used in binding operations |
FactoryDescriptors |
buildFactory()
Generates a factory descriptor that can be used in binding operations. |
FactoryDescriptors |
buildFactory(Class<? extends Annotation> factoryScope)
Generates a factory descriptor that can be used in binding operations. |
FactoryDescriptors |
buildFactory(String factoryScope)
Generates a factory descriptor that can be used in binding operations. |
DescriptorBuilder |
has(String key,
List<String> values)
An instance of data to be associated with this descriptor |
DescriptorBuilder |
has(String key,
String value)
An instance of data to be associated with this descriptor |
DescriptorBuilder |
in(Class<? extends Annotation> scope)
A scope to be associated with this descriptor object. |
DescriptorBuilder |
in(String scope)
A scope to be associated with this descriptor object. |
DescriptorBuilder |
named(String name)
The name for this descriptor object. |
DescriptorBuilder |
ofRank(int rank)
The rank to be associated with this descriptor. |
DescriptorBuilder |
proxy()
This will cause the isProxiable field of the returned descriptor to return true (it will force this descriptor to use proxies). |
DescriptorBuilder |
proxy(boolean forceProxy)
This will cause the isProxiable field of the returned descriptor to return the given value. |
DescriptorBuilder |
qualifiedBy(Annotation annotation)
A qualifier to be associated with this descriptor object |
DescriptorBuilder |
qualifiedBy(String annotation)
A qualifier to be associated with this descriptor object |
DescriptorBuilder |
to(Class<?> contract)
A contract to be associated with this descriptor object. |
DescriptorBuilder |
to(String contract)
A contract to be associated with this descriptor object. |
| Method Detail |
|---|
DescriptorBuilder named(String name)
throws IllegalArgumentException
name - The name to be associated with this Descriptor
IllegalArgumentException - if there is more than one name on the predicate
DescriptorBuilder to(Class<?> contract)
throws IllegalArgumentException
contract - A class that is annotated with Contract to
be associated with this Descriptor
IllegalArgumentException - on failures
DescriptorBuilder to(String contract)
throws IllegalArgumentException
contract - The fully qualified name of a class that is annotated with Contract.
IllegalArgumentException - on failures
DescriptorBuilder 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 once
DescriptorBuilder in(String scope)
throws IllegalArgumentException
scope - The fully qualified class name of the scope this predicate is to have.
IllegalArgumentException - If in is called more than once
DescriptorBuilder qualifiedBy(Annotation annotation)
throws IllegalArgumentException
annotation - The annotation to be associated with this descriptor
IllegalArgumentException - on failures
DescriptorBuilder qualifiedBy(String annotation)
throws IllegalArgumentException
annotation - The fully qualified class name of an annotation to be
associated with this descriptor
IllegalArgumentException - on failures
DescriptorBuilder 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
DescriptorBuilder 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)
IllegalArgumentExceptionDescriptorBuilder ofRank(int rank)
rank - The rank to be associated with this descriptor.
DescriptorBuilder proxy()
DescriptorBuilder proxy(boolean forceProxy)
forceProxy - if true then this descriptor will be proxied,
if false then this descriptor will NOT be proxied
DescriptorBuilder andLoadWith(HK2Loader loader)
throws IllegalArgumentException
loader - The loader to use with this descriptor
IllegalArgumentException - if the HK2Loader is set non-null more than once
DescriptorImpl build()
throws IllegalArgumentException
IllegalArgumentException - if the built descriptor is invalid
FactoryDescriptors buildFactory()
throws IllegalArgumentException
IllegalArgumentException - if the built descriptor is invalid
FactoryDescriptors buildFactory(String factoryScope)
throws IllegalArgumentException
factoryScope - The scope the factory service itself is in.
IllegalArgumentException - if the built descriptor is invalid
FactoryDescriptors buildFactory(Class<? extends Annotation> factoryScope)
throws IllegalArgumentException
factoryScope - The scope the factory service itself is in. If this is null the
PerLookup scope will be used
IllegalArgumentException - if the built descriptor is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||