Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.java.html ============================================================================== --- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.java.html (added) +++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.java.html Sat May 9 18:19:15 2015 @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>MissingOptionException.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.source.html" class="el_package">org.apache.commons.cli</a> > <span class="el_source">MissingOptionException.j ava</span></div><h1>MissingOptionException.java</h1><pre class="source lang-java linenums">/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.cli; + +import java.util.List; +import java.util.Iterator; + +/** + * Thrown when a required option has not been provided. + * + * @version $Id: MissingOptionException.java 1443102 2013-02-06 18:12:16Z tn $ + */ +public class MissingOptionException extends ParseException +{ + /** This exception {@code serialVersionUID}. */ + private static final long serialVersionUID = 8161889051578563249L; + + /** The list of missing options and groups */ + private List missingOptions; + + /** + * Construct a new <code>MissingSelectedException</code> + * with the specified detail message. + * + * @param message the detail message + */ + public MissingOptionException(String message) + { +<span class="fc" id="L44"> super(message);</span> +<span class="fc" id="L45"> }</span> + + /** + * Constructs a new <code>MissingSelectedException</code> with the + * specified list of missing options. + * + * @param missingOptions the list of missing options and groups + * @since 1.2 + */ + public MissingOptionException(List missingOptions) + { +<span class="fc" id="L56"> this(createMessage(missingOptions));</span> +<span class="fc" id="L57"> this.missingOptions = missingOptions;</span> +<span class="fc" id="L58"> }</span> + + /** + * Returns the list of options or option groups missing in the command line parsed. + * + * @return the missing options, consisting of String instances for simple + * options, and OptionGroup instances for required option groups. + * @since 1.2 + */ + public List getMissingOptions() + { +<span class="fc" id="L69"> return missingOptions;</span> + } + + /** + * Build the exception message from the specified list of options. + * + * @param missingOptions the list of missing options and groups + * @since 1.2 + */ + private static String createMessage(List<?> missingOptions) + { +<span class="fc" id="L80"> StringBuilder buf = new StringBuilder("Missing required option");</span> +<span class="fc bfc" id="L81" title="All 2 branches covered."> buf.append(missingOptions.size() == 1 ? "" : "s");</span> +<span class="fc" id="L82"> buf.append(": ");</span> + +<span class="fc" id="L84"> Iterator<?> it = missingOptions.iterator();</span> +<span class="fc bfc" id="L85" title="All 2 branches covered."> while (it.hasNext())</span> + { +<span class="fc" id="L87"> buf.append(it.next());</span> +<span class="fc bfc" id="L88" title="All 2 branches covered."> if (it.hasNext())</span> + { +<span class="fc" id="L90"> buf.append(", ");</span> + } + } + +<span class="fc" id="L94"> return buf.toString();</span> + } +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html> \ No newline at end of file
Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/MissingOptionException.java.html ------------------------------------------------------------------------------ svn:eol-style = native Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option$Builder.html ============================================================================== --- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option$Builder.html (added) +++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option$Builder.html Sat May 9 18:19:15 2015 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>Option.Builder</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.html" class="el_package">org.apache.commons.cli</a> > <span class="el_class">Option.Builder</span></div><h1>Option.Builder</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sor table" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">9 of 97</td><td class="ctr2">91%</td><td class="bar">0 of 6</td><td class="ctr2">100%</td><td class="ctr1">2</td><td class="ctr2">18</td><td class="ctr1">3</td>< td class="ctr2">32</td><td class="ctr1">2</td><td class="ctr2">15</td></tr></tfoot><tbody><tr><td id="a5"><a href="Option.java.html#L987" class="el_method">hasArgs()</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c13">0%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f0">1</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h0">2</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j0">1</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a10"><a href="Option.java.html#L893" class="el_method">required()</a></td><td class="bar" id="b1"><img src="../.resources/redbar.gif" width="28" height="10" title="4" alt="4"/></td><td class="ctr2" id="c14">0%</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i12">1</td><td class="ctr1" id="j1"> 1</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a href="Option.java.html#L999" class="el_method">build()</a></td><td class="bar" id="b2"><img src="../.resources/greenbar.gif" width="120" height="10" title="17" alt="17"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img src="../.resources/greenbar.gif" width="120" height="10" title="4" alt="4"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g0">3</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i1">3</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a8"><a href="Option.java.html#L804" class="el_method">Option.Builder(String)</a></td><td class="bar" id="b3"><img src="../.resources/greenbar.gif" width="98" height="10" title="14" alt="14"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h3">0</td ><td class="ctr2" id="i0">6</td><td class="ctr1" id="j3">0</td><td >class="ctr2" id="k3">1</td></tr><tr><td id="a4"><a >href="Option.java.html#L976" class="el_method">hasArg(boolean)</a></td><td >class="bar" id="b4"><img src="../.resources/greenbar.gif" width="63" >height="10" title="9" alt="9"/></td><td class="ctr2" id="c2">100%</td><td >class="bar" id="d1"><img src="../.resources/greenbar.gif" width="60" >height="10" title="2" alt="2"/></td><td class="ctr2" id="e1">100%</td><td >class="ctr1" id="f4">0</td><td class="ctr2" id="g1">2</td><td class="ctr1" >id="h4">0</td><td class="ctr2" id="i3">2</td><td class="ctr1" >id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a0"><a >href="Option.java.html#L833" class="el_method">argName(String)</a></td><td >class="bar" id="b5"><img src="../.resources/greenbar.gif" width="35" >height="10" title="5" alt="5"/></td><td class="ctr2" id="c3">100%</td><td >class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" >id="f5">0</td><td class ="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i4">2</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a2"><a href="Option.java.html#L845" class="el_method">desc(String)</a></td><td class="bar" id="b6"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i5">2</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr><tr><td id="a6"><a href="Option.java.html#L857" class="el_method">longOpt(String)</a></td><td class="bar" id="b7"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d7"/><td class="ctr2" id="e7">n/a</td><td class="ctr1" id="f7">0</td><td class="ctr2" id="g7">1</td><td class="ctr 1" id="h7">0</td><td class="ctr2" id="i6">2</td><td class="ctr1" id="j7">0</td><td class="ctr2" id="k7">1</td></tr><tr><td id="a7"><a href="Option.java.html#L869" class="el_method">numberOfArgs(int)</a></td><td class="bar" id="b8"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d8"/><td class="ctr2" id="e8">n/a</td><td class="ctr1" id="f8">0</td><td class="ctr2" id="g8">1</td><td class="ctr1" id="h8">0</td><td class="ctr2" id="i7">2</td><td class="ctr1" id="j8">0</td><td class="ctr2" id="k8">1</td></tr><tr><td id="a9"><a href="Option.java.html#L882" class="el_method">optionalArg(boolean)</a></td><td class="bar" id="b9"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c7">100%</td><td class="bar" id="d9"/><td class="ctr2" id="e9">n/a</td><td class="ctr1" id="f9">0</td><td class="ctr2" id="g9">1</td><td class="ctr1" id="h9">0</td><td class ="ctr2" id="i8">2</td><td class="ctr1" id="j9">0</td><td class="ctr2" id="k9">1</td></tr><tr><td id="a11"><a href="Option.java.html#L904" class="el_method">required(boolean)</a></td><td class="bar" id="b10"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c8">100%</td><td class="bar" id="d10"/><td class="ctr2" id="e10">n/a</td><td class="ctr1" id="f10">0</td><td class="ctr2" id="g10">1</td><td class="ctr1" id="h10">0</td><td class="ctr2" id="i9">2</td><td class="ctr1" id="j10">0</td><td class="ctr2" id="k10">1</td></tr><tr><td id="a12"><a href="Option.java.html#L916" class="el_method">type(Class)</a></td><td class="bar" id="b11"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c9">100%</td><td class="bar" id="d11"/><td class="ctr2" id="e11">n/a</td><td class="ctr1" id="f11">0</td><td class="ctr2" id="g11">1</td><td class="ctr1" id="h11">0</td><td class="ctr2" id="i10">2< /td><td class="ctr1" id="j11">0</td><td class="ctr2" id="k11">1</td></tr><tr><td id="a14"><a href="Option.java.html#L953" class="el_method">valueSeparator(char)</a></td><td class="bar" id="b12"><img src="../.resources/greenbar.gif" width="35" height="10" title="5" alt="5"/></td><td class="ctr2" id="c10">100%</td><td class="bar" id="d12"/><td class="ctr2" id="e12">n/a</td><td class="ctr1" id="f12">0</td><td class="ctr2" id="g12">1</td><td class="ctr1" id="h12">0</td><td class="ctr2" id="i11">2</td><td class="ctr1" id="j12">0</td><td class="ctr2" id="k12">1</td></tr><tr><td id="a13"><a href="Option.java.html#L927" class="el_method">valueSeparator()</a></td><td class="bar" id="b13"><img src="../.resources/greenbar.gif" width="28" height="10" title="4" alt="4"/></td><td class="ctr2" id="c11">100%</td><td class="bar" id="d13"/><td class="ctr2" id="e13">n/a</td><td class="ctr1" id="f13">0</td><td class="ctr2" id="g13">1</td><td class="ctr1" id="h13">0</td><td class="ctr2" id="i13">1</td>< td class="ctr1" id="j13">0</td><td class="ctr2" id="k13">1</td></tr><tr><td id="a3"><a href="Option.java.html#L964" class="el_method">hasArg()</a></td><td class="bar" id="b14"><img src="../.resources/greenbar.gif" width="28" height="10" title="4" alt="4"/></td><td class="ctr2" id="c12">100%</td><td class="bar" id="d14"/><td class="ctr2" id="e14">n/a</td><td class="ctr1" id="f14">0</td><td class="ctr2" id="g14">1</td><td class="ctr1" id="h14">0</td><td class="ctr2" id="i14">1</td><td class="ctr1" id="j14">0</td><td class="ctr2" id="k14">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html> \ No newline at end of file Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option$Builder.html ------------------------------------------------------------------------------ svn:eol-style = native Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.html ============================================================================== --- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.html (added) +++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.html Sat May 9 18:19:15 2015 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>Option</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.html" class="el_package">org.apache.commons.cli</a> > <span class="el_class">Option</span></div><h1>Option</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="t oggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">61 of 562</td><td class="ctr2">89%</td><td class="bar">16 of 82</td><td class="ctr2">80%</td><td class="ctr1">17</td><td class="ctr2">89</td><td class="ctr1">12</td><td class="ctr2">129 </td><td class="ctr1">3</td><td class="ctr2">48</td></tr></tfoot><tbody><tr><td id="a26"><a href="Option.java.html#L654" class="el_method">hashCode()</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="45" height="10" title="24" alt="24"/></td><td class="ctr2" id="c45">0%</td><td class="bar" id="d1"><img src="../.resources/redbar.gif" width="26" height="10" title="4" alt="4"/></td><td class="ctr2" id="e18">0%</td><td class="ctr1" id="f1">3</td><td class="ctr2" id="g4">3</td><td class="ctr1" id="h0">3</td><td class="ctr2" id="i9">3</td><td class="ctr1" id="j0">1</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a7"><a href="Option.java.html#L676" class="el_method">clone()</a></td><td class="bar" id="b1"><img src="../.resources/redbar.gif" width="26" height="10" title="14" alt="14"/><img src="../.resources/greenbar.gif" width="24" height="10" title="13" alt="13"/></td><td class="ctr2" id="c44">48%</td><td class="bar" id="d19"/><td class="ctr2" id="e19">n/a</td ><td class="ctr1" id="f8">0</td><td class="ctr2" id="g19">1</td><td >class="ctr1" id="h1">2</td><td class="ctr2" id="i5">5</td><td class="ctr1" >id="j3">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a47"><a >href="Option.java.html#L581" class="el_method">toString()</a></td><td >class="bar" id="b2"><img src="../.resources/redbar.gif" width="9" height="10" >title="5" alt="5"/><img src="../.resources/greenbar.gif" width="110" >height="10" title="59" alt="59"/></td><td class="ctr2" id="c42">92%</td><td >class="bar" id="d2"><img src="../.resources/redbar.gif" width="20" >height="10" title="3" alt="3"/><img src="../.resources/greenbar.gif" >width="33" height="10" title="5" alt="5"/></td><td class="ctr2" >id="e16">62%</td><td class="ctr1" id="f2">3</td><td class="ctr2" >id="g2">5</td><td class="ctr1" id="h3">1</td><td class="ctr2" >id="i0">14</td><td class="ctr1" id="j4">0</td><td class="ctr2" >id="k2">1</td></tr><tr><td id="a3"><a href="Option.java.html#L433" >class="el_method">addValueForProce ssing(String)</a></td><td class="bar" id="b3"><img src="../.resources/redbar.gif" width="9" height="10" title="5" alt="5"/><img src="../.resources/greenbar.gif" width="15" height="10" title="8" alt="8"/></td><td class="ctr2" id="c43">62%</td><td class="bar" id="d5"><img src="../.resources/redbar.gif" width="6" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="6" height="10" title="1" alt="1"/></td><td class="ctr2" id="e17">50%</td><td class="ctr1" id="f4">1</td><td class="ctr2" id="g9">2</td><td class="ctr1" id="h4">1</td><td class="ctr2" id="i7">4</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a45"><a href="Option.java.html#L220" class="el_method">setType(Object)</a></td><td class="bar" id="b4"><img src="../.resources/redbar.gif" width="9" height="10" title="5" alt="5"/></td><td class="ctr2" id="c46">0%</td><td class="bar" id="d20"/><td class="ctr2" id="e20">n/a</td><td class="ctr1" id="f5">1</td><td class="ctr2" id="g20 ">1</td><td class="ctr1" id="h2">2</td><td class="ctr2" id="i10">2</td><td class="ctr1" id="j1">1</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a2"><a href="Option.java.html#L709" class="el_method">addValue(String)</a></td><td class="bar" id="b5"><img src="../.resources/redbar.gif" width="9" height="10" title="5" alt="5"/></td><td class="ctr2" id="c47">0%</td><td class="bar" id="d21"/><td class="ctr2" id="e21">n/a</td><td class="ctr1" id="f6">1</td><td class="ctr2" id="g21">1</td><td class="ctr1" id="h5">1</td><td class="ctr2" id="i23">1</td><td class="ctr1" id="j2">1</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a8"><a href="Option.java.html#L626" class="el_method">equals(Object)</a></td><td class="bar" id="b6"><img src="../.resources/redbar.gif" width="3" height="10" title="2" alt="2"/><img src="../.resources/greenbar.gif" width="88" height="10" title="47" alt="47"/></td><td class="ctr2" id="c41">96%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width ="33" height="10" title="5" alt="5"/><img src="../.resources/greenbar.gif" width="86" height="10" title="13" alt="13"/></td><td class="ctr2" id="e15">72%</td><td class="ctr1" id="f0">5</td><td class="ctr2" id="g0">10</td><td class="ctr1" id="h6">1</td><td class="ctr2" id="i4">10</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr><tr><td id="a36"><a href="Option.java.html#L454" class="el_method">processValue(String)</a></td><td class="bar" id="b7"><img src="../.resources/redbar.gif" width="1" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="78" height="10" title="42" alt="42"/></td><td class="ctr2" id="c40">98%</td><td class="bar" id="d4"><img src="../.resources/redbar.gif" width="6" height="10" title="1" alt="1"/><img src="../.resources/greenbar.gif" width="33" height="10" title="5" alt="5"/></td><td class="ctr2" id="e13">83%</td><td class="ctr1" id="f7">1</td><td class="ctr2" id="g3">4</td><td class="ctr1" id="h7">1</td><td class="ctr2 " id="i2">11</td><td class="ctr1" id="j7">0</td><td class="ctr2" id="k7">1</td></tr><tr><td id="a32"><a href="Option.java.html#L72" class="el_method">Option(Option.Builder)</a></td><td class="bar" id="b8"><img src="../.resources/greenbar.gif" width="93" height="10" title="50" alt="50"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d22"/><td class="ctr2" id="e22">n/a</td><td class="ctr1" id="f9">0</td><td class="ctr2" id="g22">1</td><td class="ctr1" id="h8">0</td><td class="ctr2" id="i1">14</td><td class="ctr1" id="j8">0</td><td class="ctr2" id="k8">1</td></tr><tr><td id="a35"><a href="Option.java.html#L72" class="el_method">Option(String, String, boolean, String)</a></td><td class="bar" id="b9"><img src="../.resources/greenbar.gif" width="56" height="10" title="30" alt="30"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d10"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1 " id="f10">0</td><td class="ctr2" id="g10">2</td><td class="ctr1" id="h9">0</td><td class="ctr2" id="i3">11</td><td class="ctr1" id="j9">0</td><td class="ctr2" id="k9">1</td></tr><tr><td id="a0"><a href="Option.java.html#L721" class="el_method">acceptsArg()</a></td><td class="bar" id="b10"><img src="../.resources/greenbar.gif" width="41" height="10" title="22" alt="22"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d3"><img src="../.resources/redbar.gif" width="13" height="10" title="2" alt="2"/><img src="../.resources/greenbar.gif" width="53" height="10" title="8" alt="8"/></td><td class="ctr2" id="e14">80%</td><td class="ctr1" id="f3">2</td><td class="ctr2" id="g1">6</td><td class="ctr1" id="h10">0</td><td class="ctr2" id="i24">1</td><td class="ctr1" id="j10">0</td><td class="ctr2" id="k10">1</td></tr><tr><td id="a37"><a href="Option.java.html#L732" class="el_method">requiresArg()</a></td><td class="bar" id="b11"><img src="../.resources/greenbar.gif" width="30" height ="10" title="16" alt="16"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d6"><img src="../.resources/greenbar.gif" width="26" height="10" title="4" alt="4"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f11">0</td><td class="ctr2" id="g5">3</td><td class="ctr1" id="h11">0</td><td class="ctr2" id="i6">5</td><td class="ctr1" id="j11">0</td><td class="ctr2" id="k11">1</td></tr><tr><td id="a1"><a href="Option.java.html#L497" class="el_method">add(String)</a></td><td class="bar" id="b12"><img src="../.resources/greenbar.gif" width="26" height="10" title="14" alt="14"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d11"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e2">100%</td><td class="ctr1" id="f12">0</td><td class="ctr2" id="g11">2</td><td class="ctr1" id="h12">0</td><td class="ctr2" id="i8">4</td><td class="ctr1" id="j12">0</td><td class="ctr2" id="k12">1</td></tr><tr><td id="a20"><a h ref="Option.java.html#L561" class="el_method">getValues()</a></td><td class="bar" id="b13"><img src="../.resources/greenbar.gif" width="26" height="10" title="14" alt="14"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d12"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e3">100%</td><td class="ctr1" id="f13">0</td><td class="ctr2" id="g12">2</td><td class="ctr1" id="h13">0</td><td class="ctr2" id="i25">1</td><td class="ctr1" id="j13">0</td><td class="ctr2" id="k13">1</td></tr><tr><td id="a25"><a href="Option.java.html#L371" class="el_method">hasArgs()</a></td><td class="bar" id="b14"><img src="../.resources/greenbar.gif" width="22" height="10" title="12" alt="12"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d7"><img src="../.resources/greenbar.gif" width="26" height="10" title="4" alt="4"/></td><td class="ctr2" id="e4">100%</td><td class="ctr1" id="f14">0</td><td class="ctr2" id="g6">3</td><td cla ss="ctr1" id="h14">0</td><td class="ctr2" id="i26">1</td><td class="ctr1" id="j14">0</td><td class="ctr2" id="k14">1</td></tr><tr><td id="a23"><a href="Option.java.html#L290" class="el_method">hasArg()</a></td><td class="bar" id="b15"><img src="../.resources/greenbar.gif" width="20" height="10" title="11" alt="11"/></td><td class="ctr2" id="c7">100%</td><td class="bar" id="d8"><img src="../.resources/greenbar.gif" width="26" height="10" title="4" alt="4"/></td><td class="ctr2" id="e5">100%</td><td class="ctr1" id="f15">0</td><td class="ctr2" id="g7">3</td><td class="ctr1" id="h15">0</td><td class="ctr2" id="i27">1</td><td class="ctr1" id="j15">0</td><td class="ctr2" id="k15">1</td></tr><tr><td id="a24"><a href="Option.java.html#L361" class="el_method">hasArgName()</a></td><td class="bar" id="b16"><img src="../.resources/greenbar.gif" width="20" height="10" title="11" alt="11"/></td><td class="ctr2" id="c8">100%</td><td class="bar" id="d9"><img src="../.resources/greenbar.gif" width= "26" height="10" title="4" alt="4"/></td><td class="ctr2" id="e6">100%</td><td class="ctr1" id="f16">0</td><td class="ctr2" id="g8">3</td><td class="ctr1" id="h16">0</td><td class="ctr2" id="i28">1</td><td class="ctr1" id="j16">0</td><td class="ctr2" id="k16">1</td></tr><tr><td id="a17"><a href="Option.java.html#L515" class="el_method">getValue()</a></td><td class="bar" id="b17"><img src="../.resources/greenbar.gif" width="20" height="10" title="11" alt="11"/></td><td class="ctr2" id="c9">100%</td><td class="bar" id="d13"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e7">100%</td><td class="ctr1" id="f17">0</td><td class="ctr2" id="g13">2</td><td class="ctr1" id="h17">0</td><td class="ctr2" id="i29">1</td><td class="ctr1" id="j17">0</td><td class="ctr2" id="k17">1</td></tr><tr><td id="a18"><a href="Option.java.html#L532" class="el_method">getValue(int)</a></td><td class="bar" id="b18"><img src="../.resources/greenbar.gif" w idth="20" height="10" title="11" alt="11"/></td><td class="ctr2" id="c10">100%</td><td class="bar" id="d14"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e8">100%</td><td class="ctr1" id="f18">0</td><td class="ctr2" id="g14">2</td><td class="ctr1" id="h18">0</td><td class="ctr2" id="i30">1</td><td class="ctr1" id="j18">0</td><td class="ctr2" id="k18">1</td></tr><tr><td id="a13"><a href="Option.java.html#L180" class="el_method">getKey()</a></td><td class="bar" id="b19"><img src="../.resources/greenbar.gif" width="16" height="10" title="9" alt="9"/></td><td class="ctr2" id="c11">100%</td><td class="bar" id="d15"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e9">100%</td><td class="ctr1" id="f19">0</td><td class="ctr2" id="g15">2</td><td class="ctr1" id="h19">0</td><td class="ctr2" id="i31">1</td><td class="ctr1" id="j19">0</td><td class="ctr2" id="k19">1</td></tr><tr ><td id="a19"><a href="Option.java.html#L547" >class="el_method">getValue(String)</a></td><td class="bar" id="b20"><img >src="../.resources/greenbar.gif" width="16" height="10" title="9" >alt="9"/></td><td class="ctr2" id="c12">100%</td><td class="bar" >id="d16"><img src="../.resources/greenbar.gif" width="13" height="10" >title="2" alt="2"/></td><td class="ctr2" id="e10">100%</td><td class="ctr1" >id="f20">0</td><td class="ctr2" id="g16">2</td><td class="ctr1" >id="h20">0</td><td class="ctr2" id="i11">2</td><td class="ctr1" >id="j20">0</td><td class="ctr2" id="k20">1</td></tr><tr><td id="a34"><a >href="Option.java.html#L113" class="el_method">Option(String, >String)</a></td><td class="bar" id="b21"><img >src="../.resources/greenbar.gif" width="13" height="10" title="7" >alt="7"/></td><td class="ctr2" id="c13">100%</td><td class="bar" >id="d23"/><td class="ctr2" id="e23">n/a</td><td class="ctr1" >id="f21">0</td><td class="ctr2" id="g23">1</td><td class="ctr1" >id="h21">0</td><td class="ctr2" id="i 12">2</td><td class="ctr1" id="j21">0</td><td class="ctr2" id="k21">1</td></tr><tr><td id="a33"><a href="Option.java.html#L128" class="el_method">Option(String, boolean, String)</a></td><td class="bar" id="b22"><img src="../.resources/greenbar.gif" width="13" height="10" title="7" alt="7"/></td><td class="ctr2" id="c14">100%</td><td class="bar" id="d24"/><td class="ctr2" id="e24">n/a</td><td class="ctr1" id="f22">0</td><td class="ctr2" id="g24">1</td><td class="ctr1" id="h22">0</td><td class="ctr2" id="i13">2</td><td class="ctr1" id="j22">0</td><td class="ctr2" id="k22">1</td></tr><tr><td id="a27"><a href="Option.java.html#L280" class="el_method">hasLongOpt()</a></td><td class="bar" id="b23"><img src="../.resources/greenbar.gif" width="13" height="10" title="7" alt="7"/></td><td class="ctr2" id="c15">100%</td><td class="bar" id="d17"><img src="../.resources/greenbar.gif" width="13" height="10" title="2" alt="2"/></td><td class="ctr2" id="e11">100%</td><td class="ctr1" id="f23">0</td ><td class="ctr2" id="g17">2</td><td class="ctr1" id="h23">0</td><td >class="ctr2" id="i32">1</td><td class="ctr1" id="j23">0</td><td class="ctr2" >id="k23">1</td></tr><tr><td id="a30"><a href="Option.java.html#L413" >class="el_method">hasValueSeparator()</a></td><td class="bar" id="b24"><img >src="../.resources/greenbar.gif" width="13" height="10" title="7" >alt="7"/></td><td class="ctr2" id="c16">100%</td><td class="bar" >id="d18"><img src="../.resources/greenbar.gif" width="13" height="10" >title="2" alt="2"/></td><td class="ctr2" id="e12">100%</td><td class="ctr1" >id="f24">0</td><td class="ctr2" id="g18">2</td><td class="ctr1" >id="h24">0</td><td class="ctr2" id="i33">1</td><td class="ctr1" >id="j24">0</td><td class="ctr2" id="k24">1</td></tr><tr><td id="a5"><a >href="Option.java.html#L766" class="el_method">builder(String)</a></td><td >class="bar" id="b25"><img src="../.resources/greenbar.gif" width="11" >height="10" title="6" alt="6"/></td><td class="ctr2" id="c17">100%</td><td >class="bar " id="d25"/><td class="ctr2" id="e25">n/a</td><td class="ctr1" id="f25">0</td><td class="ctr2" id="g25">1</td><td class="ctr1" id="h25">0</td><td class="ctr2" id="i34">1</td><td class="ctr1" id="j25">0</td><td class="ctr2" id="k25">1</td></tr><tr><td id="a12"><a href="Option.java.html#L169" class="el_method">getId()</a></td><td class="bar" id="b26"><img src="../.resources/greenbar.gif" width="9" height="10" title="5" alt="5"/></td><td class="ctr2" id="c18">100%</td><td class="bar" id="d26"/><td class="ctr2" id="e26">n/a</td><td class="ctr1" id="f26">0</td><td class="ctr2" id="g26">1</td><td class="ctr1" id="h26">0</td><td class="ctr2" id="i35">1</td><td class="ctr1" id="j26">0</td><td class="ctr2" id="k26">1</td></tr><tr><td id="a44"><a href="Option.java.html#L231" class="el_method">setType(Class)</a></td><td class="bar" id="b27"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c19">100%</td><td class="bar" id="d27"/><td class= "ctr2" id="e27">n/a</td><td class="ctr1" id="f27">0</td><td class="ctr2" id="g27">1</td><td class="ctr1" id="h27">0</td><td class="ctr2" id="i14">2</td><td class="ctr1" id="j27">0</td><td class="ctr2" id="k27">1</td></tr><tr><td id="a41"><a href="Option.java.html#L251" class="el_method">setLongOpt(String)</a></td><td class="bar" id="b28"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c20">100%</td><td class="bar" id="d28"/><td class="ctr2" id="e28">n/a</td><td class="ctr1" id="f28">0</td><td class="ctr2" id="g28">1</td><td class="ctr1" id="h28">0</td><td class="ctr2" id="i15">2</td><td class="ctr1" id="j28">0</td><td class="ctr2" id="k28">1</td></tr><tr><td id="a42"><a href="Option.java.html#L262" class="el_method">setOptionalArg(boolean)</a></td><td class="bar" id="b29"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c21">100%</td><td class="bar" id="d29"/><td class="c tr2" id="e29">n/a</td><td class="ctr1" id="f29">0</td><td class="ctr2" id="g29">1</td><td class="ctr1" id="h29">0</td><td class="ctr2" id="i16">2</td><td class="ctr1" id="j29">0</td><td class="ctr2" id="k29">1</td></tr><tr><td id="a40"><a href="Option.java.html#L311" class="el_method">setDescription(String)</a></td><td class="bar" id="b30"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c22">100%</td><td class="bar" id="d30"/><td class="ctr2" id="e30">n/a</td><td class="ctr1" id="f30">0</td><td class="ctr2" id="g30">1</td><td class="ctr1" id="h30">0</td><td class="ctr2" id="i17">2</td><td class="ctr1" id="j30">0</td><td class="ctr2" id="k30">1</td></tr><tr><td id="a43"><a href="Option.java.html#L331" class="el_method">setRequired(boolean)</a></td><td class="bar" id="b31"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c23">100%</td><td class="bar" id="d31"/><td class="ct r2" id="e31">n/a</td><td class="ctr1" id="f31">0</td><td class="ctr2" id="g31">1</td><td class="ctr1" id="h31">0</td><td class="ctr2" id="i18">2</td><td class="ctr1" id="j31">0</td><td class="ctr2" id="k31">1</td></tr><tr><td id="a38"><a href="Option.java.html#L341" class="el_method">setArgName(String)</a></td><td class="bar" id="b32"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c24">100%</td><td class="bar" id="d32"/><td class="ctr2" id="e32">n/a</td><td class="ctr1" id="f32">0</td><td class="ctr2" id="g32">1</td><td class="ctr1" id="h32">0</td><td class="ctr2" id="i19">2</td><td class="ctr1" id="j32">0</td><td class="ctr2" id="k32">1</td></tr><tr><td id="a39"><a href="Option.java.html#L381" class="el_method">setArgs(int)</a></td><td class="bar" id="b33"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c25">100%</td><td class="bar" id="d33"/><td class="ctr2" id="e33"> n/a</td><td class="ctr1" id="f33">0</td><td class="ctr2" id="g33">1</td><td class="ctr1" id="h33">0</td><td class="ctr2" id="i20">2</td><td class="ctr1" id="j33">0</td><td class="ctr2" id="k33">1</td></tr><tr><td id="a46"><a href="Option.java.html#L392" class="el_method">setValueSeparator(char)</a></td><td class="bar" id="b34"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c26">100%</td><td class="bar" id="d34"/><td class="ctr2" id="e34">n/a</td><td class="ctr1" id="f34">0</td><td class="ctr2" id="g34">1</td><td class="ctr1" id="h34">0</td><td class="ctr2" id="i21">2</td><td class="ctr1" id="j34">0</td><td class="ctr2" id="k34">1</td></tr><tr><td id="a28"><a href="Option.java.html#L620" class="el_method">hasNoValues()</a></td><td class="bar" id="b35"><img src="../.resources/greenbar.gif" width="7" height="10" title="4" alt="4"/></td><td class="ctr2" id="c27">100%</td><td class="bar" id="d35"/><td class="ctr2" id="e35">n/a</td ><td class="ctr1" id="f35">0</td><td class="ctr2" id="g35">1</td><td >class="ctr1" id="h35">0</td><td class="ctr2" id="i36">1</td><td class="ctr1" >id="j35">0</td><td class="ctr2" id="k35">1</td></tr><tr><td id="a6"><a >href="Option.java.html#L694" class="el_method">clearValues()</a></td><td >class="bar" id="b36"><img src="../.resources/greenbar.gif" width="7" >height="10" title="4" alt="4"/></td><td class="ctr2" id="c28">100%</td><td >class="bar" id="d36"/><td class="ctr2" id="e36">n/a</td><td class="ctr1" >id="f36">0</td><td class="ctr2" id="g36">1</td><td class="ctr1" >id="h36">0</td><td class="ctr2" id="i22">2</td><td class="ctr1" >id="j36">0</td><td class="ctr2" id="k36">1</td></tr><tr><td id="a15"><a >href="Option.java.html#L195" class="el_method">getOpt()</a></td><td >class="bar" id="b37"><img src="../.resources/greenbar.gif" width="5" >height="10" title="3" alt="3"/></td><td class="ctr2" id="c29">100%</td><td >class="bar" id="d37"/><td class="ctr2" id="e37">n/a</td><td class="ctr1" id="f 37">0</td><td class="ctr2" id="g37">1</td><td class="ctr1" id="h37">0</td><td class="ctr2" id="i37">1</td><td class="ctr1" id="j37">0</td><td class="ctr2" id="k37">1</td></tr><tr><td id="a16"><a href="Option.java.html#L205" class="el_method">getType()</a></td><td class="bar" id="b38"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c30">100%</td><td class="bar" id="d38"/><td class="ctr2" id="e38">n/a</td><td class="ctr1" id="f38">0</td><td class="ctr2" id="g38">1</td><td class="ctr1" id="h38">0</td><td class="ctr2" id="i38">1</td><td class="ctr1" id="j38">0</td><td class="ctr2" id="k38">1</td></tr><tr><td id="a14"><a href="Option.java.html#L241" class="el_method">getLongOpt()</a></td><td class="bar" id="b39"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c31">100%</td><td class="bar" id="d39"/><td class="ctr2" id="e39">n/a</td><td class="ctr1" id="f39">0</td><td class="c tr2" id="g39">1</td><td class="ctr1" id="h39">0</td><td class="ctr2" id="i39">1</td><td class="ctr1" id="j39">0</td><td class="ctr2" id="k39">1</td></tr><tr><td id="a29"><a href="Option.java.html#L270" class="el_method">hasOptionalArg()</a></td><td class="bar" id="b40"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c32">100%</td><td class="bar" id="d40"/><td class="ctr2" id="e40">n/a</td><td class="ctr1" id="f40">0</td><td class="ctr2" id="g40">1</td><td class="ctr1" id="h40">0</td><td class="ctr2" id="i40">1</td><td class="ctr1" id="j40">0</td><td class="ctr2" id="k40">1</td></tr><tr><td id="a11"><a href="Option.java.html#L300" class="el_method">getDescription()</a></td><td class="bar" id="b41"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c33">100%</td><td class="bar" id="d41"/><td class="ctr2" id="e41">n/a</td><td class="ctr1" id="f41">0</td><td class="ctr2" id="g4 1">1</td><td class="ctr1" id="h41">0</td><td class="ctr2" id="i41">1</td><td class="ctr1" id="j41">0</td><td class="ctr2" id="k41">1</td></tr><tr><td id="a31"><a href="Option.java.html#L321" class="el_method">isRequired()</a></td><td class="bar" id="b42"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c34">100%</td><td class="bar" id="d42"/><td class="ctr2" id="e42">n/a</td><td class="ctr1" id="f42">0</td><td class="ctr2" id="g42">1</td><td class="ctr1" id="h42">0</td><td class="ctr2" id="i42">1</td><td class="ctr1" id="j42">0</td><td class="ctr2" id="k42">1</td></tr><tr><td id="a9"><a href="Option.java.html#L351" class="el_method">getArgName()</a></td><td class="bar" id="b43"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c35">100%</td><td class="bar" id="d43"/><td class="ctr2" id="e43">n/a</td><td class="ctr1" id="f43">0</td><td class="ctr2" id="g43">1</td><td class=" ctr1" id="h43">0</td><td class="ctr2" id="i43">1</td><td class="ctr1" id="j43">0</td><td class="ctr2" id="k43">1</td></tr><tr><td id="a21"><a href="Option.java.html#L402" class="el_method">getValueSeparator()</a></td><td class="bar" id="b44"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c36">100%</td><td class="bar" id="d44"/><td class="ctr2" id="e44">n/a</td><td class="ctr1" id="f44">0</td><td class="ctr2" id="g44">1</td><td class="ctr1" id="h44">0</td><td class="ctr2" id="i44">1</td><td class="ctr1" id="j44">0</td><td class="ctr2" id="k44">1</td></tr><tr><td id="a10"><a href="Option.java.html#L423" class="el_method">getArgs()</a></td><td class="bar" id="b45"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c37">100%</td><td class="bar" id="d45"/><td class="ctr2" id="e45">n/a</td><td class="ctr1" id="f45">0</td><td class="ctr2" id="g45">1</td><td class="ctr1" id="h45"> 0</td><td class="ctr2" id="i45">1</td><td class="ctr1" id="j45">0</td><td class="ctr2" id="k45">1</td></tr><tr><td id="a22"><a href="Option.java.html#L570" class="el_method">getValuesList()</a></td><td class="bar" id="b46"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c38">100%</td><td class="bar" id="d46"/><td class="ctr2" id="e46">n/a</td><td class="ctr1" id="f46">0</td><td class="ctr2" id="g46">1</td><td class="ctr1" id="h46">0</td><td class="ctr2" id="i46">1</td><td class="ctr1" id="j46">0</td><td class="ctr2" id="k46">1</td></tr><tr><td id="a4"><a href="Option.java.html#L752" class="el_method">builder()</a></td><td class="bar" id="b47"><img src="../.resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c39">100%</td><td class="bar" id="d47"/><td class="ctr2" id="e47">n/a</td><td class="ctr1" id="f47">0</td><td class="ctr2" id="g47">1</td><td class="ctr1" id="h47">0</td><td class="ctr 2" id="i47">1</td><td class="ctr1" id="j47">0</td><td class="ctr2" id="k47">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html> \ No newline at end of file Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.html ------------------------------------------------------------------------------ svn:eol-style = native Added: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.java.html ============================================================================== --- websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.java.html (added) +++ websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.java.html Sat May 9 18:19:15 2015 @@ -0,0 +1,1007 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>Option.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons CLI</a> > <a href="index.source.html" class="el_package">org.apache.commons.cli</a> > <span class="el_source">Option.java</span></div><h1>Option.java< /h1><pre class="source lang-java linenums">/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.cli; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 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. + * <p> + * An Option is not created independently, but is created through + * an instance of {@link Options}. An Option is required to have + * at least a short or a long-name. + * <p> + * <b>Note:</b> once an {@link Option} has been added to an instance + * of {@link Options}, it's required flag may not be changed anymore. + * + * @see org.apache.commons.cli.Options + * @see org.apache.commons.cli.CommandLine + * + * @version $Id: Option.java 1677406 2015-05-03 14:27:31Z britter $ + */ +public class Option implements Cloneable, Serializable +{ + /** constant that specifies the number of argument values has not been specified */ + public static final int UNINITIALIZED = -1; + + /** constant that specifies the number of argument values is infinite */ + public static final int UNLIMITED_VALUES = -2; + + /** The serial version UID. */ + private static final long serialVersionUID = 1L; + + /** the name of the option */ + private final String opt; + + /** the long representation of the option */ + private String longOpt; + + /** the name of the argument for this option */ + private String argName; + + /** description of the option */ + private String description; + + /** specifies whether this option is required to be present */ + private boolean required; + + /** specifies whether the argument value of this Option is optional */ + private boolean optionalArg; + + /** the number of argument values this option can have */ +<span class="fc" id="L72"> private int numberOfArgs = UNINITIALIZED;</span> + + /** the type of this Option */ +<span class="fc" id="L75"> private Class<?> type = String.class;</span> + + /** the list of argument values **/ +<span class="fc" id="L78"> private List<String> values = new ArrayList<String>();</span> + + /** the character that is the value separator */ + private char valuesep; + + /** + * Private constructor used by the nested Builder class. + * + * @param builder builder used to create this option + */ + private Option(final Builder builder) +<span class="fc" id="L89"> {</span> +<span class="fc" id="L90"> this.argName = builder.argName;</span> +<span class="fc" id="L91"> this.description = builder.description;</span> +<span class="fc" id="L92"> this.longOpt = builder.longOpt;</span> +<span class="fc" id="L93"> this.numberOfArgs = builder.numberOfArgs;</span> +<span class="fc" id="L94"> this.opt = builder.opt;</span> +<span class="fc" id="L95"> this.optionalArg = builder.optionalArg;</span> +<span class="fc" id="L96"> this.required = builder.required;</span> +<span class="fc" id="L97"> this.type = builder.type;</span> +<span class="fc" id="L98"> this.valuesep = builder.valuesep;</span> +<span class="fc" id="L99"> }</span> + + /** + * Creates an Option using the specified parameters. + * The option does not take an argument. + * + * @param opt short representation of the option + * @param description describes the function of the option + * + * @throws IllegalArgumentException if there are any non valid + * Option characters in <code>opt</code>. + */ + public Option(String opt, String description) throws IllegalArgumentException + { +<span class="fc" id="L113"> this(opt, null, false, description);</span> +<span class="fc" id="L114"> }</span> + + /** + * Creates an Option using the specified parameters. + * + * @param opt short representation of the option + * @param hasArg specifies whether the Option takes an argument or not + * @param description describes the function of the option + * + * @throws IllegalArgumentException if there are any non valid + * Option characters in <code>opt</code>. + */ + public Option(String opt, boolean hasArg, String description) throws IllegalArgumentException + { +<span class="fc" id="L128"> this(opt, null, hasArg, description);</span> +<span class="fc" id="L129"> }</span> + + /** + * Creates an Option using the specified parameters. + * + * @param opt short representation of the option + * @param longOpt the long representation of the option + * @param hasArg specifies whether the Option takes an argument or not + * @param description describes the function of the option + * + * @throws IllegalArgumentException if there are any non valid + * Option characters in <code>opt</code>. + */ + public Option(String opt, String longOpt, boolean hasArg, String description) + throws IllegalArgumentException +<span class="fc" id="L144"> {</span> + // ensure that the option is valid +<span class="fc" id="L146"> OptionValidator.validateOption(opt);</span> + +<span class="fc" id="L148"> this.opt = opt;</span> +<span class="fc" id="L149"> this.longOpt = longOpt;</span> + + // if hasArg is set then the number of arguments is 1 +<span class="fc bfc" id="L152" title="All 2 branches covered."> if (hasArg)</span> + { +<span class="fc" id="L154"> this.numberOfArgs = 1;</span> + } + +<span class="fc" id="L157"> this.description = description;</span> +<span class="fc" id="L158"> }</span> + + /** + * Returns the id of this Option. This is only set when the + * Option shortOpt is a single character. This is used for switch + * statements. + * + * @return the id of this Option + */ + public int getId() + { +<span class="fc" id="L169"> return getKey().charAt(0);</span> + } + + /** + * Returns the 'unique' Option identifier. + * + * @return the 'unique' Option identifier + */ + String getKey() + { + // if 'opt' is null, then it is a 'long' option +<span class="fc bfc" id="L180" title="All 2 branches covered."> return (opt == null) ? longOpt : opt;</span> + } + + /** + * Retrieve the name of this Option. + * + * It is this String which can be used with + * {@link CommandLine#hasOption(String opt)} and + * {@link CommandLine#getOptionValue(String opt)} to check + * for existence and argument. + * + * @return The name of this option + */ + public String getOpt() + { +<span class="fc" id="L195"> return opt;</span> + } + + /** + * Retrieve the type of this Option. + * + * @return The type of this option + */ + public Object getType() + { +<span class="fc" id="L205"> return type;</span> + } + + /** + * Sets the type of this Option. + * <p> + * <b>Note:</b> this method is kept for binary compatibility and the + * input type is supposed to be a {@link Class} object. + * + * @param type the type of this Option + * @deprecated since 1.3, use {@link #setType(Class)} instead + */ + @Deprecated + public void setType(Object type) + { +<span class="nc" id="L220"> setType((Class<?>) type);</span> +<span class="nc" id="L221"> }</span> + + /** + * Sets the type of this Option. + * + * @param type the type of this Option + * @since 1.3 + */ + public void setType(Class<?> type) + { +<span class="fc" id="L231"> this.type = type;</span> +<span class="fc" id="L232"> }</span> + + /** + * Retrieve the long name of this Option. + * + * @return Long name of this option, or null, if there is no long name + */ + public String getLongOpt() + { +<span class="fc" id="L241"> return longOpt;</span> + } + + /** + * Sets the long name of this Option. + * + * @param longOpt the long name of this Option + */ + public void setLongOpt(String longOpt) + { +<span class="fc" id="L251"> this.longOpt = longOpt;</span> +<span class="fc" id="L252"> }</span> + + /** + * Sets whether this Option can have an optional argument. + * + * @param optionalArg specifies whether the Option can have + * an optional argument. + */ + public void setOptionalArg(boolean optionalArg) + { +<span class="fc" id="L262"> this.optionalArg = optionalArg;</span> +<span class="fc" id="L263"> }</span> + + /** + * @return whether this Option can have an optional argument + */ + public boolean hasOptionalArg() + { +<span class="fc" id="L270"> return optionalArg;</span> + } + + /** + * Query to see if this Option has a long name + * + * @return boolean flag indicating existence of a long name + */ + public boolean hasLongOpt() + { +<span class="fc bfc" id="L280" title="All 2 branches covered."> return longOpt != null;</span> + } + + /** + * Query to see if this Option requires an argument + * + * @return boolean flag indicating if an argument is required + */ + public boolean hasArg() + { +<span class="fc bfc" id="L290" title="All 4 branches covered."> return numberOfArgs > 0 || numberOfArgs == UNLIMITED_VALUES;</span> + } + + /** + * Retrieve the self-documenting description of this Option + * + * @return The string description of this option + */ + public String getDescription() + { +<span class="fc" id="L300"> return description;</span> + } + + /** + * Sets the self-documenting description of this Option + * + * @param description The description of this option + * @since 1.1 + */ + public void setDescription(String description) + { +<span class="fc" id="L311"> this.description = description;</span> +<span class="fc" id="L312"> }</span> + + /** + * Query to see if this Option is mandatory + * + * @return boolean flag indicating whether this Option is mandatory + */ + public boolean isRequired() + { +<span class="fc" id="L321"> return required;</span> + } + + /** + * Sets whether this Option is mandatory. + * + * @param required specifies whether this Option is mandatory + */ + public void setRequired(boolean required) + { +<span class="fc" id="L331"> this.required = required;</span> +<span class="fc" id="L332"> }</span> + + /** + * Sets the display name for the argument value. + * + * @param argName the display name for the argument value. + */ + public void setArgName(String argName) + { +<span class="fc" id="L341"> this.argName = argName;</span> +<span class="fc" id="L342"> }</span> + + /** + * Gets the display name for the argument value. + * + * @return the display name for the argument value. + */ + public String getArgName() + { +<span class="fc" id="L351"> return argName;</span> + } + + /** + * Returns whether the display name for the argument value has been set. + * + * @return if the display name for the argument value has been set. + */ + public boolean hasArgName() + { +<span class="fc bfc" id="L361" title="All 4 branches covered."> return argName != null && argName.length() > 0;</span> + } + + /** + * Query to see if this Option can take many values. + * + * @return boolean flag indicating if multiple values are allowed + */ + public boolean hasArgs() + { +<span class="fc bfc" id="L371" title="All 4 branches covered."> return numberOfArgs > 1 || numberOfArgs == UNLIMITED_VALUES;</span> + } + + /** + * Sets the number of argument values this Option can take. + * + * @param num the number of argument values + */ + public void setArgs(int num) + { +<span class="fc" id="L381"> this.numberOfArgs = num;</span> +<span class="fc" id="L382"> }</span> + + /** + * Sets the value separator. For example if the argument value + * was a Java property, the value separator would be '='. + * + * @param sep The value separator. + */ + public void setValueSeparator(char sep) + { +<span class="fc" id="L392"> this.valuesep = sep;</span> +<span class="fc" id="L393"> }</span> + + /** + * Returns the value separator character. + * + * @return the value separator character. + */ + public char getValueSeparator() + { +<span class="fc" id="L402"> return valuesep;</span> + } + + /** + * Return whether this Option has specified a value separator. + * + * @return whether this Option has specified a value separator. + * @since 1.1 + */ + public boolean hasValueSeparator() + { +<span class="fc bfc" id="L413" title="All 2 branches covered."> return valuesep > 0;</span> + } + + /** + * Returns the number of argument values this Option can take. + * + * @return num the number of argument values + */ + public int getArgs() + { +<span class="fc" id="L423"> return numberOfArgs;</span> + } + + /** + * Adds the specified value to this Option. + * + * @param value is a/the value of this Option + */ + void addValueForProcessing(String value) + { +<span class="pc bpc" id="L433" title="1 of 2 branches missed."> if (numberOfArgs == UNINITIALIZED)</span> + { +<span class="nc" id="L435"> throw new RuntimeException("NO_ARGS_ALLOWED");</span> + } +<span class="fc" id="L437"> processValue(value);</span> +<span class="fc" id="L438"> }</span> + + /** + * Processes the value. If this Option has a value separator + * the value will have to be parsed into individual tokens. When + * n-1 tokens have been processed and there are more value separators + * in the value, parsing is ceased and the remaining characters are + * added as a single token. + * + * @param value The String to be processed. + * + * @since 1.0.1 + */ + private void processValue(String value) + { + // this Option has a separator character +<span class="fc bfc" id="L454" title="All 2 branches covered."> if (hasValueSeparator())</span> + { + // get the separator character +<span class="fc" id="L457"> char sep = getValueSeparator();</span> + + // store the index for the value separator +<span class="fc" id="L460"> int index = value.indexOf(sep);</span> + + // while there are more value separators +<span class="fc bfc" id="L463" title="All 2 branches covered."> while (index != -1)</span> + { + // next value to be added +<span class="pc bpc" id="L466" title="1 of 2 branches missed."> if (values.size() == numberOfArgs - 1)</span> + { +<span class="nc" id="L468"> break;</span> + } + + // store +<span class="fc" id="L472"> add(value.substring(0, index));</span> + + // parse +<span class="fc" id="L475"> value = value.substring(index + 1);</span> + + // get new index +<span class="fc" id="L478"> index = value.indexOf(sep);</span> + } + } + + // store the actual value or the last value that has been parsed +<span class="fc" id="L483"> add(value);</span> +<span class="fc" id="L484"> }</span> + + /** + * Add the value to this Option. If the number of arguments + * is greater than zero and there is enough space in the list then + * add the value. Otherwise, throw a runtime exception. + * + * @param value The value to be added to this Option + * + * @since 1.0.1 + */ + private void add(String value) + { +<span class="fc bfc" id="L497" title="All 2 branches covered."> if (!acceptsArg())</span> + { +<span class="fc" id="L499"> throw new RuntimeException("Cannot add value, list full.");</span> + } + + // store value +<span class="fc" id="L503"> values.add(value);</span> +<span class="fc" id="L504"> }</span> + + /** + * Returns the specified value of this Option or + * <code>null</code> if there is no value. + * + * @return the value/first value of this Option or + * <code>null</code> if there is no value. + */ + public String getValue() + { +<span class="fc bfc" id="L515" title="All 2 branches covered."> return hasNoValues() ? null : values.get(0);</span> + } + + /** + * Returns the specified value of this Option or + * <code>null</code> if there is no value. + * + * @param index The index of the value to be returned. + * + * @return the specified value of this Option or + * <code>null</code> if there is no value. + * + * @throws IndexOutOfBoundsException if index is less than 1 + * or greater than the number of the values for this Option. + */ + public String getValue(int index) throws IndexOutOfBoundsException + { +<span class="fc bfc" id="L532" title="All 2 branches covered."> return hasNoValues() ? null : values.get(index);</span> + } + + /** + * Returns the value/first value of this Option or the + * <code>defaultValue</code> if there is no value. + * + * @param defaultValue The value to be returned if there + * is no value. + * + * @return the value/first value of this Option or the + * <code>defaultValue</code> if there are no values. + */ + public String getValue(String defaultValue) + { +<span class="fc" id="L547"> String value = getValue();</span> + +<span class="fc bfc" id="L549" title="All 2 branches covered."> return (value != null) ? value : defaultValue;</span> + } + + /** + * Return the values of this Option as a String array + * or null if there are no values + * + * @return the values of this Option as a String array + * or null if there are no values + */ + public String[] getValues() + { +<span class="fc bfc" id="L561" title="All 2 branches covered."> return hasNoValues() ? null : values.toArray(new String[values.size()]);</span> + } + + /** + * @return the values of this Option as a List + * or null if there are no values + */ + public List<String> getValuesList() + { +<span class="fc" id="L570"> return values;</span> + } + + /** + * Dump state, suitable for debugging. + * + * @return Stringified form of this object + */ + @Override + public String toString() + { +<span class="fc" id="L581"> StringBuilder buf = new StringBuilder().append("[ option: ");</span> + +<span class="fc" id="L583"> buf.append(opt);</span> + +<span class="pc bpc" id="L585" title="1 of 2 branches missed."> if (longOpt != null)</span> + { +<span class="fc" id="L587"> buf.append(" ").append(longOpt);</span> + } + +<span class="fc" id="L590"> buf.append(" ");</span> + +<span class="pc bpc" id="L592" title="1 of 2 branches missed."> if (hasArgs())</span> + { +<span class="nc" id="L594"> buf.append("[ARG...]");</span> + } +<span class="fc bfc" id="L596" title="All 2 branches covered."> else if (hasArg())</span> + { +<span class="fc" id="L598"> buf.append(" [ARG]");</span> + } + +<span class="fc" id="L601"> buf.append(" :: ").append(description);</span> + +<span class="pc bpc" id="L603" title="1 of 2 branches missed."> if (type != null)</span> + { +<span class="fc" id="L605"> buf.append(" :: ").append(type);</span> + } + +<span class="fc" id="L608"> buf.append(" ]");</span> + +<span class="fc" id="L610"> return buf.toString();</span> + } + + /** + * Returns whether this Option has any values. + * + * @return whether this Option has any values. + */ + private boolean hasNoValues() + { +<span class="fc" id="L620"> return values.isEmpty();</span> + } + + @Override + public boolean equals(Object o) + { +<span class="fc bfc" id="L626" title="All 2 branches covered."> if (this == o)</span> + { +<span class="fc" id="L628"> return true;</span> + } +<span class="pc bpc" id="L630" title="2 of 4 branches missed."> if (o == null || getClass() != o.getClass())</span> + { +<span class="nc" id="L632"> return false;</span> + } + +<span class="fc" id="L635"> Option option = (Option) o;</span> + + +<span class="pc bpc" id="L638" title="1 of 6 branches missed."> if (opt != null ? !opt.equals(option.opt) : option.opt != null)</span> + { +<span class="fc" id="L640"> return false;</span> + } +<span class="pc bpc" id="L642" title="2 of 6 branches missed."> if (longOpt != null ? !longOpt.equals(option.longOpt) : option.longOpt != null)</span> + { +<span class="fc" id="L644"> return false;</span> + } + +<span class="fc" id="L647"> return true;</span> + } + + @Override + public int hashCode() + { + int result; +<span class="nc bnc" id="L654" title="All 2 branches missed."> result = opt != null ? opt.hashCode() : 0;</span> +<span class="nc bnc" id="L655" title="All 2 branches missed."> result = 31 * result + (longOpt != null ? longOpt.hashCode() : 0);</span> +<span class="nc" id="L656"> return result;</span> + } + + /** + * A rather odd clone method - due to incorrect code in 1.0 it is public + * and in 1.1 rather than throwing a CloneNotSupportedException it throws + * a RuntimeException so as to maintain backwards compat at the API level. + * + * After calling this method, it is very likely you will want to call + * clearValues(). + * + * @return a clone of this Option instance + * @throws RuntimeException if a {@link CloneNotSupportedException} has been thrown + * by {@code super.clone()} + */ + @Override + public Object clone() + { + try + { +<span class="fc" id="L676"> Option option = (Option) super.clone();</span> +<span class="fc" id="L677"> option.values = new ArrayList<String>(values);</span> +<span class="fc" id="L678"> return option;</span> + } +<span class="nc" id="L680"> catch (CloneNotSupportedException cnse)</span> + { +<span class="nc" id="L682"> throw new RuntimeException("A CloneNotSupportedException was thrown: " + cnse.getMessage());</span> + } + } + + /** + * Clear the Option values. After a parse is complete, these are left with + * data in them and they need clearing if another parse is done. + * + * See: <a href="https://issues.apache.org/jira/browse/CLI-71">CLI-71</a> + */ + void clearValues() + { +<span class="fc" id="L694"> values.clear();</span> +<span class="fc" id="L695"> }</span> + + /** + * This method is not intended to be used. It was a piece of internal + * API that was made public in 1.0. It currently throws an UnsupportedOperationException. + * + * @param value the value to add + * @return always throws an {@link UnsupportedOperationException} + * @throws UnsupportedOperationException always + * @deprecated + */ + @Deprecated + public boolean addValue(String value) + { +<span class="nc" id="L709"> throw new UnsupportedOperationException("The addValue method is not intended for client use. "</span> + + "Subclasses should use the addValueForProcessing method instead. "); + } + + /** + * Tells if the option can accept more arguments. + * + * @return false if the maximum number of arguments is reached + * @since 1.3 + */ + boolean acceptsArg() + { +<span class="pc bpc" id="L721" title="2 of 10 branches missed."> return (hasArg() || hasArgs() || hasOptionalArg()) && (numberOfArgs <= 0 || values.size() < numberOfArgs);</span> + } + + /** + * Tells if the option requires more arguments to be valid. + * + * @return false if the option doesn't require more arguments + * @since 1.3 + */ + boolean requiresArg() + { +<span class="fc bfc" id="L732" title="All 2 branches covered."> if (optionalArg)</span> + { +<span class="fc" id="L734"> return false;</span> + } +<span class="fc bfc" id="L736" title="All 2 branches covered."> if (numberOfArgs == UNLIMITED_VALUES)</span> + { +<span class="fc" id="L738"> return values.isEmpty();</span> + } +<span class="fc" id="L740"> return acceptsArg();</span> + } + + /** + * Returns a {@link Builder} to create an {@link Option} using descriptive + * methods. + * + * @return a new {@link Builder} instance + * @since 1.3 + */ + public static Builder builder() + { +<span class="fc" id="L752"> return builder(null);</span> + } + + /** + * Returns a {@link Builder} to create an {@link Option} using descriptive + * methods. + * + * @param opt short representation of the option + * @return a new {@link Builder} instance + * @throws IllegalArgumentException if there are any non valid Option characters in {@code opt} + * @since 1.3 + */ + public static Builder builder(final String opt) + { +<span class="fc" id="L766"> return new Builder(opt);</span> + } + + /** + * A nested builder class to create <code>Option</code> instances + * using descriptive methods. + * <p> + * Example usage: + * <pre> + * Option option = Option.builder("a") + * .required(true) + * .longOpt("arg-name") + * .build(); + * </pre> + * + * @since 1.3 + */ + public static final class Builder + { + /** the name of the option */ + private final String opt; + + /** description of the option */ + private String description; + + /** the long representation of the option */ + private String longOpt; + + /** the name of the argument for this option */ + private String argName; + + /** specifies whether this option is required to be present */ + private boolean required; + + /** specifies whether the argument value of this Option is optional */ + private boolean optionalArg; + + /** the number of argument values this option can have */ +<span class="fc" id="L804"> private int numberOfArgs = UNINITIALIZED;</span> + + /** the type of this Option */ +<span class="fc" id="L807"> private Class<?> type = String.class;</span> + + /** the character that is the value separator */ + private char valuesep; + + /** + * Constructs a new <code>Builder</code> with the minimum + * required parameters for an <code>Option</code> instance. + * + * @param opt short representation of the option + * @throws IllegalArgumentException if there are any non valid Option characters in {@code opt} + */ + private Builder(final String opt) throws IllegalArgumentException +<span class="fc" id="L820"> {</span> +<span class="fc" id="L821"> OptionValidator.validateOption(opt);</span> +<span class="fc" id="L822"> this.opt = opt;</span> +<span class="fc" id="L823"> }</span> + + /** + * Sets the display name for the argument value. + * + * @param argName the display name for the argument value. + * @return this builder, to allow method chaining + */ + public Builder argName(final String argName) + { +<span class="fc" id="L833"> this.argName = argName;</span> +<span class="fc" id="L834"> return this;</span> + } + + /** + * Sets the description for this option. + * + * @param description the description of the option. + * @return this builder, to allow method chaining + */ + public Builder desc(final String description) + { +<span class="fc" id="L845"> this.description = description;</span> +<span class="fc" id="L846"> return this;</span> + } + + /** + * Sets the long name of the Option. + * + * @param longOpt the long name of the Option + * @return this builder, to allow method chaining + */ + public Builder longOpt(final String longOpt) + { +<span class="fc" id="L857"> this.longOpt = longOpt;</span> +<span class="fc" id="L858"> return this;</span> + } + + /** + * Sets the number of argument values the Option can take. + * + * @param numberOfArgs the number of argument values + * @return this builder, to allow method chaining + */ + public Builder numberOfArgs(final int numberOfArgs) + { +<span class="fc" id="L869"> this.numberOfArgs = numberOfArgs;</span> +<span class="fc" id="L870"> return this;</span> + } + + /** + * Sets whether the Option can have an optional argument. + * + * @param isOptional specifies whether the Option can have + * an optional argument. + * @return this builder, to allow method chaining + */ + public Builder optionalArg(final boolean isOptional) + { +<span class="fc" id="L882"> this.optionalArg = isOptional;</span> +<span class="fc" id="L883"> return this;</span> + } + + /** + * Marks this Option as required. + * + * @return this builder, to allow method chaining + */ + public Builder required() + { +<span class="nc" id="L893"> return required(true);</span> + } + + /** + * Sets whether the Option is mandatory. + * + * @param required specifies whether the Option is mandatory + * @return this builder, to allow method chaining + */ + public Builder required(final boolean required) + { +<span class="fc" id="L904"> this.required = required;</span> +<span class="fc" id="L905"> return this;</span> + } + + /** + * Sets the type of the Option. + * + * @param type the type of the Option + * @return this builder, to allow method chaining + */ + public Builder type(final Class<?> type) + { +<span class="fc" id="L916"> this.type = type;</span> +<span class="fc" id="L917"> return this;</span> + } + + /** + * The Option will use '=' as a means to separate argument value. + * + * @return this builder, to allow method chaining + */ + public Builder valueSeparator() + { +<span class="fc" id="L927"> return valueSeparator('=');</span> + } + + /** + * The Option will use <code>sep</code> as a means to + * separate argument values. + * <p> + * <b>Example:</b> + * <pre> + * Option opt = Option.builder("D").hasArgs() + * .valueSeparator('=') + * .build(); + * Options options = new Options(); + * options.addOption(opt); + * String[] args = {"-Dkey=value"}; + * CommandLineParser parser = new DefaultParser(); + * CommandLine line = parser.parse(options, args); + * String propertyName = line.getOptionValues("D")[0]; // will be "key" + * String propertyValue = line.getOptionValues("D")[1]; // will be "value" + * </pre> + * + * @param sep The value separator. + * @return this builder, to allow method chaining + */ + public Builder valueSeparator(final char sep) + { +<span class="fc" id="L953"> valuesep = sep;</span> +<span class="fc" id="L954"> return this;</span> + } + + /** + * Indicates that the Option will require an argument. + * + * @return this builder, to allow method chaining + */ + public Builder hasArg() + { +<span class="fc" id="L964"> return hasArg(true);</span> + } + + /** + * Indicates if the Option has an argument or not. + * + * @param hasArg specifies whether the Option takes an argument or not + * @return this builder, to allow method chaining + */ + public Builder hasArg(final boolean hasArg) + { + // set to UNINITIALIZED when no arg is specified to be compatible with OptionBuilder +<span class="fc bfc" id="L976" title="All 2 branches covered."> numberOfArgs = hasArg ? 1 : Option.UNINITIALIZED;</span> +<span class="fc" id="L977"> return this;</span> + } + + /** + * Indicates that the Option can have unlimited argument values. + * + * @return this builder, to allow method chaining + */ + public Builder hasArgs() + { +<span class="nc" id="L987"> numberOfArgs = Option.UNLIMITED_VALUES;</span> +<span class="nc" id="L988"> return this;</span> + } + + /** + * Constructs an Option with the values declared by this {@link Builder}. + * + * @return the new {@link Option} + * @throws IllegalArgumentException if neither {@code opt} or {@code longOpt} has been set + */ + public Option build() + { +<span class="fc bfc" id="L999" title="All 4 branches covered."> if (opt == null && longOpt == null)</span> + { +<span class="fc" id="L1001"> throw new IllegalArgumentException("Either opt or longOpt must be specified");</span> + } +<span class="fc" id="L1003"> return new Option(this);</span> + } + } +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span></div></body></html> \ No newline at end of file Propchange: websites/production/commons/content/proper/commons-cli/jacoco/org.apache.commons.cli/Option.java.html ------------------------------------------------------------------------------ svn:eol-style = native