Class ListAllowedValuesCommand

java.lang.Object
dev.metaschema.cli.processor.command.AbstractTerminalCommand
dev.metaschema.cli.commands.ListAllowedValuesCommand
All Implemented Interfaces:
ICommand

public class ListAllowedValuesCommand extends AbstractTerminalCommand
A CLI command that lists allowed-values constraints for a Metaschema module, organized by the target node they apply to.

The output is produced in YAML format, showing each target location and the allowed-values constraints that apply to it, including constraint identifiers, allowed values, and source information.

  • Constructor Details

    • ListAllowedValuesCommand

      public ListAllowedValuesCommand()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: ICommand
      Get the name of the command.

      This name is used to call the command as a command line argument.

      Returns:
      the command's name
    • getDescription

      public String getDescription()
      Description copied from interface: ICommand
      Get a description of what the command does.

      This description is displayed in help output.

      Returns:
      the description
    • gatherOptions

      public Collection<? extends org.apache.commons.cli.Option> gatherOptions()
      Description copied from interface: ICommand
      Used to gather options directly associated with this command.
      Returns:
      the options
    • getExtraArguments

      public List<ExtraArgument> getExtraArguments()
      Description copied from interface: ICommand
      Get the non-option arguments.
      Returns:
      the arguments, or an empty list if there are no arguments
    • newExecutor

      public ICommandExecutor newExecutor(CallingContext callingContext, org.apache.commons.cli.CommandLine cmdLine)
      Description copied from interface: ICommand
      Create a new executor for this command.
      Parameters:
      callingContext - the context of the command execution
      cmdLine - the parsed command line details
      Returns:
      the executor
    • executeCommand

      protected void executeCommand(@NonNull CallingContext callingContext, @NonNull org.apache.commons.cli.CommandLine cmdLine) throws CommandExecutionException
      Execute the list allowed values command.
      Parameters:
      callingContext - information about the calling context
      cmdLine - the parsed command line details
      Throws:
      CommandExecutionException - if an error occurred while executing the command