Class RequiredOnlyIfRestriction

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<java.lang.String> names  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> void finalValidate​(ParseState<T> state, OptionMetadata option)
      Method that is called after Airline has completed parsing
      java.lang.String[] getContentBlock​(int blockNumber)
      Gets the content block with the given number
      HelpFormat getFormat()
      Gets the format of the provided help information
      java.lang.String getPreamble()
      Gets the preamble text that should be included
      int numContentBlocks()
      Gets the number of content blocks provided
      <T> void postValidate​(ParseState<T> state, OptionMetadata option, java.lang.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, java.lang.String value)
      Method that is called before Airline attempts to convert a string argument received into a strongly typed Java value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • names

        private final java.util.Set<java.lang.String> names
    • Constructor Detail

      • RequiredOnlyIfRestriction

        public RequiredOnlyIfRestriction​(java.lang.String... names)
    • Method Detail

      • finalValidate

        public <T> void finalValidate​(ParseState<T> state,
                                      OptionMetadata option)
        Description copied from interface: OptionRestriction
        Method that is called after Airline has completed parsing

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

        Specified by:
        finalValidate in interface OptionRestriction
        Parameters:
        state - Parser state
        option - Option meta-data
      • preValidate

        public <T> void preValidate​(ParseState<T> state,
                                    OptionMetadata option,
                                    java.lang.String value)
        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 interface OptionRestriction
        Parameters:
        state - Parser state
        option - Option meta-data
        value - String value
      • getPreamble

        public java.lang.String getPreamble()
        Description copied from interface: HelpHint
        Gets the preamble text that should be included
        Specified by:
        getPreamble in interface HelpHint
        Returns:
        Preamble text
      • getFormat

        public HelpFormat getFormat()
        Description copied from interface: HelpHint
        Gets the format of the provided help information
        Specified by:
        getFormat in interface HelpHint
        Returns:
        Help format
      • numContentBlocks

        public int numContentBlocks()
        Description copied from interface: HelpHint
        Gets the number of content blocks provided

        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

        Specified by:
        numContentBlocks in interface HelpHint
        Returns:
        Number of content blocks
      • getContentBlock

        public java.lang.String[] getContentBlock​(int blockNumber)
        Description copied from interface: HelpHint
        Gets the content block with the given number
        Specified by:
        getContentBlock in interface HelpHint
        Parameters:
        blockNumber - Block number
        Returns:
        Content Block
      • postValidate

        public <T> void postValidate​(ParseState<T> state,
                                     OptionMetadata option,
                                     java.lang.Object value)
        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 interface OptionRestriction
        Parameters:
        state - Parser state
        option - Option meta-data
        value - Strongly typed value