apache-comnons系列之commons-cli1.4 学习笔记
来源:互联网 发布:vs2015 python 编辑:程序博客网 时间:2024/06/16 20:32
apache-comnons系列之commons-cli1.4 学习笔记
概述
- 参考
- https://segmentfault.com/a/1190000006795206
- CommandLineParser
- A class that implements the
CommandLineParser
interface can parse a String array according to the {@link Options} specified and return a {@link CommandLine}.
- A class that implements the
- DefaultParser
- Default parser.
- Option
- Describes a single command-line option. It maintains information regarding the short-name of the option, the long-name,
if any exists, a flag indicating if an argument is required for this option, and a self-documenting description of the option.
- Describes a single command-line option. It maintains information regarding the short-name of the option, the long-name,
- Options
- Options represents a collection of {@link Option} objects, which describe the possible options for a command-line.
- OptionGroup
- A group of mutually exclusive options.
- optionMap = new LinkedHashMap
测试
- org.apache.commons.cli.OptionTest
- opt—-the name of the option
- longOpt—-the long representation of the option
- argName—-the name of the argument for this option
- description/required
- numberOfArgs
- the number of argument values this option can have
- valuesep
- the character that is the value separator
- List values = new ArrayList();—-the list of argument values
- acceptsArg
- Tells if the option can accept more arguments.
- org.apache.commons.cli.OptionsTest
- shortOpts/longOpts/requiredOpts/optionGroups
- org.apache.commons.cli.CommandLineTest
- args = new LinkedList();/options = new ArrayList();
- args用于接收无法处理的参数
- org.apache.commons.cli.DefaultParserTest
- org.apache.commons.cli.ParserTestCase
- Option currentOption—-The last option parsed.(表示期望解析参数的option)
- parse流程
- handleToken
- currentOption.addValueForProcessing
- processValue
- add(value);
- handleUnknownToken
- cmd.addArg(token);
阅读全文
0 0
- apache-comnons系列之commons-cli1.4 学习笔记
- apache-comnons系列之commons-pool2.4 学习笔记
- apache-comnons系列之commons-email1.4 学习笔记
- apache-comnons系列之commons-lang3 学习笔记1
- apache-comnons系列之commons-codec1.11 学习笔记
- apache-comnons系列之commons-dbutils1.7 学习笔记
- apache-comnons系列之commons-fileupload1.3.3 学习笔记
- apache-comnons系列之commons-compress1.14 学习笔记
- apache-comnons系列之commons-math3.6 学习笔记
- apache-comnons系列之commons-net3.6 学习笔记
- apache-comnons系列之commons-imaging1.0 学习笔记
- apache-comnons系列之commons-configuration2 学习笔记
- apache-comnons系列之commons-logging1.2 学习笔记
- apache-comnons系列之commons-vfs2 学习笔记
- apache-comnons系列之commons-chain1.2 学习笔记
- apache-comnons系列之commons-exec1.3 学习笔记
- apache-comnons系列之commons-digester 3.3.2 学习笔记
- apache-comnons系列之commons-io-2.5 org.apache.commons.io.IOUtils学习笔记
- 安全退出Activity的六种方式
- 《笨办法学python》加分习题2——我的答案
- 随笔 8-3
- ORACLE 11G RAC 负载均衡
- Touch事件的传递机制
- apache-comnons系列之commons-cli1.4 学习笔记
- 414. Third Maximum Number
- L2-009. 抢红包
- 归并排序
- 51nod 1785 数据流中的算法
- K.O. ----- 配置文件没有提示
- 文章标题
- CSS(5)__CSS基本用法<选择器和一些特效>
- Android多渠道打包