java.lang.Object
io.helidon.pico.tools.AbstractCreator
io.helidon.pico.tools.DefaultActivatorCreator
- All Implemented Interfaces:
Weighted,ActivatorCreator,Comparable<Weighted>
@Singleton
public class DefaultActivatorCreator
extends AbstractCreator
implements ActivatorCreator, Weighted
Responsible for building all pico-di related collateral for a module, including:
- The
ServiceProviderfor each service type implementation passed in. - The
ActivatorandDeActivatorfor each service type implementation passed in. - The
Modulefor 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.
GeneralCreatorRequest.codeGenPaths() for details.-
Field Summary
Fields inherited from class io.helidon.pico.tools.AbstractCreator
DEFAULT_SOURCE, DEFAULT_TARGETFields 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 TypeMethodDescriptioncodegenInterceptors(GeneralCreatorRequest req, Map<TypeName, InterceptionPlan> interceptionPlans) Generates just the interceptors.static Optional<ActivatorCreatorCodeGen>Creates a payload given the batch of services to process.static ActivatorCreatorRequestcreateActivatorCreatorRequest(ServicesToProcess servicesToProcess, ActivatorCreatorCodeGen codeGen, ActivatorCreatorConfigOptions configOptions, CodeGenFiler filer, boolean throwIfError) Create a request based upon the contents of services to processor.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 ServiceInfoBasicstoServiceInfo(TypeName serviceTypeName, ActivatorCreatorCodeGen codeGen) Creates service info from the service type name and the activator create codegen request.
-
Constructor Details
-
DefaultActivatorCreator
Deprecated.this is a Java ServiceLoader implementation and the constructor should not be used directlyService loader based constructor.
-
-
Method Details
-
createModuleActivators
public ActivatorCreatorResponse createModuleActivators(ActivatorCreatorRequest req) throws ToolsException Description copied from interface:ActivatorCreatorUsed during annotation processing in compile time to automatically generateActivator's and optionally an aggregatingModulefor those activators.- Specified by:
createModuleActivatorsin interfaceActivatorCreator- Parameters:
req- the request for what to generate- Returns:
- the response result for the create operation
- Throws:
ToolsException
-
codegenInterceptors
public InterceptorCreatorResponse codegenInterceptors(GeneralCreatorRequest req, Map<TypeName, InterceptionPlan> interceptionPlans) Description copied from interface:ActivatorCreatorGenerates just the interceptors.- Specified by:
codegenInterceptorsin interfaceActivatorCreator- Parameters:
req- the request for what to generateinterceptionPlans- the interceptor plans- Returns:
- the response result for the create operation
-
createActivatorCreatorCodeGen
public static Optional<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 ActivatorCreatorRequest createActivatorCreatorRequest(ServicesToProcess servicesToProcess, ActivatorCreatorCodeGen codeGen, 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
-
toActivatorImplTypeName
Description copied from interface:ActivatorCreatorGenerates the would-be implementation type name that will be generated ifActivatorCreator.createModuleActivators(ActivatorCreatorRequest)were to be called on this creator.- Specified by:
toActivatorImplTypeNamein 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
-
toServiceInfo
public static ServiceInfoBasics toServiceInfo(TypeName serviceTypeName, 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
-