Module com.github.rvesse.airline
Class GreedyMaybeListValueOptionParser<T>
- java.lang.Object
-
- com.github.rvesse.airline.parser.AbstractParser<T>
-
- com.github.rvesse.airline.parser.options.AbstractOptionParser<T>
-
- com.github.rvesse.airline.parser.options.ListValueOptionParser<T>
-
- com.github.rvesse.airline.parser.options.MaybeListValueOptionParser<T>
-
- com.github.rvesse.airline.parser.options.GreedyMaybeListValueOptionParser<T>
-
- Type Parameters:
T
- Command Type
- All Implemented Interfaces:
OptionParser<T>
public class GreedyMaybeListValueOptionParser<T> extends MaybeListValueOptionParser<T>
A variation on theMaybeListValueOptionParser
that is greedyThis primarily makes a difference when used with commands that also use
Arguments
orDefaultOption
. If that is the case using this parser could incorrectly consume values not intended to be part of the list. Users creating CLIs should be certain that this represents the behaviour they want.
-
-
Constructor Summary
Constructors Constructor Description GreedyMaybeListValueOptionParser()
GreedyMaybeListValueOptionParser(char separator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canGreedySearch(ParseState<T> state)
Gets whether we can do a greedy search for list value(s)-
Methods inherited from class com.github.rvesse.airline.parser.options.MaybeListValueOptionParser
parseOptions
-
Methods inherited from class com.github.rvesse.airline.parser.options.ListValueOptionParser
getValues
-
Methods inherited from class com.github.rvesse.airline.parser.options.AbstractOptionParser
findOption, findOption, hasShortNamePrefix, isSeparatorOrOption, noValueForOption
-
Methods inherited from class com.github.rvesse.airline.parser.AbstractParser
getTypeConverter
-
-
-
-
Method Detail
-
canGreedySearch
protected boolean canGreedySearch(ParseState<T> state)
Description copied from class:MaybeListValueOptionParser
Gets whether we can do a greedy search for list value(s)- Overrides:
canGreedySearch
in classMaybeListValueOptionParser<T>
- Parameters:
state
- Parser State- Returns:
- True if a greedy search is permitted, false otherwise
-
-