Class MainParser


  • public final class MainParser
    extends Object
    This class parses command-line arguments provided by a class with main method.
    Author:
    BaseX Team 2005-23, BSD License, Christian Gruen
    • Constructor Detail

      • MainParser

        public MainParser​(Main main)
        Default constructor.
        Parameters:
        main - calling object
    • Method Detail

      • more

        public boolean more()
        Checks if more arguments are available.
        Returns:
        result of check
      • dash

        public boolean dash()
        Checks if the current argument starts with a dash (i.e., introduces any flags).
        Returns:
        result of check
      • next

        public char next()
        Returns the next flag.
        Returns:
        next flag
      • string

        public String string()
        Returns the next string argument.
        Returns:
        string
      • number

        public int number()
                   throws BaseXException
        Returns the next positive numeric argument.
        Returns:
        positive integer
        Throws:
        BaseXException - database exception
      • usage

        public BaseXException usage()
        Returns an exception with the command usage info.
        Returns:
        database exception