Class CommandLine
- java.lang.Object
-
- com.vividsolutions.jump.util.commandline.CommandLine
-
public class CommandLine extends Object
A class to parse application command-line parameters and arguments.
-
-
Constructor Summary
Constructors Constructor Description CommandLine()CommandLine(char optionCh)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParamSpec(ParamSpec paramSpec)Iterator<String>getArguments()ParamgetParam(String name)get last Param with that nameIterator<Param>getParams()Iterator<String>getParamsArguments(String name)get all values of all parameters(options) with the given name seeParamSpec.getAllArguments()Iterator<ParamSpec>getParamSpecs()booleanhasParam(String name)voidparse(String[] args)StringprintDoc()StringprintDoc(Exception e)
-
-
-
Method Detail
-
addParamSpec
public void addParamSpec(ParamSpec paramSpec)
-
getParam
public Param getParam(String name)
get last Param with that name- Parameters:
name-- Returns:
- Param or null
-
hasParam
public boolean hasParam(String name)
-
getParamsArguments
public Iterator<String> getParamsArguments(String name)
get all values of all parameters(options) with the given name seeParamSpec.getAllArguments()- Parameters:
name- name of the arguments- Returns:
- an iterator to iterate through arguments with this name
-
printDoc
public String printDoc()
-
parse
public void parse(String[] args) throws ParseException
- Throws:
ParseException
-
-