java.lang.Object
io.helidon.inject.tools.AbstractCreator
io.helidon.inject.tools.ActivatorCreatorDefault
- All Implemented Interfaces:
Weighted
,ActivatorCreator
,Comparable<Weighted>
@Singleton
public class ActivatorCreatorDefault
extends AbstractCreator
implements ActivatorCreator, Weighted
Responsible for building all di related collateral for a module, including:
- The
ServiceProvider
for each service type implementation passed in. - The
Activator
andDeActivator
for each service type implementation passed in. - The
ModuleComponent
for the aggregate service provider bindings for the same set of service type names. - The module-info as appropriate for the above set of services (and contracts).
- The /META-INF/services entries as appropriate.
GeneralCreatorRequestBlueprint.codeGenPaths()
for details.-
Field Summary
FieldsFields inherited from class io.helidon.inject.tools.AbstractCreator
DEFAULT_SOURCE, DEFAULT_TARGET
Fields inherited from interface io.helidon.common.Weighted
DEFAULT_WEIGHT
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.this is a Java ServiceLoader implementation and the constructor should not be used directly -
Method Summary
Modifier and TypeMethodDescriptionio.helidon.inject.tools.InterceptorCreatorResponse
codegenInterceptors
(io.helidon.inject.tools.CodeGenInterceptorRequest request) Generates just the interceptors.static Optional
<io.helidon.inject.tools.ActivatorCreatorCodeGen> Creates a payload given the batch of services to process.static io.helidon.inject.tools.ActivatorCreatorRequest
createActivatorCreatorRequest
(ServicesToProcess servicesToProcess, io.helidon.inject.tools.ActivatorCreatorCodeGen codeGen, io.helidon.inject.tools.ActivatorCreatorConfigOptions configOptions, CodeGenFiler filer, boolean throwIfError) Create a request based upon the contents of services to processor.io.helidon.inject.tools.ActivatorCreatorResponse
createModuleActivators
(io.helidon.inject.tools.ActivatorCreatorRequest req) Used during annotation processing in compile time to automatically generateActivator
's and optionally an aggregatingModuleComponent
for those activators.toActivatorImplTypeName
(TypeName serviceTypeName) Generates the would-be implementation type name that will be generated ifActivatorCreator.createModuleActivators(ActivatorCreatorRequest)
were to be called on this creator.static io.helidon.inject.api.ServiceInfoBasics
toServiceInfo
(TypeName serviceTypeName, io.helidon.inject.tools.ActivatorCreatorCodeGen codeGen) Creates service info from the service type name and the activator create codegen request.
-
Field Details
-
INNER_ACTIVATOR_CLASS_NAME
The suffix for activator class name.- See Also:
-
-
Constructor Details
-
ActivatorCreatorDefault
Deprecated.this is a Java ServiceLoader implementation and the constructor should not be used directlyService loader based constructor.
-
-
Method Details
-
createActivatorCreatorCodeGen
public static Optional<io.helidon.inject.tools.ActivatorCreatorCodeGen> createActivatorCreatorCodeGen(ServicesToProcess services) Creates a payload given the batch of services to process.- Parameters:
services
- the services to process- Returns:
- the payload, or empty if unable or nothing to process
-
createActivatorCreatorRequest
public static io.helidon.inject.tools.ActivatorCreatorRequest createActivatorCreatorRequest(ServicesToProcess servicesToProcess, io.helidon.inject.tools.ActivatorCreatorCodeGen codeGen, io.helidon.inject.tools.ActivatorCreatorConfigOptions configOptions, CodeGenFiler filer, boolean throwIfError) Create a request based upon the contents of services to processor.- Parameters:
servicesToProcess
- the batch being processedcodeGen
- the code gen requestconfigOptions
- the config optionsfiler
- the filerthrowIfError
- fail on error?- Returns:
- the activator request instance
-
toServiceInfo
public static io.helidon.inject.api.ServiceInfoBasics toServiceInfo(TypeName serviceTypeName, io.helidon.inject.tools.ActivatorCreatorCodeGen codeGen) Creates service info from the service type name and the activator create codegen request.- Parameters:
serviceTypeName
- the service type namecodeGen
- the code gen request- Returns:
- the service info
-
createModuleActivators
public io.helidon.inject.tools.ActivatorCreatorResponse createModuleActivators(io.helidon.inject.tools.ActivatorCreatorRequest req) throws ToolsException Description copied from interface:ActivatorCreator
Used during annotation processing in compile time to automatically generateActivator
's and optionally an aggregatingModuleComponent
for those activators.- Specified by:
createModuleActivators
in interfaceActivatorCreator
- Parameters:
req
- the request for what to generate- Returns:
- the response result for the create operation
- Throws:
ToolsException
-
codegenInterceptors
public io.helidon.inject.tools.InterceptorCreatorResponse codegenInterceptors(io.helidon.inject.tools.CodeGenInterceptorRequest request) Description copied from interface:ActivatorCreator
Generates just the interceptors.- Specified by:
codegenInterceptors
in interfaceActivatorCreator
- Parameters:
request
- the request for what to generate- Returns:
- the response result for the create operation
-
toActivatorImplTypeName
Description copied from interface:ActivatorCreator
Generates the would-be implementation type name that will be generated ifActivatorCreator.createModuleActivators(ActivatorCreatorRequest)
were to be called on this creator.- Specified by:
toActivatorImplTypeName
in interfaceActivatorCreator
- Parameters:
serviceTypeName
- the service/activator type name of the developer provided service type.- Returns:
- the code generated implementation type name that would be code generated
-