Class ParseState


  • class ParseState
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String[] args
      Array of arguments.
      (package private) boolean consumedSeparator
      True if special argument "--" is found and consumed.
      (package private) ArgumentParserException deferredException
      Deferred exception encountered while parsing.
      (package private) int index
      Index in args array, which points next argument to process.
      (package private) int lastFromFileArgIndex
      Index in args array, which points to the last argument read from file.
      (package private) boolean negNumFlag
      True if negative number like flag is registered in the parser.
      (package private) java.util.List<java.lang.String> posArgArgs
      Accumulated positional arguments we have seen so far.
      (package private) int posArgConsumed
      The number of arguments (well, parameters) consumed for the current positional Argument object.
      (package private) int posArgIndex
      Index of positional argument (Argument object) we are currently processing.
      (package private) java.util.List<java.lang.String> unknown
      Accumulated unknown arguments, if not null.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseState​(java.lang.String[] args, boolean negNumFlag, java.util.List<java.lang.String> unknown)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String getArg()  
      (package private) boolean isArgAvail()  
      (package private) void resetArgs​(java.lang.String[] args)  
      (package private) void resetPosArgs()  
      • Methods inherited from class java.lang.Object

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

      • args

        public java.lang.String[] args
        Array of arguments.
      • index

        int index
        Index in args array, which points next argument to process.
      • lastFromFileArgIndex

        int lastFromFileArgIndex
        Index in args array, which points to the last argument read from file. -1 means that no argument is read from file. If arguments are read from file recursively (e.g., argument file is found in argument file), this value is properly extended to point to the actual last argument by position.
      • consumedSeparator

        boolean consumedSeparator
        True if special argument "--" is found and consumed.
      • negNumFlag

        boolean negNumFlag
        True if negative number like flag is registered in the parser.
      • deferredException

        ArgumentParserException deferredException
        Deferred exception encountered while parsing. This will be thrown after parsing completed and no other exception was thrown.
      • posArgIndex

        int posArgIndex
        Index of positional argument (Argument object) we are currently processing.
      • posArgConsumed

        int posArgConsumed
        The number of arguments (well, parameters) consumed for the current positional Argument object.
      • posArgArgs

        java.util.List<java.lang.String> posArgArgs
        Accumulated positional arguments we have seen so far.
      • unknown

        java.util.List<java.lang.String> unknown
        Accumulated unknown arguments, if not null.
    • Constructor Detail

      • ParseState

        ParseState​(java.lang.String[] args,
                   boolean negNumFlag,
                   java.util.List<java.lang.String> unknown)
    • Method Detail

      • resetArgs

        void resetArgs​(java.lang.String[] args)
      • getArg

        java.lang.String getArg()
      • isArgAvail

        boolean isArgAvail()
      • resetPosArgs

        void resetPosArgs()