|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.hk2.internal.DescriptorBuilderImpl
public class DescriptorBuilderImpl
This is a simple implementation of the DescriptorBuilder
| Constructor Summary | |
|---|---|
DescriptorBuilderImpl()
The basid constructor |
|
DescriptorBuilderImpl(String implementation,
boolean addToContracts)
A descriptor builder with the given implementation |
|
| 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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DescriptorBuilderImpl()
public DescriptorBuilderImpl(String implementation,
boolean addToContracts)
implementation - The implementation this should takeaddToContracts - Whether or not to add the implementation to the set of contracts| Method Detail |
|---|
public DescriptorBuilder named(String name)
throws IllegalArgumentException
DescriptorBuilder
named in interface DescriptorBuildername - The name to be associated with this Descriptor
IllegalArgumentException - if there is more than one name on the predicate
public DescriptorBuilder to(Class<?> contract)
throws IllegalArgumentException
DescriptorBuilder
to in interface DescriptorBuildercontract - A class that is annotated with Contract to
be associated with this Descriptor
IllegalArgumentException - on failures
public DescriptorBuilder to(String contract)
throws IllegalArgumentException
DescriptorBuilder
to in interface DescriptorBuildercontract - The fully qualified name of a class that is annotated with Contract.
IllegalArgumentException - on failures
public DescriptorBuilder in(Class<? extends Annotation> scope)
throws IllegalArgumentException
DescriptorBuilder
in in interface DescriptorBuilderscope - The class of the scope this descriptor is to have.
IllegalArgumentException - If in is called more than once
public DescriptorBuilder in(String scope)
throws IllegalArgumentException
DescriptorBuilder
in in interface DescriptorBuilderscope - The fully qualified class name of the scope this predicate is to have.
IllegalArgumentException - If in is called more than once
public DescriptorBuilder qualifiedBy(Annotation annotation)
throws IllegalArgumentException
DescriptorBuilder
qualifiedBy in interface DescriptorBuilderannotation - The annotation to be associated with this descriptor
IllegalArgumentException - on failures
public DescriptorBuilder qualifiedBy(String annotation)
throws IllegalArgumentException
DescriptorBuilder
qualifiedBy in interface DescriptorBuilderannotation - The fully qualified class name of an annotation to be
associated with this descriptor
IllegalArgumentException - on failures
public DescriptorBuilder has(String key,
String value)
throws IllegalArgumentException
DescriptorBuilder
has in interface DescriptorBuilderkey - The key for the data to be associated with this descriptorvalue - The value this key should take (single value metadata)
IllegalArgumentException
public DescriptorBuilder has(String key,
List<String> values)
throws IllegalArgumentException
DescriptorBuilder
has in interface DescriptorBuilderkey - The key for the data to be associated with this descriptorvalues - The values this key should take (single value metadata)
IllegalArgumentExceptionpublic DescriptorBuilder ofRank(int rank)
DescriptorBuilder
ofRank in interface DescriptorBuilderrank - The rank to be associated with this descriptor.
public DescriptorBuilder andLoadWith(HK2Loader loader)
throws IllegalArgumentException
DescriptorBuilder
andLoadWith in interface DescriptorBuilderloader - The loader to use with this descriptor
IllegalArgumentException - if the HK2Loader is set non-null more than once
public DescriptorImpl build()
throws IllegalArgumentException
DescriptorBuilder
build in interface DescriptorBuilderIllegalArgumentException - if the built descriptor is invalid
public FactoryDescriptors buildFactory(String factoryScope)
throws IllegalArgumentException
DescriptorBuilder
buildFactory in interface DescriptorBuilderfactoryScope - The scope the factory service itself is in.
IllegalArgumentException - if the built descriptor is invalid
public FactoryDescriptors buildFactory()
throws IllegalArgumentException
DescriptorBuilder
buildFactory in interface DescriptorBuilderIllegalArgumentException - if the built descriptor is invalid
public FactoryDescriptors buildFactory(Class<? extends Annotation> factoryScope)
throws IllegalArgumentException
DescriptorBuilder
buildFactory in interface DescriptorBuilderfactoryScope - 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 | |||||||||