|
||||||||||
| 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(java.lang.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(java.lang.Class<? extends java.lang.annotation.Annotation> factoryScope)
Generates a factory descriptor that can be used in binding operations. |
FactoryDescriptors |
buildFactory(java.lang.String factoryScope)
Generates a factory descriptor that can be used in binding operations. |
DescriptorBuilder |
has(java.lang.String key,
java.util.List<java.lang.String> values)
An instance of data to be associated with this descriptor |
DescriptorBuilder |
has(java.lang.String key,
java.lang.String value)
An instance of data to be associated with this descriptor |
DescriptorBuilder |
in(java.lang.Class<? extends java.lang.annotation.Annotation> scope)
A scope to be associated with this descriptor object. |
DescriptorBuilder |
in(java.lang.String scope)
A scope to be associated with this descriptor object. |
DescriptorBuilder |
localOnly()
This will cause the descriptorVisibility field of the returned descriptor to return LOCAL |
DescriptorBuilder |
named(java.lang.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(java.lang.annotation.Annotation annotation)
A qualifier to be associated with this descriptor object |
DescriptorBuilder |
qualifiedBy(java.lang.String annotation)
A qualifier to be associated with this descriptor object |
DescriptorBuilder |
to(java.lang.Class<?> contract)
A contract to be associated with this descriptor object. |
DescriptorBuilder |
to(java.lang.String contract)
A contract to be associated with this descriptor object. |
DescriptorBuilder |
visibility(DescriptorVisibility visibility)
This will set the descriptorVisibility field of the returned descriptor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DescriptorBuilderImpl()
public DescriptorBuilderImpl(java.lang.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(java.lang.String name)
throws java.lang.IllegalArgumentException
DescriptorBuilder
named in interface DescriptorBuildername - The name to be associated with this Descriptor
java.lang.IllegalArgumentException - if there is more than one name on the predicate
public DescriptorBuilder to(java.lang.Class<?> contract)
throws java.lang.IllegalArgumentException
DescriptorBuilder
to in interface DescriptorBuildercontract - A class that is annotated with Contract to
be associated with this Descriptor
java.lang.IllegalArgumentException - on failures
public DescriptorBuilder to(java.lang.String contract)
throws java.lang.IllegalArgumentException
DescriptorBuilder
to in interface DescriptorBuildercontract - The fully qualified name of a class that is annotated with Contract.
java.lang.IllegalArgumentException - on failures
public DescriptorBuilder in(java.lang.Class<? extends java.lang.annotation.Annotation> scope)
throws java.lang.IllegalArgumentException
DescriptorBuilder
in in interface DescriptorBuilderscope - The class of the scope this descriptor is to have.
java.lang.IllegalArgumentException - If in is called more than once
public DescriptorBuilder in(java.lang.String scope)
throws java.lang.IllegalArgumentException
DescriptorBuilder
in in interface DescriptorBuilderscope - The fully qualified class name of the scope this predicate is to have.
java.lang.IllegalArgumentException - If in is called more than once
public DescriptorBuilder qualifiedBy(java.lang.annotation.Annotation annotation)
throws java.lang.IllegalArgumentException
DescriptorBuilder
qualifiedBy in interface DescriptorBuilderannotation - The annotation to be associated with this descriptor
java.lang.IllegalArgumentException - on failures
public DescriptorBuilder qualifiedBy(java.lang.String annotation)
throws java.lang.IllegalArgumentException
DescriptorBuilder
qualifiedBy in interface DescriptorBuilderannotation - The fully qualified class name of an annotation to be
associated with this descriptor
java.lang.IllegalArgumentException - on failures
public DescriptorBuilder has(java.lang.String key,
java.lang.String value)
throws java.lang.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)
java.lang.IllegalArgumentException
public DescriptorBuilder has(java.lang.String key,
java.util.List<java.lang.String> values)
throws java.lang.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)
java.lang.IllegalArgumentExceptionpublic DescriptorBuilder ofRank(int rank)
DescriptorBuilder
ofRank in interface DescriptorBuilderrank - The rank to be associated with this descriptor.
public DescriptorBuilder proxy()
DescriptorBuilder
proxy in interface DescriptorBuilderpublic DescriptorBuilder proxy(boolean forceProxy)
DescriptorBuilder
proxy in interface DescriptorBuilderforceProxy - if true then this descriptor will be proxied,
if false then this descriptor will NOT be proxied
public DescriptorBuilder localOnly()
DescriptorBuilder
localOnly in interface DescriptorBuilderpublic DescriptorBuilder visibility(DescriptorVisibility visibility)
DescriptorBuilder
visibility in interface DescriptorBuildervisibility - The non-null visibility that this descriptor should take
public DescriptorBuilder andLoadWith(HK2Loader loader)
throws java.lang.IllegalArgumentException
DescriptorBuilder
andLoadWith in interface DescriptorBuilderloader - The loader to use with this descriptor
java.lang.IllegalArgumentException - if the HK2Loader is set non-null more than once
public DescriptorImpl build()
throws java.lang.IllegalArgumentException
DescriptorBuilder
build in interface DescriptorBuilderjava.lang.IllegalArgumentException - if the built descriptor is invalid
public FactoryDescriptors buildFactory(java.lang.String factoryScope)
throws java.lang.IllegalArgumentException
DescriptorBuilder
buildFactory in interface DescriptorBuilderfactoryScope - The scope the factory service itself is in.
java.lang.IllegalArgumentException - if the built descriptor is invalid
public FactoryDescriptors buildFactory()
throws java.lang.IllegalArgumentException
DescriptorBuilder
buildFactory in interface DescriptorBuilderjava.lang.IllegalArgumentException - if the built descriptor is invalid
public FactoryDescriptors buildFactory(java.lang.Class<? extends java.lang.annotation.Annotation> factoryScope)
throws java.lang.IllegalArgumentException
DescriptorBuilder
buildFactory in interface DescriptorBuilderfactoryScope - The scope the factory service itself is in. If this is null the
PerLookup scope will be used
java.lang.IllegalArgumentException - if the built descriptor is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||