Annotation Type GetOptOrdered


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface GetOptOrdered
    Annotation used to mark a field as an ordered argument. Ordered arguments are arguments which are not specified with a code/flag. They are simply specified in the order in which they appear in the command line.
    Author:
    John Dunlap
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      int order
      The index into the array of ordered arguments(not specified with a code/flag).
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String category
      The category in which the option should appear in the help message.
      Class<?> collectionType
      This is only necessary if the field is a collection.
      Class<? extends TypeConverter<?>> converter
      The parser to use for this option.
      String description
      The description of the option.
      boolean required
      True if the option requires a value.
    • Element Detail

      • order

        int order
        The index into the array of ordered arguments(not specified with a code/flag). This index is used to determine which orderd values are applied to which fields.
        Returns:
        The index into the array of ordered arguments.
      • required

        boolean required
        True if the option requires a value. If true and if a value is not available, an exception will be thrown.
        Returns:
        True if the option requires a value.
        Default:
        false
      • category

        String category
        The category in which the option should appear in the help message. This is used in the help message.
        Returns:
        The category of the option.
        Default:
        ""
      • description

        String description
        The description of the option. This is used in the help message.
        Returns:
        The description of the option.
        Default:
        ""
      • collectionType

        Class<?> collectionType
        This is only necessary if the field is a collection. In that case, this is the type of the objects which the collection will contain. This is necessary because of Java type erasure. Generics are not available at runtime.
        Returns:
        The type of the objects which the collection will contain.
        Default:
        java.lang.Object.class
      • converter

        Class<? extends TypeConverter<?>> converter
        The parser to use for this option. This is only necessary when the field type is not supported.
        Returns:
        The parser to use for this option.
        Default:
        pro.johndunlap.getopt.DefaultValueParser.class