Interface KotlinCodeGenerationContext
-
- All Implemented Interfaces:
public interface KotlinCodeGenerationContext<SELF extends KotlinCodeGenerationContext<SELF>>
Context used for SPI execution, providing additional information that is not transported via the
input
work item. Might hold mutable state shared by strategies and processors to transport data on the fly.Required because all spi-instances have to be generated via default-constructor, so all state data we would normally store in a property has to be passed to every function call.
Hint: for implementing a concrete context, use the io.toolisticon.kotlin.generation.spi.context.KotlinCodeGenerationContextBase.
-
-
Method Summary
Modifier and Type Method Description <STRATEGY extends KotlinCodeGenerationStrategy<CONTEXT, INPUT, SPEC>, CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Any, SPEC extends Any> List<STRATEGY>
strategies(KClass<STRATEGY> strategyType)
Convenience access to io.toolisticon.kotlin.generation.spi.strategy.KotlinCodeGenerationStrategyList.filterIsInstance. <PROCESSOR extends KotlinCodeGenerationProcessor<CONTEXT, INPUT, BUILDER>, CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Any, BUILDER extends Any> List<PROCESSOR>
processors(KClass<PROCESSOR> processorType)
Convenience access to io.toolisticon.kotlin.generation.spi.processor.KotlinCodeGenerationProcessorList.filterIsInstance. abstract KClass<SELF>
getContextType()
SELF type of the context implementation, used to verify against io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi.contextType. abstract KotlinCodeGenerationSpiRegistry
getRegistry()
The registry holding strategies and processors so implementations can nest calls to other instances. -
-
Method Detail
-
strategies
<STRATEGY extends KotlinCodeGenerationStrategy<CONTEXT, INPUT, SPEC>, CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Any, SPEC extends Any> List<STRATEGY> strategies(KClass<STRATEGY> strategyType)
Convenience access to io.toolisticon.kotlin.generation.spi.strategy.KotlinCodeGenerationStrategyList.filterIsInstance.
-
processors
<PROCESSOR extends KotlinCodeGenerationProcessor<CONTEXT, INPUT, BUILDER>, CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Any, BUILDER extends Any> List<PROCESSOR> processors(KClass<PROCESSOR> processorType)
Convenience access to io.toolisticon.kotlin.generation.spi.processor.KotlinCodeGenerationProcessorList.filterIsInstance.
-
getContextType
abstract KClass<SELF> getContextType()
SELF type of the context implementation, used to verify against io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi.contextType.
-
getRegistry
abstract KotlinCodeGenerationSpiRegistry getRegistry()
The registry holding strategies and processors so implementations can nest calls to other instances.
-
-
-
-