Module com.github.rvesse.airline
Class RequireFromRestriction
java.lang.Object
com.github.rvesse.airline.restrictions.options.RequireFromRestriction
- All Implemented Interfaces:
HelpHint
,OptionRestriction
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> void
finalValidate
(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 includedgetTag()
private <T> Collection
<OptionMetadata> getTaggedOptions
(ParseState<T> state) int
Gets the number of content blocks provided<T> void
postValidate
(ParseState<T> state, OptionMetadata option, Object value) Method that is called after Airline has converted a string argument received into a strongly typed Java value<T> void
preValidate
(ParseState<T> state, OptionMetadata option, String value) Method that is called before Airline attempts to convert a string argument received into a strongly typed Java valueprivate static String
toOptionsList
(Iterable<OptionMetadata> options)
-
Field Details
-
tag
-
mutuallyExclusive
private final boolean mutuallyExclusive
-
-
Constructor Details
-
RequireFromRestriction
-
-
Method Details
-
finalValidate
Description copied from interface:OptionRestriction
Method that is called after Airline has completed parsingThis can be used to implement restrictions that require the final parser state to process
- Specified by:
finalValidate
in interfaceOptionRestriction
- Parameters:
state
- Parser stateoption
- Option meta-data
-
toOptionsList
-
getTaggedOptions
-
getTag
-
getPreamble
Description copied from interface:HelpHint
Gets the preamble text that should be included- Specified by:
getPreamble
in interfaceHelpHint
- Returns:
- Preamble text
-
getFormat
Description copied from interface:HelpHint
Gets the format of the provided help information -
numContentBlocks
public int numContentBlocks()Description copied from interface:HelpHint
Gets 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:
numContentBlocks
in interfaceHelpHint
- Returns:
- Number of content blocks
-
getContentBlock
Description copied from interface:HelpHint
Gets the content block with the given number- Specified by:
getContentBlock
in interfaceHelpHint
- Parameters:
blockNumber
- Block number- Returns:
- Content Block
-
preValidate
Description copied from interface:OptionRestriction
Method that is called before Airline attempts to convert a string argument received into a strongly typed Java value- Specified by:
preValidate
in interfaceOptionRestriction
- Parameters:
state
- Parser stateoption
- Option meta-datavalue
- String value
-
postValidate
Description copied from interface:OptionRestriction
Method that is called after Airline has converted a string argument received into a strongly typed Java value- Specified by:
postValidate
in interfaceOptionRestriction
- Parameters:
state
- Parser stateoption
- Option meta-datavalue
- Strongly typed value
-