Top Inners Fields Constructors Methods
org.glassfish.hk2.internal

public Class ActiveDescriptorBuilderImpl

extends Object
implements ActiveDescriptorBuilder
Class Inheritance
All Implemented Interfaces
org.glassfish.hk2.utilities.ActiveDescriptorBuilder
Imports
java.lang.annotation.Annotation, java.lang.reflect.Type, java.util.Collections, .HashMap, .HashSet, .List, .Map, .Set, jakarta.inject.Named, org.glassfish.hk2.api.DescriptorType, .DescriptorVisibility, .HK2Loader, .PerLookup, .ServiceHandle, org.glassfish.hk2.utilities.AbstractActiveDescriptor, .ActiveDescriptorBuilder

Author
jwells

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private String
private final HashSet<Type>
private final Class<?>
private Type
private HK2Loader
private final HashMap<String, List<String>>
private String
private Boolean
private Boolean
private final HashSet<Annotation>
private int
private Class<? extends Annotation>
private Annotation
private DescriptorVisibility

Constructor Summary

AccessConstructor and Description
public
ActiveDescriptorBuilderImpl(Class<?>
The implementation class (may be null)
implementation
)

constructor with the impl class

Method Summary

Modifier and TypeMethod and Description
public ActiveDescriptorBuilder
analyzeWith(String serviceName)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.analyzeWith.

Call this if the descriptor should be analyzed with the org.glassfish.hk2.api.ClassAnalyzer service of the given name

public ActiveDescriptorBuilder
andLoadWith(HK2Loader loader)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.andLoadWith.

Call this if this descriptor should be loaded with the given HK2Loader

public ActiveDescriptorBuilder
asType(Type t)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.asType.

Call this if the parameterized type of the implementation class is known.

public <T> AbstractActiveDescriptor<T>
build()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.build.

Generates a descriptor that can be used in binding operations

public <T> AbstractActiveDescriptor<T>
buildFactory()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.buildFactory.

Deprecated

Generates a descriptor that can be used in binding operations that describes a factorys provide method

public <T> AbstractActiveDescriptor<T>
buildProvideMethod()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.buildProvideMethod.

Generates a descriptor that can be used in binding operations that describes a factorys provide method

public ActiveDescriptorBuilder
has(String key, String value)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.has.

An instance of data to be associated with this descriptor

public ActiveDescriptorBuilder
has(String key, List<String> values)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.has.

An instance of data to be associated with this descriptor

public ActiveDescriptorBuilder
in(Annotation scopeAnnotation)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.in.

A scope to be associated with this descriptor object.

public ActiveDescriptorBuilder
in(Class<? extends Annotation> scope)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.in.

A scope to be associated with this descriptor object.

public ActiveDescriptorBuilder
localOnly()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.localOnly.

This will cause the descriptorVisibility field of the returned descriptor to return LOCAL

public ActiveDescriptorBuilder
named(String name)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.named.

The name for this descriptor object.

public ActiveDescriptorBuilder
ofRank(int rank)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.ofRank.

The rank to be associated with this descriptor.

public ActiveDescriptorBuilder
proxy()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxy.

This will cause the isProxiable field of the returned descriptor to return true (it will force this descriptor to use proxies).

public ActiveDescriptorBuilder
proxy(boolean forceProxy)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxy.

This will cause the isProxiable field of the returned descriptor to return the given value.

public ActiveDescriptorBuilder
proxyForSameScope()

Implements org.glassfish.hk2.utilities.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).

public ActiveDescriptorBuilder
proxyForSameScope(boolean forceProxyForSameScope)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxyForSameScope.

This will cause the isProxyForSameScope field of the returned descriptor to return the given value.

public ActiveDescriptorBuilder
qualifiedBy(Annotation annotation)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.qualifiedBy.

A qualifier to be associated with this descriptor object

public ActiveDescriptorBuilder
to(Type contract)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.to.

A contract to be associated with this descriptor object.

public ActiveDescriptorBuilder
visibility(DescriptorVisibility visibility)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.visibility.

This will set the descriptorVisibility field of the returned descriptor

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classAnalysisNameback to summary
private String classAnalysisName
contractsback to summary
private final HashSet<Type> contracts
implementationback to summary
private final Class<?> implementation
implementationTypeback to summary
private Type implementationType
loaderback to summary
private HK2Loader loader
metadatasback to summary
private final HashMap<String, List<String>> metadatas
nameback to summary
private String name
proxyback to summary
private Boolean proxy
proxyForSameScopeback to summary
private Boolean proxyForSameScope
qualifiersback to summary
private final HashSet<Annotation> qualifiers
rankback to summary
private int rank
scopeback to summary
private Class<? extends Annotation> scope
scopeAnnotationback to summary
private Annotation scopeAnnotation
visibilityback to summary
private DescriptorVisibility visibility

Constructor Detail

ActiveDescriptorBuilderImplback to summary
public ActiveDescriptorBuilderImpl(Class<?> implementation)

constructor with the impl class

Parameters
implementation:Class<?>

The implementation class (may be null)

Method Detail

analyzeWithback to summary
public ActiveDescriptorBuilder analyzeWith(String serviceName)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.analyzeWith.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.analyzeWith.

Call this if the descriptor should be analyzed with the org.glassfish.hk2.api.ClassAnalyzer service of the given name

andLoadWithback to summary
public ActiveDescriptorBuilder andLoadWith(HK2Loader loader) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.andLoadWith.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.andLoadWith.

Call this if this descriptor should be loaded with the given HK2Loader

Annotations
@Override
Exceptions
IllegalArgumentException:
if the HK2Loader is set non-null more than once
asTypeback to summary
public ActiveDescriptorBuilder asType(Type t)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.asType.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.asType.

Call this if the parameterized type of the implementation class is known. This may be called with any Type, but only a ParameterizedType based on the implementationClass will work

Annotations
@Override
buildback to summary
public <T> AbstractActiveDescriptor<T> build() throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.build.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.build.

Generates a descriptor that can be used in binding operations

Annotations
@Override
Exceptions
IllegalArgumentException:
if the built descriptor is invalid
buildFactoryback to summary
public <T> AbstractActiveDescriptor<T> buildFactory() throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.buildFactory.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.buildFactory.

Deprecated

Generates a descriptor that can be used in binding operations that describes a factorys provide method

Annotations
@Override
@Deprecated
Exceptions
IllegalArgumentException:
if the built descriptor is invalid
buildProvideMethodback to summary
public <T> AbstractActiveDescriptor<T> buildProvideMethod() throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.buildProvideMethod.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.buildProvideMethod.

Generates a descriptor that can be used in binding operations that describes a factorys provide method

Annotations
@Override
Exceptions
IllegalArgumentException:
if the built descriptor is invalid
hasback to summary
public ActiveDescriptorBuilder has(String key, String value) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.has.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.has.

An instance of data to be associated with this descriptor

Annotations
@Override
hasback to summary
public ActiveDescriptorBuilder has(String key, List<String> values) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.has.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.has.

An instance of data to be associated with this descriptor

Annotations
@Override
inback to summary
public ActiveDescriptorBuilder in(Annotation scopeAnnotation) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.in.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.in.

A scope to be associated with this descriptor object. Note that at the current time a descriptor can only have one scope, hence this method will throw an IllegalArgumentException if in is called more than once.

Annotations
@Override
Exceptions
IllegalArgumentException:
If in is called more than once
inback to summary
public ActiveDescriptorBuilder in(Class<? extends Annotation> scope) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.in.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.in.

A scope to be associated with this descriptor object. Note that at the current time a descriptor can only have one scope, hence this method will throw an IllegalArgumentException if in is called more than once.

Annotations
@Override
Exceptions
IllegalArgumentException:
If in is called more than once
localOnlyback to summary
public ActiveDescriptorBuilder localOnly()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.localOnly.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.localOnly.

This will cause the descriptorVisibility field of the returned descriptor to return LOCAL

Annotations
@Override
namedback to summary
public ActiveDescriptorBuilder named(String name) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.named.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.named.

The name for this descriptor object. Note that at the current time a descriptor can only have one name, hence this method will throw an IllegalArgumentException if named is called more than once.

Annotations
@Override
Exceptions
IllegalArgumentException:
if there is more than one name on the predicate
ofRankback to summary
public ActiveDescriptorBuilder ofRank(int rank)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.ofRank.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.ofRank.

The rank to be associated with this descriptor. The last rank bound wins

Annotations
@Override
proxyback to summary
public ActiveDescriptorBuilder proxy()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxy.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxy.

This will cause the isProxiable field of the returned descriptor to return true (it will force this descriptor to use proxies).

Annotations
@Override
proxyback to summary
public ActiveDescriptorBuilder proxy(boolean forceProxy)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxy.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxy.

This will cause the isProxiable field of the returned descriptor to return the given value.

Annotations
@Override
proxyForSameScopeback to summary
public ActiveDescriptorBuilder proxyForSameScope()

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxyForSameScope.

Doc from org.glassfish.hk2.utilities.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).

Annotations
@Override
proxyForSameScopeback to summary
public ActiveDescriptorBuilder proxyForSameScope(boolean forceProxyForSameScope)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxyForSameScope.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.proxyForSameScope.

This will cause the isProxyForSameScope field of the returned descriptor to return the given value.

Annotations
@Override
qualifiedByback to summary
public ActiveDescriptorBuilder qualifiedBy(Annotation annotation) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.qualifiedBy.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.qualifiedBy.

A qualifier to be associated with this descriptor object

Annotations
@Override
Exceptions
IllegalArgumentException:
on failures
toback to summary
public ActiveDescriptorBuilder to(Type contract) throws IllegalArgumentException

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.to.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.to.

A contract to be associated with this descriptor object.

Annotations
@Override
Exceptions
IllegalArgumentException:
on failures
visibilityback to summary
public ActiveDescriptorBuilder visibility(DescriptorVisibility visibility)

Implements org.glassfish.hk2.utilities.ActiveDescriptorBuilder.visibility.

Doc from org.glassfish.hk2.utilities.ActiveDescriptorBuilder.visibility.

This will set the descriptorVisibility field of the returned descriptor

Annotations
@Override
org.glassfish.hk2.internal back to summary

private Class ActiveDescriptorBuilderImpl.BuiltActiveDescriptor<T>

extends AbstractActiveDescriptor<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Class<?>
private Type
private static final long

Constructor Summary

AccessConstructor and Description
public
BuiltActiveDescriptor()

For serialization

private
BuiltActiveDescriptor(Class<?> implementationClass, Set<Type> advertisedContracts, Annotation scopeAnnotation, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorType descriptorType, DescriptorVisibility descriptorVisibility, int ranking, Boolean proxy, Boolean proxyForSameScope, String classAnalysisName, Map<String, List<String>> metadata, HK2Loader loader, Type implementationType)

Method Summary

Modifier and TypeMethod and Description
public T
create(ServiceHandle<?> root)

Implements org.glassfish.hk2.api.ActiveDescriptor.create.

Creates an instance of the ActiveDescriptor.

public Class<?>
getImplementationClass()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationClass.

The implementation class that should be used to generate new instances of this descriptor.

public Type
getImplementationType()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationType.

If known the Type of the implementation.

public void
Inherited from org.glassfish.hk2.utilities.AbstractActiveDescriptor:
addContractTypeaddQualifierAnnotationdisposeequalsgetCachegetContractTypesgetFactoryLocatorIdgetFactoryServiceIdgetInjecteesgetQualifierAnnotationsgetScopeAnnotationgetScopeAsAnnotationhashCodeisCacheSetisReifiedreleaseCacheremoveContractTyperemoveQualifierAnnotationsetCachesetFactoryIdsetNamesetReifiedsetScopeAnnotationsetScopeAsAnnotation

Field Detail

implementationClassback to summary
private Class<?> implementationClass
implementationTypeback to summary
private Type implementationType
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.glassfish.hk2.utilities.AbstractActiveDescriptor.serialVersionUID.

For serialization

Constructor Detail

BuiltActiveDescriptorback to summary
public BuiltActiveDescriptor()

For serialization

Annotations
@SuppressWarnings:unused
BuiltActiveDescriptorback to summary
private BuiltActiveDescriptor(Class<?> implementationClass, Set<Type> advertisedContracts, Annotation scopeAnnotation, Class<? extends Annotation> scope, String name, Set<Annotation> qualifiers, DescriptorType descriptorType, DescriptorVisibility descriptorVisibility, int ranking, Boolean proxy, Boolean proxyForSameScope, String classAnalysisName, Map<String, List<String>> metadata, HK2Loader loader, Type implementationType)

Method Detail

createback to summary
public T create(ServiceHandle<?> root)

Implements org.glassfish.hk2.api.ActiveDescriptor.create.

Doc from org.glassfish.hk2.api.ActiveDescriptor.create.

Creates an instance of the ActiveDescriptor. All of the Injectee's must be created prior to instantiation, and associated with the ExtendedProvider so that they can be destroyed properly

Annotations
@Override
getImplementationClassback to summary
public Class<?> getImplementationClass()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationClass.

Doc from org.glassfish.hk2.api.ActiveDescriptor.getImplementationClass.

The implementation class that should be used to generate new instances of this descriptor.

If the class returned is a Factory, then the factory is used to create instances. In this case the system will get an instance of the factory and use it to create the instances

Annotations
@Override
getImplementationTypeback to summary
public Type getImplementationType()

Implements org.glassfish.hk2.api.ActiveDescriptor.getImplementationType.

Doc from org.glassfish.hk2.api.ActiveDescriptor.getImplementationType.

If known the Type of the implementation. If unknown will return the same as getImplementationClass()

Annotations
@Override
setImplementationTypeback to summary
public void setImplementationType(Type t)

Overrides org.glassfish.hk2.utilities.AbstractActiveDescriptor.setImplementationType.

Annotations
@Override