Class AbstractSimpleOptionParser

    • Constructor Detail

      • AbstractSimpleOptionParser

        public AbstractSimpleOptionParser()
    • Method Detail

      • getParser

        public net.sourceforge.argparse4j.inf.ArgumentParser getParser()
        Configures and returns the commandline parser.
        Specified by:
        getParser in interface SimpleOptionParser
        Returns:
        the parser
      • setOptions

        protected boolean setOptions​(net.sourceforge.argparse4j.inf.Namespace ns)
        Sets the parsed options.
        Parameters:
        ns - the parsed options
        Returns:
        if successfully set
      • setOptions

        public boolean setOptions​(String[] options)
                           throws Exception
        Sets the commandline options.
        Specified by:
        setOptions in interface SimpleOptionParser
        Parameters:
        options - the options to use
        Returns:
        true if successful
        Throws:
        Exception - in case of an invalid option
      • forCommandline

        public static SimpleOptionParser forCommandline​(String cmdline)
                                                 throws Exception
        Instantiates the option parser from the commandline.
        Parameters:
        cmdline - the commandline to use
        Returns:
        the instantiated object
        Throws:
        Exception - if instantiation/parsing fails