Class ActivatorCreatorDefault

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:
  1. The ServiceProvider for each service type implementation passed in.
  2. The Activator and DeActivator for each service type implementation passed in.
  3. The ModuleComponent for the aggregate service provider bindings for the same set of service type names.
  4. The module-info as appropriate for the above set of services (and contracts).
  5. The /META-INF/services entries as appropriate.
This API can also be used to only produce meta-information describing the model without the codegen option - see GeneralCreatorRequestBlueprint.codeGenPaths() for details.
  • Field Details

    • INNER_ACTIVATOR_CLASS_NAME

      public static final String INNER_ACTIVATOR_CLASS_NAME
      The suffix for activator class name.
      See Also:
  • Constructor Details

    • ActivatorCreatorDefault

      @Deprecated public ActivatorCreatorDefault()
      Deprecated.
      this is a Java ServiceLoader implementation and the constructor should not be used directly
      Service 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 processed
      codeGen - the code gen request
      configOptions - the config options
      filer - the filer
      throwIfError - 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 name
      codeGen - 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 generate Activator's and optionally an aggregating ModuleComponent for those activators.
      Specified by:
      createModuleActivators in interface ActivatorCreator
      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 interface ActivatorCreator
      Parameters:
      request - the request for what to generate
      Returns:
      the response result for the create operation
    • toActivatorImplTypeName

      public TypeName toActivatorImplTypeName(TypeName serviceTypeName)
      Description copied from interface: ActivatorCreator
      Generates the would-be implementation type name that will be generated if ActivatorCreator.createModuleActivators(ActivatorCreatorRequest) were to be called on this creator.
      Specified by:
      toActivatorImplTypeName in interface ActivatorCreator
      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