<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>CommandLine (Apache Commons CLI 1.4 API)</title> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="CommandLine (Apache Commons CLI 1.4 API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":42,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../org/apache/commons/cli/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/CommandLine.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/commons/cli/BasicParser.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../../org/apache/commons/cli/CommandLine.Builder.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/commons/cli/CommandLine.html" target="_top">Frames</a></li> <li><a href="CommandLine.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li><a href="#nested.class.summary">Nested</a> | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.apache.commons.cli</div> <h2 title="Class CommandLine" class="title">Class CommandLine</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>org.apache.commons.cli.CommandLine</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">CommandLine</span> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre> <div class="block">Represents list of arguments parsed against a <a href="../../../../org/apache/commons/cli/Options.html" title="class in org.apache.commons.cli"><code>Options</code></a> descriptor. <p> It allows querying of a boolean <a href="../../../../org/apache/commons/cli/CommandLine.html#hasOption-java.lang.String-"><code>hasOption(String opt)</code></a>, in addition to retrieving the <a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValue-java.lang.String-"><code>getOptionValue(String opt)</code></a> for options requiring arguments. <p> Additionally, any left-over or unrecognized arguments, are available for further processing.</div> <dl> <dt><span class="simpleTagLabel">Version:</span></dt> <dd>$Id: CommandLine.java 1786144 2017-03-09 11:34:57Z britter $</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../serialized-form.html#org.apache.commons.cli.CommandLine">Serialized Form</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static class </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.Builder.html" title="class in org.apache.commons.cli">CommandLine.Builder</a></span></code> <div class="block">A nested builder class to create <code>CommandLine</code> instance using descriptive methods.</div> </td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier</th> <th class="colLast" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#CommandLine--">CommandLine</a></span>()</code> <div class="block">Creates a command line.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#addArg-java.lang.String-">addArg</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> arg)</code> <div class="block">Add left-over unrecognized option/argument.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#addOption-org.apache.commons.cli.Option-">addOption</a></span>(<a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a> opt)</code> <div class="block">Add an option to the command line.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getArgList--">getArgList</a></span>()</code> <div class="block">Retrieve any left-over non-recognized options and arguments</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getArgs--">getArgs</a></span>()</code> <div class="block">Retrieve any left-over non-recognized options and arguments</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionObject-char-">getOptionObject</a></span>(char opt)</code> <div class="block">Return the <code>Object</code> type of this <code>Option</code>.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionObject-java.lang.String-">getOptionObject</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <div class="block"><span class="deprecationComment">due to System.err message. Instead use getParsedOptionValue(String)</span></div> </div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionProperties-java.lang.String-">getOptionProperties</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</code> <div class="block">Retrieve the map of values associated to the option.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptions--">getOptions</a></span>()</code> <div class="block">Returns an array of the processed <a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><code>Option</code></a>s.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValue-char-">getOptionValue</a></span>(char opt)</code> <div class="block">Retrieve the first argument, if any, of this option.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValue-char-java.lang.String-">getOptionValue</a></span>(char opt, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> defaultValue)</code> <div class="block">Retrieve the argument, if any, of an option.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValue-java.lang.String-">getOptionValue</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</code> <div class="block">Retrieve the first argument, if any, of this option.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValue-java.lang.String-java.lang.String-">getOptionValue</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> defaultValue)</code> <div class="block">Retrieve the first argument, if any, of an option.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValues-char-">getOptionValues</a></span>(char opt)</code> <div class="block">Retrieves the array of values, if any, of an option.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getOptionValues-java.lang.String-">getOptionValues</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</code> <div class="block">Retrieves the array of values, if any, of an option.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#getParsedOptionValue-java.lang.String-">getParsedOptionValue</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</code> <div class="block">Return a version of this <code>Option</code> converted to a particular type.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#hasOption-char-">hasOption</a></span>(char opt)</code> <div class="block">Query to see if an option has been set.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#hasOption-java.lang.String-">hasOption</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</code> <div class="block">Query to see if an option has been set.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/cli/CommandLine.html#iterator--">iterator</a></span>()</code> <div class="block">Returns an iterator over the Option members of CommandLine.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="CommandLine--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>CommandLine</h4> <pre>protected CommandLine()</pre> <div class="block">Creates a command line.</div> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="hasOption-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasOption</h4> <pre>public boolean hasOption(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</pre> <div class="block">Query to see if an option has been set.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - Short name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if set, false if not</dd> </dl> </li> </ul> <a name="hasOption-char-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hasOption</h4> <pre>public boolean hasOption(char opt)</pre> <div class="block">Query to see if an option has been set.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - character name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if set, false if not</dd> </dl> </li> </ul> <a name="getOptionObject-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionObject</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a> public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> getOptionObject(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">due to System.err message. Instead use getParsedOptionValue(String)</span></div> <div class="block">Return the <code>Object</code> type of this <code>Option</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - the name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the type of this <code>Option</code></dd> </dl> </li> </ul> <a name="getParsedOptionValue-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getParsedOptionValue</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> getParsedOptionValue(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt) throws <a href="../../../../org/apache/commons/cli/ParseException.html" title="class in org.apache.commons.cli">ParseException</a></pre> <div class="block">Return a version of this <code>Option</code> converted to a particular type.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - the name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value parsed into a particular object</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../../org/apache/commons/cli/ParseException.html" title="class in org.apache.commons.cli">ParseException</a></code> - if there are problems turning the option value into the desired type</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>1.2</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../org/apache/commons/cli/PatternOptionBuilder.html" title="class in org.apache.commons.cli"><code>PatternOptionBuilder</code></a></dd> </dl> </li> </ul> <a name="getOptionObject-char-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionObject</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> getOptionObject(char opt)</pre> <div class="block">Return the <code>Object</code> type of this <code>Option</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - the name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the type of opt</dd> </dl> </li> </ul> <a name="getOptionValue-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionValue</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getOptionValue(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</pre> <div class="block">Retrieve the first argument, if any, of this option.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - the name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Value of the argument if option is set, and has an argument, otherwise null.</dd> </dl> </li> </ul> <a name="getOptionValue-char-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionValue</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getOptionValue(char opt)</pre> <div class="block">Retrieve the first argument, if any, of this option.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - the character name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Value of the argument if option is set, and has an argument, otherwise null.</dd> </dl> </li> </ul> <a name="getOptionValues-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionValues</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] getOptionValues(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</pre> <div class="block">Retrieves the array of values, if any, of an option.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - string name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Values of the argument if option is set, and has an argument, otherwise null.</dd> </dl> </li> </ul> <a name="getOptionValues-char-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionValues</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] getOptionValues(char opt)</pre> <div class="block">Retrieves the array of values, if any, of an option.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - character name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Values of the argument if option is set, and has an argument, otherwise null.</dd> </dl> </li> </ul> <a name="getOptionValue-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionValue</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getOptionValue(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> defaultValue)</pre> <div class="block">Retrieve the first argument, if any, of an option.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - name of the option</dd> <dd><code>defaultValue</code> - is the default value to be returned if the option is not specified</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Value of the argument if option is set, and has an argument, otherwise <code>defaultValue</code>.</dd> </dl> </li> </ul> <a name="getOptionValue-char-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionValue</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getOptionValue(char opt, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> defaultValue)</pre> <div class="block">Retrieve the argument, if any, of an option.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - character name of the option</dd> <dd><code>defaultValue</code> - is the default value to be returned if the option is not specified</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Value of the argument if option is set, and has an argument, otherwise <code>defaultValue</code>.</dd> </dl> </li> </ul> <a name="getOptionProperties-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionProperties</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> getOptionProperties(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> opt)</pre> <div class="block">Retrieve the map of values associated to the option. This is convenient for options specifying Java properties like <tt>-Dparam1=value1 -Dparam2=value2</tt>. The first argument of the option is the key, and the 2nd argument is the value. If the option has only one argument (<tt>-Dfoo</tt>) it is considered as a boolean flag and the value is <tt>"true"</tt>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - name of the option</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The Properties mapped by the option, never <tt>null</tt> even if the option doesn't exists</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>1.2</dd> </dl> </li> </ul> <a name="getArgs--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getArgs</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] getArgs()</pre> <div class="block">Retrieve any left-over non-recognized options and arguments</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>remaining items passed in but not parsed as an array</dd> </dl> </li> </ul> <a name="getArgList--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getArgList</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> getArgList()</pre> <div class="block">Retrieve any left-over non-recognized options and arguments</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>remaining items passed in but not parsed as a <code>List</code>.</dd> </dl> </li> </ul> <a name="addArg-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addArg</h4> <pre>protected void addArg(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> arg)</pre> <div class="block">Add left-over unrecognized option/argument.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>arg</code> - the unrecognized option/argument.</dd> </dl> </li> </ul> <a name="addOption-org.apache.commons.cli.Option-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addOption</h4> <pre>protected void addOption(<a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a> opt)</pre> <div class="block">Add an option to the command line. The values of the option are stored.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>opt</code> - the processed option</dd> </dl> </li> </ul> <a name="iterator--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>iterator</h4> <pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a>> iterator()</pre> <div class="block">Returns an iterator over the Option members of CommandLine.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>an <code>Iterator</code> over the processed <a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><code>Option</code></a> members of this <a href="../../../../org/apache/commons/cli/CommandLine.html" title="class in org.apache.commons.cli"><code>CommandLine</code></a></dd> </dl> </li> </ul> <a name="getOptions--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getOptions</h4> <pre>public <a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli">Option</a>[] getOptions()</pre> <div class="block">Returns an array of the processed <a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><code>Option</code></a>s.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>an array of the processed <a href="../../../../org/apache/commons/cli/Option.html" title="class in org.apache.commons.cli"><code>Option</code></a>s.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../org/apache/commons/cli/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/CommandLine.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/commons/cli/BasicParser.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../../org/apache/commons/cli/CommandLine.Builder.html" title="class in org.apache.commons.cli"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/commons/cli/CommandLine.html" target="_top">Frames</a></li> <li><a href="CommandLine.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li><a href="#nested.class.summary">Nested</a> | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright © 2002–2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>