Class ParserMetadata<T>

java.lang.Object
com.github.rvesse.airline.model.ParserMetadata<T>

public class ParserMetadata<T> extends Object
Represents meta-data about the parser configuration
  • Field Details

    • DEFAULT_ARGUMENTS_SEPARATOR

      public static final String DEFAULT_ARGUMENTS_SEPARATOR
      Default separator used to separate arguments from options
      See Also:
    • allowAbbreviatedCommands

      private final boolean allowAbbreviatedCommands
    • allowAbbreviatedOptions

      private final boolean allowAbbreviatedOptions
    • aliasesOverrideBuiltIns

      private final boolean aliasesOverrideBuiltIns
    • aliasesMayChain

      private final boolean aliasesMayChain
    • optionParsers

      private final List<OptionParser<T>> optionParsers
    • aliases

      private final List<AliasMetadata> aliases
    • userAliases

      private final UserAliasesSource<T> userAliases
    • typeConverter

      private final TypeConverter typeConverter
    • commandFactory

      private final CommandFactory<T> commandFactory
    • argsSeparator

      private final String argsSeparator
    • flagNegationPrefix

      private final String flagNegationPrefix
    • errorHandler

      private final ParserErrorHandler errorHandler
    • forceBuiltInPrefix

      private final char forceBuiltInPrefix
    • compositionAnnotationClasses

      private final Set<String> compositionAnnotationClasses
  • Constructor Details

  • Method Details

    • getCommandFactory

      public CommandFactory<T> getCommandFactory()
      Gets the command factory to use
      Returns:
      Command factory
    • getCompositionAnnotations

      public Collection<String> getCompositionAnnotations()
      Gets the set of annotation class names to follow when building the metadata for commands i.e. these are the annotations like AirlineModule that indicate that a field has a type that should be inspected for further metadata used to build up a commands options and arguments.

      This configuration point was introduced in 2.9.0 along with the AirlineModule annotation to allow better integrating Airline with a dependency injection framework, and to ultimately enable removing its current dependency on the jakarta-inject library.

      Returns:
      Collection of injection annotation class names
      Since:
      2.9.0
    • getTypeConverter

      public TypeConverter getTypeConverter()
      Gets the type converter to use
      Returns:
      Type converter
    • getErrorHandler

      public ParserErrorHandler getErrorHandler()
      Gets the error handler to use
      Returns:
      Error handler
    • getAliases

      public List<AliasMetadata> getAliases()
      Gets the defined command aliases
      Returns:
      Aliases
    • getUserAliasesSource

      public UserAliasesSource<T> getUserAliasesSource()
      Gets the user aliases source (if any)
      Returns:
      User aliases source
    • aliasesOverrideBuiltIns

      public boolean aliasesOverrideBuiltIns()
      Gets whether aliases can override built-in commands
      Returns:
      True if they can override, false otherwise
    • aliasesMayChain

      public boolean aliasesMayChain()
      Gets whether aliases may chain i.e. whether one alias may reference another
      Returns:
      True if they can chain, false otherwise
    • getAliasForceBuiltInPrefix

      public char getAliasForceBuiltInPrefix()
      Gets the prefix character used in alias definitions to indicate that when resolving an alias that it should force the built-in to be called even if there is an alias of that name and built-in overriding is enabled
      Returns:
      Force built in prefix character
    • getOptionParsers

      public List<OptionParser<T>> getOptionParsers()
      Gets the option parsers to use
      Returns:
      Option parsers
    • allowsAbbreviatedCommands

      public boolean allowsAbbreviatedCommands()
      Gets whether command/group name abbreviation is allowed
      Returns:
      True if allowed, false otherwise
    • allowsAbbreviatedOptions

      public boolean allowsAbbreviatedOptions()
      Gets whether option name abbreviation is allowed
      Returns:
      True if allowed, false otherwise
    • getArgumentsSeparator

      public String getArgumentsSeparator()
      Gets the arguments separator to be used
      Returns:
      Arguments separator
    • allowsFlagNegation

      public boolean allowsFlagNegation()
      Gets whether this configuration allows flag negation
      Returns:
      True if negation is allowed, false otherwise
    • getFlagNegationPrefix

      public String getFlagNegationPrefix()
      Gets the flag negation prefix that is in use (if any)
      Returns:
      Flag negation prefix, may be null if not enabled
    • toString

      public String toString()
      Overrides:
      toString in class Object