Annotation Interface ShellMethod


@Retention(RUNTIME) @Target(METHOD) @Documented @Reflective public @interface ShellMethod
Used to mark a method as invokable via Spring Shell.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The command group which this command belongs to.
    Defines interaction mode for a command as a hint when command should be available.
    The name(s) by which this method can be invoked via Spring Shell.
    The prefix to use for assigning parameters by name.
    A description for the command.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The default value for group(), meaning that the group will be inherited from the explicit value set on the containing element (class then package) or ultimately inferred.
  • Field Details

    • INHERITED

      static final String INHERITED
      The default value for group(), meaning that the group will be inherited from the explicit value set on the containing element (class then package) or ultimately inferred.
      See Also:
  • Element Details

    • key

      String[] key
      The name(s) by which this method can be invoked via Spring Shell. If not specified, the actual method name will be used (turning camelCase humps into "-").
      Returns:
      explicit command name(s) to use
      Default:
      {}
    • value

      String value
      A description for the command. Should not contain any formatting (e.g. html) characters and would typically start with a capital letter and end with a dot.
      Returns:
      short description of what the command does
      Default:
      ""
    • prefix

      String prefix
      The prefix to use for assigning parameters by name.
      Returns:
      prefix to use when not specified as part of the parameter annotation
      Default:
      "--"
    • group

      String group
      The command group which this command belongs to. The command group is used when printing a list of commands to group related commands. By default, group is first looked up from owning class then package, and if not explicitly set, is inferred from class name.
      Returns:
      name of the command group
      Default:
      ""
    • interactionMode

      InteractionMode interactionMode
      Defines interaction mode for a command as a hint when command should be available. For example presense of some commands doesn't make sense if shell is running as non-interactive mode and vice versa. Defaults to InteractionMode.ALL
      Returns:
      interaction mode
      Default:
      ALL