Package io.dropwizard.core.cli
Class CheckCommand<T extends Configuration>
- java.lang.Object
-
- io.dropwizard.core.cli.Command
-
- io.dropwizard.core.cli.ConfiguredCommand<T>
-
- io.dropwizard.core.cli.CheckCommand<T>
-
- Type Parameters:
T
- theConfiguration
subclass which is loaded from the configuration file
public class CheckCommand<T extends Configuration> extends ConfiguredCommand<T>
Parses and validates the application's configuration.
-
-
Constructor Summary
Constructors Constructor Description CheckCommand(Application<T> application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<T>
getConfigurationClass()
Returns theClass
of the configuration type.void
onError(Cli cli, net.sourceforge.argparse4j.inf.Namespace namespace, Throwable e)
Method is called if there is an issue parsing configuration, setting up the environment, or running the command itself.protected void
run(Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration)
Runs the command with the givenBootstrap
andConfiguration
.-
Methods inherited from class io.dropwizard.core.cli.ConfiguredCommand
addFileArgument, cleanup, cleanupAsynchronously, configure, getConfiguration, run
-
Methods inherited from class io.dropwizard.core.cli.Command
getDescription, getName
-
-
-
-
Constructor Detail
-
CheckCommand
public CheckCommand(Application<T> application)
-
-
Method Detail
-
getConfigurationClass
protected Class<T> getConfigurationClass()
Description copied from class:ConfiguredCommand
Returns theClass
of the configuration type.- Overrides:
getConfigurationClass
in classConfiguredCommand<T extends Configuration>
- Returns:
- the
Class
of the configuration type
-
run
protected void run(Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) throws Exception
Description copied from class:ConfiguredCommand
Runs the command with the givenBootstrap
andConfiguration
.- Specified by:
run
in classConfiguredCommand<T extends Configuration>
- Parameters:
bootstrap
- the bootstrapnamespace
- the parsed command line namespaceconfiguration
- the configuration object- Throws:
Exception
- if something goes wrong
-
onError
public void onError(Cli cli, net.sourceforge.argparse4j.inf.Namespace namespace, Throwable e)
Description copied from class:Command
Method is called if there is an issue parsing configuration, setting up the environment, or running the command itself. The default is printing the stacktrace to facilitate debugging, but can be customized per command.
-
-