Package joptsimple

Class NoArgumentOptionSpec

java.lang.Object
joptsimple.AbstractOptionSpec<Void>
joptsimple.NoArgumentOptionSpec
All Implemented Interfaces:
OptionDescriptor, OptionSpec<Void>
Direct Known Subclasses:
OptionSpecBuilder

class NoArgumentOptionSpec extends AbstractOptionSpec<Void>
A specification for an option that does not accept arguments.
  • Constructor Details

    • NoArgumentOptionSpec

      NoArgumentOptionSpec(String option)
    • NoArgumentOptionSpec

      NoArgumentOptionSpec(List<String> options, String description)
  • Method Details

    • handleOption

      void handleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument)
      Specified by:
      handleOption in class AbstractOptionSpec<Void>
    • acceptsArguments

      public boolean acceptsArguments()
      Description copied from interface: OptionDescriptor
      Does this option accept arguments?
      Returns:
      whether the option accepts arguments
    • requiresArgument

      public boolean requiresArgument()
      Description copied from interface: OptionDescriptor
      Does this option require an argument?
      Returns:
      whether the option requires an argument
    • isRequired

      public boolean isRequired()
      Description copied from interface: OptionDescriptor
      Is this option required on a command line?
      Returns:
      whether the option is required
    • argumentDescription

      public String argumentDescription()
      Description copied from interface: OptionDescriptor
      Gives a short description of the option's argument.
      Returns:
      a description for the option's argument
    • argumentTypeIndicator

      public String argumentTypeIndicator()
      Description copied from interface: OptionDescriptor
      Gives an indication of the expected type of the option's argument.
      Returns:
      a description for the option's argument type
    • convert

      protected Void convert(String argument)
      Specified by:
      convert in class AbstractOptionSpec<Void>
    • defaultValues

      public List<Void> defaultValues()
      Description copied from interface: OptionDescriptor
      What values will the option take if none are specified on the command line?
      Returns:
      any default values for the option