Package io.micronaut.starter.cli.command
Class CodeGenCommand
java.lang.Object
io.micronaut.starter.cli.command.BaseCommand
io.micronaut.starter.cli.command.CodeGenCommand
- All Implemented Interfaces:
ConsoleOutput
,Callable<Integer>
- Direct Known Subclasses:
CreateBeanCommand
,CreateClientCommand
,CreateCommandCommand
,CreateControllerCommand
,CreateGrpcServiceCommand
,CreateJmsConsumer
,CreateJmsProducer
,CreateJobCommand
,CreateKafkaListener
,CreateKafkaProducer
,CreateKeyPair
,CreateMqttPublisher
,CreateMqttSubscriber
,CreateNatsListener
,CreateNatsProducer
,CreateProtoServiceCommand
,CreateRabbitMQListener
,CreateRabbitMQProducer
,CreateRepositoryCommand
,CreateTestCommand
,CreateWebsocketClientCommand
,CreateWebsocketServerCommand
,DeactivateAccount
,FeatureDiffCommand
,UpdateCliConfigCommand
-
Field Summary
Modifier and TypeFieldDescriptionprotected io.micronaut.context.BeanContext
protected final CodeGenConfig
protected final ConsoleOutput
protected final io.micronaut.core.util.functional.ThrowingSupplier<OutputHandler,
IOException> protected boolean
Fields inherited from class io.micronaut.starter.cli.command.BaseCommand
commonOptions, spec
Fields inherited from interface io.micronaut.starter.io.ConsoleOutput
NOOP
-
Constructor Summary
ConstructorDescriptionCodeGenCommand
(CodeGenConfig config) CodeGenCommand
(CodeGenConfig config, io.micronaut.core.util.functional.ThrowingSupplier<OutputHandler, IOException> outputHandlerSupplier, ConsoleOutput consoleOutput) -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
applies()
void
protected <T extends CodeGenCommand>
TgetCommand
(Class<T> clazz) protected Project
getProject
(String name) protected TemplateRenderer
protected TemplateRenderer
getTemplateRenderer
(Project project) void
void
setBeanContext
(io.micronaut.context.BeanContext beanContext) void
Methods inherited from class io.micronaut.starter.cli.command.BaseCommand
errWriter, getOperatingSystem, getSpec, green, outWriter, red, showStacktrace, verbose
-
Field Details
-
config
-
overwrite
protected boolean overwrite -
outputHandlerSupplier
protected final io.micronaut.core.util.functional.ThrowingSupplier<OutputHandler,IOException> outputHandlerSupplier -
consoleOutput
-
beanContext
protected io.micronaut.context.BeanContext beanContext
-
-
Constructor Details
-
CodeGenCommand
-
CodeGenCommand
public CodeGenCommand(CodeGenConfig config, io.micronaut.core.util.functional.ThrowingSupplier<OutputHandler, IOException> outputHandlerSupplier, ConsoleOutput consoleOutput)
-
-
Method Details
-
setBeanContext
@Inject public void setBeanContext(io.micronaut.context.BeanContext beanContext) -
applies
public abstract boolean applies() -
getProject
-
getTemplateRenderer
- Throws:
IOException
-
getTemplateRenderer
- Throws:
IOException
-
getCommand
-
out
- Specified by:
out
in interfaceConsoleOutput
- Overrides:
out
in classBaseCommand
-
err
- Specified by:
err
in interfaceConsoleOutput
- Overrides:
err
in classBaseCommand
-
warning
- Specified by:
warning
in interfaceConsoleOutput
- Overrides:
warning
in classBaseCommand
-