public class ArgumentParser extends Object
-m minute [-s seconds] -s 45 -m 20 20 for minute and 45 for seconds -m minute [-s seconds] can contain as many mandatory and optional expressions as required but optional
expressions cannot be nested
boolean, byte, char, short, int, long, float, double)Boolean, Byte, Character, Short, Integer, Long, Float, Double)-m|--min minute is a valid usage expression and -m or --min can be
used in corresponding command line arguments
String
| Constructor and Description |
|---|
ArgumentParser(String usageExpression,
Class<?> dataHolderClass) |
ArgumentParser(String usageExpression,
Class<?> dataHolderClass,
String arrayDelimiter) |
public ArgumentParser(String usageExpression, Class<?> dataHolderClass)
usageExpression - The expression representing format in which command line arguments will be specified
For example: --min|-m minute [--sec|-s seconds]dataHolderClass - The class which will contain the values specified in command line arguments. This class must have variables specified in
the usageExpression, corresponding setterMethod and default constructor
For example: if usageExpression is --min|-m minute [--sec|-s seconds], the dataHolderClass must have minute and seconds
as variables and setMinute and setSeconds methods and default constructorpublic ArgumentParser(String usageExpression, Class<?> dataHolderClass, String arrayDelimiter)
usageExpression - As described abovedataHolderClass - As described abovearrayDelimiter - The delimiter text which will be used to determine the array specified in command line argumentCopyright © 2017. All rights reserved.