Class ArgumentParser


  • public class ArgumentParser
    extends Object
    This class parses program arguments and returns them as a map of file types and file locations.
    Author:
    gman6028, markr
    • Constructor Detail

      • ArgumentParser

        public ArgumentParser()
    • Method Detail

      • convertArgsToMapDefaultStyle

        protected static Map<String,​String> convertArgsToMapDefaultStyle​(String[] args)
                                                                        throws PlanItException
        Convert program arguments into a Map, with signature: <key>=/-/:<value>, e.g. the default style
        Parameters:
        args - command-line arguments
        Returns:
        Map of key value pairs
        Throws:
        PlanItException - thrown if an argument cannot be parsed
      • convertArgsToMapDoubleHyphenStyle

        protected static Map<String,​String> convertArgsToMapDoubleHyphenStyle​(String[] args)
                                                                             throws PlanItException
        Convert program arguments into a Map, with signature: --<key> <value>, e.g. the double hyphen style
        Parameters:
        args - command-line arguments
        Returns:
        Map of key value pairs
        Throws:
        PlanItException - thrown if an argument cannot be parsed
      • convertArgsToMap

        public static Map<String,​String> convertArgsToMap​(String[] args)
                                                         throws PlanItException
        Convert program arguments into a Map, with signature: <key>=/-/:<value>, e.g. the default style
        Parameters:
        args - command-line arguments
        Returns:
        Map of file locations
        Throws:
        PlanItException - thrown if an argument cannot be parsed into a file type and file location
      • convertArgsToMap

        public static Map<String,​String> convertArgsToMap​(String[] args,
                                                                ArgumentStyle style)
                                                         throws PlanItException
        Convert program arguments into a Map, based on given style
        Parameters:
        args - command-line arguments
        style - to apply
        Returns:
        Map of key value pairs
        Throws:
        PlanItException - thrown if an argument cannot be parsed