Annotation Interface PromptArg


@Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface PromptArg
Configures a parameter of a Prompt method.

This annotation allows you to provide metadata about prompt arguments, such as names, descriptions, and whether they are required.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Default value for this argument when not provided.
    A human-readable description of the argument.
    The name of the argument.
    boolean
    Whether this parameter is required.
    A human-readable title for the argument.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant value for name() indicating that the annotated element's name should be used as-is.
  • Field Details

    • ELEMENT_NAME

      static final String ELEMENT_NAME
      Constant value for name() indicating that the annotated element's name should be used as-is.
      See Also:
  • Element Details

    • name

      String name
      The name of the argument.

      Each argument to a prompt must have a unique name.

      By default, the parameter name from the method signature will be used (requires compilation with the -parameters flag).

      Returns:
      the argument name
      Default:
      "<<element name>>"
    • title

      String title
      A human-readable title for the argument.

      This is a short, user-friendly display name for the argument.

      Returns:
      the argument title
      Default:
      ""
    • description

      String description
      A human-readable description of the argument.
      Returns:
      the argument description
      Default:
      ""
    • required

      boolean required
      Whether this parameter is required.

      A parameter is not required if:

      Otherwise, the parameter is required.

      Returns:
      false to make the parameter not required
      Default:
      true
    • defaultValue

      String defaultValue
      Default value for this argument when not provided.

      The value should be provided as a string and will be converted to the appropriate type by the framework implementation.

      Setting a default value causes the parameter to not be required, regardless of the value of required().

      Returns:
      the default value as a string
      Default:
      ""