Interface IUsageFormatter

All Known Implementing Classes:
DefaultUsageFormatter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IUsageFormatter
Interface which have to be implemented by any usage formatter.
Since:
1.0.0 - 2022-05-05
Author:
David M., Markus S.
  • Method Summary

    Modifier and Type
    Method
    Description
    format(List<CmdArgOption<?>> _options, String _longOptPrefix, String _shortOptPrefix, String _mainClassName)
    Called to retrieve a formatted usage output.
    static String
    Returns the simple class name of the topmost stack element which is not in our own package.
  • Method Details

    • format

      String format(List<CmdArgOption<?>> _options, String _longOptPrefix, String _shortOptPrefix, String _mainClassName)
      Called to retrieve a formatted usage output.

      Output should be properly formatted including line-feeds etc.

      Parameters:
      _options - registered options, maybe empty - never null
      _longOptPrefix - prefix for long options
      _shortOptPrefix - prefix for short options
      _mainClassName - main class name, maybe null
      Returns:
      formatted String
    • getMainClassName

      static String getMainClassName()
      Returns the simple class name of the topmost stack element which is not in our own package.
      Returns:
      simple class name