java.lang.Object
com.github.rvesse.airline.model.ParserMetadata<T>
Represents meta-data about the parser configuration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<AliasMetadata> private final boolean
private final boolean
private final boolean
private final boolean
private final String
private final CommandFactory
<T> static final String
Default separator used to separate arguments from optionsprivate final ParserErrorHandler
private final String
private final char
private final List
<OptionParser<T>> private final TypeConverter
private final UserAliasesSource
<T> -
Constructor Summary
ConstructorsConstructorDescriptionParserMetadata
(CommandFactory<T> commandFactory, Collection<String> compositionAnnotationClasses, Collection<OptionParser<T>> optionParsers, TypeConverter typeConverter, ParserErrorHandler errorHandler, boolean allowAbbreviateCommands, boolean allowAbbreviatedOptions, Collection<AliasMetadata> aliases, UserAliasesSource<T> userAliases, boolean aliasesOverrideBuiltIns, boolean aliasesMayChain, char forceBuiltInPrefix, String argumentsSeparator, String flagNegationPrefix) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets whether aliases may chain i.e.boolean
Gets whether aliases can override built-in commandsboolean
Gets whether command/group name abbreviation is allowedboolean
Gets whether option name abbreviation is allowedboolean
Gets whether this configuration allows flag negationGets the defined command aliaseschar
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 enabledGets the arguments separator to be usedGets the command factory to useGets the set of annotation class names to follow when building the metadata for commands i.e.Gets the error handler to useGets the flag negation prefix that is in use (if any)Gets the option parsers to useGets the type converter to useGets the user aliases source (if any)toString()
-
Field Details
-
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
-
aliases
-
userAliases
-
typeConverter
-
commandFactory
-
argsSeparator
-
flagNegationPrefix
-
errorHandler
-
forceBuiltInPrefix
private final char forceBuiltInPrefix -
compositionAnnotationClasses
-
-
Constructor Details
-
ParserMetadata
public ParserMetadata(CommandFactory<T> commandFactory, Collection<String> compositionAnnotationClasses, Collection<OptionParser<T>> optionParsers, TypeConverter typeConverter, ParserErrorHandler errorHandler, boolean allowAbbreviateCommands, boolean allowAbbreviatedOptions, Collection<AliasMetadata> aliases, UserAliasesSource<T> userAliases, boolean aliasesOverrideBuiltIns, boolean aliasesMayChain, char forceBuiltInPrefix, String argumentsSeparator, String flagNegationPrefix)
-
-
Method Details
-
getCommandFactory
Gets the command factory to use- Returns:
- Command factory
-
getCompositionAnnotations
Gets the set of annotation class names to follow when building the metadata for commands i.e. these are the annotations likeAirlineModule
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 thejakarta-inject
library.- Returns:
- Collection of injection annotation class names
- Since:
- 2.9.0
-
getTypeConverter
Gets the type converter to use- Returns:
- Type converter
-
getErrorHandler
Gets the error handler to use- Returns:
- Error handler
-
getAliases
Gets the defined command aliases- Returns:
- Aliases
-
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
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
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
Gets the flag negation prefix that is in use (if any)- Returns:
- Flag negation prefix, may be
null
if not enabled
-
toString
-