Top Description Fields Constructors Methods
io.vertx.core.spi.launcher

public Class DefaultCommandFactory<C extends Command>

extends Object
implements CommandFactory<C extends Command>
Class Inheritance
All Implemented Interfaces
io.vertx.core.spi.launcher.CommandFactory
Known Direct Subclasses
io.vertx.core.impl.launcher.commands.BareCommandFactory, io.vertx.core.impl.launcher.commands.ListCommandFactory, io.vertx.core.impl.launcher.commands.RunCommandFactory, io.vertx.core.impl.launcher.commands.StartCommandFactory, io.vertx.core.impl.launcher.commands.StopCommandFactory, io.vertx.core.impl.launcher.commands.VersionCommandFactory
Imports
io.vertx.core.cli.CLI, .CommandLine, io.vertx.core.cli.annotations.CLIConfigurator, io.vertx.core.cli.impl.ReflectionUtils, java.util.function.Supplier

Default implementation of CommandFactory. This implementation defines the CLI from the given Command implementation (by reading the annotation). Then, Command instance are created by calling an empty constructor on the given Command implementation.
Author
Clement Escoffier

Field Summary

Modifier and TypeField and Description
private final Class<C>
private final Supplier<C>

Constructor Summary

AccessConstructor and Description
public
DefaultCommandFactory(Class<C>
the Command implementation
clazz
)

Creates a new CommandFactory.

public
DefaultCommandFactory(Class<C>
the Command implementation
clazz
,
Supplier<C>
the Command implementation
supplier
)

Creates a new CommandFactory.

Method Summary

Modifier and TypeMethod and Description
public C

Returns:

a new instance of the command by invoking the default constructor of the given class.
create
(CommandLine cl)

Implements io.vertx.core.spi.launcher.CommandFactory.create.

public CLI

Returns:

the CLI instance by reading the annotation.
define
()

Implements io.vertx.core.spi.launcher.CommandFactory.define.

Creates a new CLI instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clazzback to summary
private final Class<C> clazz
supplierback to summary
private final Supplier<C> supplier

Constructor Detail

DefaultCommandFactoryback to summary
public DefaultCommandFactory(Class<C> clazz)

Creates a new CommandFactory.

Parameters
clazz:Class<C>

the Command implementation

Annotations
@Deprecated
DefaultCommandFactoryback to summary
public DefaultCommandFactory(Class<C> clazz, Supplier<C> supplier)

Creates a new CommandFactory.

Parameters
clazz:Class<C>

the Command implementation

supplier:Supplier<C>

the Command implementation

Method Detail

createback to summary
public C create(CommandLine cl)

Implements io.vertx.core.spi.launcher.CommandFactory.create.

Returns:C

a new instance of the command by invoking the default constructor of the given class.

Annotations
@Override
defineback to summary
public CLI define()

Implements io.vertx.core.spi.launcher.CommandFactory.define.

Doc from io.vertx.core.spi.launcher.CommandFactory.define.

Creates a new CLI instance.

Returns:CLI

the CLI instance by reading the annotation.

Annotations
@Override