public class NoOptionLikeValuesRestriction extends StartsWithRestriction implements GlobalRestriction
Please see NoOptionLikeValues for more discussion of how
this restriction applies.
ignoreCase, localeDEFAULTS| Constructor and Description |
|---|
NoOptionLikeValuesRestriction(String[] prefixes) |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getContentBlock(int blockNumber)
Gets the content block with the given number
|
HelpFormat |
getFormat()
Gets the format of the provided help information
|
String |
getPreamble()
Gets the preamble text that should be included
|
protected boolean |
isValid(String value)
Method that derived classes must implement to check whether a value is
valid
|
int |
numContentBlocks()
Gets the number of content blocks provided
|
<T> void |
validate(ParseState<T> state)
Validates the parser state
|
protected <T> ParseRestrictionViolatedException |
violated(ParseState<T> state,
ArgumentsMetadata arguments,
String value)
Method that derived classes must implement to provide an exception for
the case of an invalid argument value, this will be called if
AbstractStringRestriction.isValid(String) returns false |
protected <T> ParseRestrictionViolatedException |
violated(ParseState<T> state,
OptionMetadata option,
String value)
Method that derived classes must implement to provide an exception for
the case of an invalid option value, this will be called if
AbstractStringRestriction.isValid(String) returns false |
preValidate, preValidatefinalValidate, finalValidate, getArgumentTitle, getArgumentTitle, getOptionTitle, postValidate, postValidatepublic NoOptionLikeValuesRestriction(String[] prefixes)
protected boolean isValid(String value)
AbstractStringRestrictionisValid in class StartsWithRestrictionvalue - Valueprotected <T> ParseRestrictionViolatedException violated(ParseState<T> state, OptionMetadata option, String value)
AbstractStringRestrictionAbstractStringRestriction.isValid(String) returns falseviolated in class StartsWithRestrictionstate - Parser stateoption - Option metadata for the option whose value is being checkedvalue - Value which has been deemed invalidprotected <T> ParseRestrictionViolatedException violated(ParseState<T> state, ArgumentsMetadata arguments, String value)
AbstractStringRestrictionAbstractStringRestriction.isValid(String) returns falseviolated in class StartsWithRestrictionstate - Parser statearguments - Arguments metadatavalue - Value which has been deemed invalidpublic <T> void validate(ParseState<T> state)
GlobalRestrictionShould throw an exception if the restriction is violated, otherwise should simply return
validate in interface GlobalRestrictionstate - Parser statepublic String getPreamble()
HelpHintgetPreamble in interface HelpHintgetPreamble in class StartsWithRestrictionpublic HelpFormat getFormat()
HelpHintgetFormat in interface HelpHintgetFormat in class StartsWithRestrictionpublic int numContentBlocks()
HelpHint
Help generators should consult the HelpHint.getFormat() return value to
determine how to format the content blocks but they are not required to
do so
numContentBlocks in interface HelpHintnumContentBlocks in class StartsWithRestrictionpublic String[] getContentBlock(int blockNumber)
HelpHintgetContentBlock in interface HelpHintgetContentBlock in class StartsWithRestrictionblockNumber - Block numberCopyright © 2012–2022. All rights reserved.