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 theCLIfrom the givenCommandimplementation (by reading the annotation). Then,Commandinstance are created by calling an empty constructor on the givenCommandimplementation.- Author:
- Clement Escoffier
-
-
Constructor Summary
Constructors Constructor Description DefaultCommandFactory(Class<C> clazz)Deprecated.Please useDefaultCommandFactory(Class, Supplier)DefaultCommandFactory(Class<C> clazz, Supplier<C> supplier)Creates a newCommandFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Ccreate(CommandLine cl)CLIdefine()Creates a newCLIinstance.
-
-
-
Constructor Detail
-
DefaultCommandFactory
@Deprecated public DefaultCommandFactory(Class<C> clazz)
Deprecated.Please useDefaultCommandFactory(Class, Supplier)Creates a newCommandFactory.- Parameters:
clazz- theCommandimplementation
-
-
Method Detail
-
create
public C create(CommandLine cl)
- Specified by:
createin 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:CommandFactoryCreates a newCLIinstance.- Specified by:
definein interfaceCommandFactory<C extends Command>- Returns:
- the
CLIinstance by reading the annotation.
-
-