Package org.goplanit.utils.args
Class ArgumentParser
- java.lang.Object
-
- org.goplanit.utils.args.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 Summary
Constructors Constructor Description ArgumentParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>
convertArgsToMap(String[] args)
Convert program arguments into a Map, with signature:<key>=/-/:<value>
, e.g.static Map<String,String>
convertArgsToMap(String[] args, ArgumentStyle style)
Convert program arguments into a Map, based on given styleprotected static Map<String,String>
convertArgsToMapDefaultStyle(String[] args)
Convert program arguments into a Map, with signature:<key>=/-/:<value>
, e.g.protected static Map<String,String>
convertArgsToMapDoubleHyphenStyle(String[] args)
Convert program arguments into a Map, with signature:--<key> <value>
, e.g.
-
-
-
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 argumentsstyle
- to apply- Returns:
- Map of key value pairs
- Throws:
PlanItException
- thrown if an argument cannot be parsed
-
-