public class PathRestriction extends AbstractCommonRestriction implements HelpHint
| Constructor and Description |
|---|
PathRestriction(boolean mustExist,
boolean readable,
boolean writable,
boolean executable,
PathKind kind)
Creates a new path restriction
|
| 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
|
int |
numContentBlocks()
Gets the number of content blocks provided
|
<T> void |
preValidate(ParseState<T> state,
ArgumentsMetadata arguments,
String value)
Method that is called before Airline attempts to convert 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 value
|
protected void |
validate(String title,
String path) |
finalValidate, finalValidate, getArgumentTitle, getArgumentTitle, getOptionTitle, postValidate, postValidatepublic PathRestriction(boolean mustExist,
boolean readable,
boolean writable,
boolean executable,
PathKind kind)
mustExist - Whether the path must existreadable - Whether the path must be readable, if the specific path does
not exist then this check validates that the first parent in
the path that exists is readablewritable - Whether the path must be writable, if the specific path does
not exist then this check validates that the first parent in
the path that exists is writableexecutable - Whether the path must be executable, if the specific path does
not exist then this check validates that the first parent in
the path that exists is executablekind - public <T> void preValidate(ParseState<T> state, OptionMetadata option, String value)
OptionRestrictionpreValidate in interface OptionRestrictionpreValidate in class AbstractCommonRestrictionstate - Parser stateoption - Option meta-datavalue - String valuepublic <T> void preValidate(ParseState<T> state, ArgumentsMetadata arguments, String value)
ArgumentsRestrictionpreValidate in interface ArgumentsRestrictionpreValidate in class AbstractCommonRestrictionstate - Parser statearguments - Arguments meta-datavalue - String valuepublic String getPreamble()
HelpHintgetPreamble in interface HelpHintpublic HelpFormat getFormat()
HelpHintpublic 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 HelpHintpublic String[] getContentBlock(int blockNumber)
HelpHintgetContentBlock in interface HelpHintblockNumber - Block numberCopyright © 2012–2022. All rights reserved.