public class NotEmptyRestriction extends AbstractStringRestriction implements HelpHint
Constructor and Description |
---|
NotEmptyRestriction() |
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
|
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, preValidate
finalValidate, finalValidate, getArgumentTitle, getArgumentTitle, postValidate, postValidate
protected boolean isValid(String value)
AbstractStringRestriction
isValid
in class AbstractStringRestriction
value
- Valueprotected <T> ParseRestrictionViolatedException violated(ParseState<T> state, OptionMetadata option, String value)
AbstractStringRestriction
AbstractStringRestriction.isValid(String)
returns false
violated
in class AbstractStringRestriction
state
- 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)
AbstractStringRestriction
AbstractStringRestriction.isValid(String)
returns false
violated
in class AbstractStringRestriction
state
- Parser statearguments
- Arguments metadatavalue
- Value which has been deemed invalidpublic String getPreamble()
HelpHint
getPreamble
in interface HelpHint
public HelpFormat getFormat()
HelpHint
public 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 HelpHint
public String[] getContentBlock(int blockNumber)
HelpHint
getContentBlock
in interface HelpHint
blockNumber
- Block numberCopyright © 2012–2017. All rights reserved.