Class PositionalParamSpec

java.lang.Object
com.codename1.cli.ArgSpec
com.codename1.cli.PositionalParamSpec

public final class PositionalParamSpec extends ArgSpec
The model of one positional parameter, written by the build from a CommandLine.Parameters.
  • Constructor Details

    • PositionalParamSpec

      public PositionalParamSpec(int slot, String index, String description, String paramLabel, boolean required, String arity, boolean multiple, String defaultValue, String split, boolean hidden)

      Creates the model of a positional parameter.

      Parameters
      • slot: the number the generated binding knows this parameter by

      • index: the positions it takes, as 0, 1..3 or 1..*

      • description: the help text

      • paramLabel: the placeholder printed for it, such as <file>

      • required: whether a command line without it is an error

      • arity: how many values it takes, or empty for the default

      • multiple: true when the field is an array or a list

      • defaultValue: the value used when it is absent, or null

      • split: a separator that splits one value into several, or null

      • hidden: whether it is left out of the help

  • Method Details

    • indexFrom

      public int indexFrom()
      The first position this parameter takes.
    • indexTo

      public int indexTo()
      The last position this parameter takes, or Integer.MAX_VALUE for an open range.