Class KotlinCodeGenerationStrategyBase
-
- All Implemented Interfaces:
-
io.toolisticon.kotlin.generation.WithTags,io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi,io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy,java.util.function.BiPredicate,kotlin.Comparable
public abstract class KotlinCodeGenerationStrategyBase<CONTEXT extends KotlinCodeGenerationContext<CONTEXT>, INPUT extends Object, SPEC extends Object> implements KotlinCodeGenerationStrategy<CONTEXT, INPUT, SPEC>
Abstract base implementation of KotlinCodeGenerationStrategy for convenience setting of generic types.
-
-
Method Summary
Modifier and Type Method Description StringgetName()The name that is used when the implementing class is listed in a META-INF/services/file.KClass<CONTEXT>getContextType()The type of the generic CONTEXT, used to filter relevant instances. KClass<INPUT>getInputType()The type of the generic INPUT, used to filter relevant instances. KClass<SPEC>getSpecType()The type of the created SPEC, used to filter relevant instances for execution. IntegergetOrder()Order is used to sort spi instances. abstract SPECinvoke(CONTEXT context, INPUT input)Implements the actual strategy logic to generate a spec from a given input, using context information. Booleantest(CONTEXT context, Object input)Checks if this strategy should be applied. StringtoString()-
Methods inherited from class io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationStrategy
execute -
Methods inherited from class io.toolisticon.kotlin.generation.spi.KotlinCodeGenerationSpi
compareTo, tag -
Methods inherited from class java.util.function.BiPredicate
and, negate, or -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getName
String getName()
The name that is used when the implementing class is listed in a
META-INF/services/file. Attention: SPI uses java naming, so inner classes have to be separated by$.
-
getContextType
KClass<CONTEXT> getContextType()
The type of the generic CONTEXT, used to filter relevant instances.
-
getInputType
KClass<INPUT> getInputType()
The type of the generic INPUT, used to filter relevant instances.
-
getSpecType
KClass<SPEC> getSpecType()
The type of the created SPEC, used to filter relevant instances for execution.
-
invoke
abstract SPEC invoke(CONTEXT context, INPUT input)
Implements the actual strategy logic to generate a spec from a given input, using context information.
- Parameters:
context- the context we are operating ininput- the concrete work item- Returns:
the generated spec
-
test
Boolean test(CONTEXT context, Object input)
Checks if this strategy should be applied.
- Parameters:
context- the context we are operating ininput- the concrete work item- Returns:
trueif this strategy should be applied,falseotherwise.
-
-
-
-