public class CommandScope extends Object
execute()
is called.
Named similarly to Scope
because they both define a self-contained unit of values, but this
scope is specific to a command rather than being a global scope.
Constructor and Description |
---|
CommandScope(String... commandName)
Creates a new scope for the given command.
|
Modifier and Type | Method and Description |
---|---|
<T> CommandScope |
addArgumentValue(CommandArgumentDefinition<T> argument,
T value)
Adds the given key/value pair to the stored argument data.
|
CommandScope |
addArgumentValue(String argument,
Object value)
Adds the given key/value pair to the stored argument data.
|
CommandResults |
execute()
Executes the command in this scope, and returns the results.
|
<T> T |
getArgumentValue(CommandArgumentDefinition<T> argument)
Convenience method for
getConfiguredValue(CommandArgumentDefinition) , returning ConfiguredValue.getValue() along with any
CommandArgumentDefinition.getValueConverter() applied |
CommandDefinition |
getCommand()
Returns the
CommandDefinition for the command in this scope. |
<T> ConfiguredValue<T> |
getConfiguredValue(CommandArgumentDefinition<T> argument)
Returns the detailed information about how an argument is set.
|
CommandScope |
setOutput(OutputStream outputStream)
Sets the output stream for this command.
|
public CommandScope(String... commandName) throws CommandExecutionException
CommandExecutionException
public CommandDefinition getCommand()
CommandDefinition
for the command in this scope.public CommandScope addArgumentValue(String argument, Object value)
for a type-safe version
public <T> CommandScope addArgumentValue(CommandArgumentDefinition<T> argument, T value)
public <T> ConfiguredValue<T> getConfiguredValue(CommandArgumentDefinition<T> argument)
addArgumentValue(String, Object)
, but will also check LiquibaseConfiguration
for settings of liquibase.command.${commandName(s)}.${argumentName} or liquibase.command.${argumentName}public <T> T getArgumentValue(CommandArgumentDefinition<T> argument)
getConfiguredValue(CommandArgumentDefinition)
, returning ConfiguredValue.getValue()
along with any
CommandArgumentDefinition.getValueConverter()
appliedpublic CommandScope setOutput(OutputStream outputStream)
public CommandResults execute() throws CommandExecutionException
CommandExecutionException
Copyright © 2021 Liquibase.org. All rights reserved.