Interface OptionRestriction

All Known Implementing Classes:
AbstractAllowedValuesRestriction, AbstractCommonRestriction, AbstractLocaleAndCaseStringRestriction, AbstractRequiredUnlessRestriction, AbstractStringRestriction, AllowedEnumValuesRestriction, AllowedRawValuesRestriction, AllowedValuesRestriction, EndsWithRestriction, IsRequiredRestriction, LengthRestriction, MultipleOfRestriction, MutuallyExclusiveRestriction, None, NoOptionLikeValuesRestriction, NotBlankRestriction, NotEmptyRestriction, OccurrencesRestriction, PartialRestriction, PathRestriction, PatternRestriction, PortRestriction, PositiveNegativeRestriction, RangeRestriction, RequiredOnlyIfRestriction, RequiredUnlessEnvironmentRestriction, RequireFromRestriction, StartsWithRestriction

public interface OptionRestriction
Represents restrictions on options
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    Method that is called after Airline has completed parsing
    <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 value
  • Method Details

    • finalValidate

      <T> void finalValidate(ParseState<T> state, OptionMetadata option)
      Method that is called after Airline has completed parsing

      This can be used to implement restrictions that require the final parser state to process

      Parameters:
      state - Parser state
      option - Option meta-data
    • postValidate

      <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
      Parameters:
      state - Parser state
      option - Option meta-data
      value - Strongly typed value
    • preValidate

      <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
      Parameters:
      state - Parser state
      option - Option meta-data
      value - String value