Top Description Constructors Methods
io.vertx.core.cli.annotations

public Class CLIConfigurator

extends Object
Class Inheritance
Imports
io.vertx.core.cli.*, io.vertx.core.cli.impl.DefaultCLI, .ReflectionUtils, java.lang.reflect.Array, .Method, java.util.Collection, .LinkedHashSet, .List, .Set

Class responsible for defining CLI using annotations and injecting values extracted by the parser.
Author
Clement Escoffier

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Argument
private static <T> Object
private static Option
public static CLI

Returns:

the defined CLI.
define
(Class<?>
the CLI class
clazz
)

Creates an instance of the given class, and extracts the metadata from the given class.

private static Object
getArgumentValue(Method method, int index, CommandLine commandLine)

private static Object
getOptionValue(Method method, String name, CommandLine commandLine)

public static void
inject(CommandLine
the cli
cli
,
Object
the object to be injected
object
)

Injects the value in the annotated setter methods (Option and Argument.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CLIConfiguratorback to summary
public CLIConfigurator()

Method Detail

createArgumentback to summary
private static Argument createArgument(Method method)
Annotations
@SuppressWarnings:unchecked
createMultiValueContainerback to summary
private static <T> Object createMultiValueContainer(Method setter, List<T> values)
createOptionback to summary
private static Option createOption(Method method)
Annotations
@SuppressWarnings:unchecked
defineback to summary
public static CLI define(Class<?> clazz)

Creates an instance of the given class, and extracts the metadata from the given class.

Parameters
clazz:Class<?>

the CLI class

Returns:CLI

the defined CLI.

getArgumentValueback to summary
private static Object getArgumentValue(Method method, int index, CommandLine commandLine)
getOptionValueback to summary
private static Object getOptionValue(Method method, String name, CommandLine commandLine)
injectback to summary
public static void inject(CommandLine cli, Object object) throws CLIException

Injects the value in the annotated setter methods (Option and Argument.

Parameters
cli:CommandLine

the cli

object:Object

the object to be injected

Exceptions
CLIException:
if an injection issue occurred.