Package io.vertx.core.spi.launcher
Class DefaultCommandFactory<C extends Command>
- java.lang.Object
-
- io.vertx.core.spi.launcher.DefaultCommandFactory<C>
-
- All Implemented Interfaces:
CommandFactory<C>
public class DefaultCommandFactory<C extends Command> extends Object implements CommandFactory<C>
Default implementation ofCommandFactory
. This implementation defines theCLI
from the givenCommand
implementation (by reading the annotation). Then,Command
instance are created by calling an empty constructor on the givenCommand
implementation.- Author:
- Clement Escoffier
-
-
Constructor Summary
Constructors Constructor Description DefaultCommandFactory(Class<C> clazz)
Deprecated.Please useDefaultCommandFactory(Class, Supplier)
DefaultCommandFactory(Class<C> clazz, java.util.function.Supplier<C> supplier)
Creates a newCommandFactory
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description C
create(CommandLine cl)
CLI
define()
Creates a newCLI
instance.
-
-
-
Constructor Detail
-
DefaultCommandFactory
@Deprecated public DefaultCommandFactory(Class<C> clazz)
Deprecated.Please useDefaultCommandFactory(Class, Supplier)
Creates a newCommandFactory
.- Parameters:
clazz
- theCommand
implementation
-
-
Method Detail
-
create
public C create(CommandLine cl)
- Specified by:
create
in interfaceCommandFactory<C extends Command>
- Returns:
- a new instance of the command by invoking the default constructor of the given class.
-
define
public CLI define()
Description copied from interface:CommandFactory
Creates a newCLI
instance.- Specified by:
define
in interfaceCommandFactory<C extends Command>
- Returns:
- the
CLI
instance by reading the annotation.
-
-