Class OccurrencesRestriction
java.lang.Object
com.github.rvesse.airline.restrictions.AbstractCommonRestriction
com.github.rvesse.airline.restrictions.common.OccurrencesRestriction
- All Implemented Interfaces:
HelpHint, ArgumentsRestriction, OptionRestriction
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidfinalValidate(ParseState<T> state, ArgumentsMetadata arguments) Method that is called after Airline has completed parsing<T> voidfinalValidate(ParseState<T> state, OptionMetadata option) Method that is called after Airline has completed parsingString[]getContentBlock(int blockNumber) Gets the content block with the given numberGets the format of the provided help informationGets the preamble text that should be includedintGets the number of content blocks providedtitles(ParseState<T> state, ArgumentsMetadata arguments) Methods inherited from class AbstractCommonRestriction
getArgumentTitle, getArgumentTitle, getOptionTitle, postValidate, postValidate, preValidate, preValidate
-
Field Details
-
occurrences
private final int occurrences -
maximum
private final boolean maximum
-
-
Constructor Details
-
OccurrencesRestriction
public OccurrencesRestriction(int occurrences, boolean maximum)
-
-
Method Details
-
finalValidate
Description copied from interface:OptionRestrictionMethod that is called after Airline has completed parsingThis can be used to implement restrictions that require the final parser state to process
- Specified by:
finalValidatein interfaceOptionRestriction- Overrides:
finalValidatein classAbstractCommonRestriction- Parameters:
state- Parser stateoption- Option meta-data
-
finalValidate
Description copied from interface:ArgumentsRestrictionMethod that is called after Airline has completed parsingThis can be used to implement restrictions that require the final parser state to process
- Specified by:
finalValidatein interfaceArgumentsRestriction- Overrides:
finalValidatein classAbstractCommonRestriction- Parameters:
state- Parser statearguments- Arguments meta-data
-
titles
-
getPreamble
Description copied from interface:HelpHintGets the preamble text that should be included- Specified by:
getPreamblein interfaceHelpHint- Returns:
- Preamble text
-
getFormat
Description copied from interface:HelpHintGets the format of the provided help information -
numContentBlocks
public int numContentBlocks()Description copied from interface:HelpHintGets the number of content blocks providedHelp generators should consult the
HelpHint.getFormat()return value to determine how to format the content blocks but they are not required to do so- Specified by:
numContentBlocksin interfaceHelpHint- Returns:
- Number of content blocks
-
getContentBlock
Description copied from interface:HelpHintGets the content block with the given number- Specified by:
getContentBlockin interfaceHelpHint- Parameters:
blockNumber- Block number- Returns:
- Content Block
-