Skip to content

Commit 9539506

Browse files
committed
Javadoc: Use @code instead of HTML tags.
1 parent dc9af47 commit 9539506

22 files changed

Lines changed: 159 additions & 159 deletions

src/main/java/org/apache/commons/cli/AlreadySelectedException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class AlreadySelectedException extends ParseException {
3333
private Option option;
3434

3535
/**
36-
* Construct a new <code>AlreadySelectedException</code> for the specified option group.
36+
* Construct a new {@code AlreadySelectedException} for the specified option group.
3737
*
3838
* @param group the option group already selected
3939
* @param option the option that triggered the exception
@@ -46,7 +46,7 @@ public AlreadySelectedException(final OptionGroup group, final Option option) {
4646
}
4747

4848
/**
49-
* Construct a new <code>AlreadySelectedException</code> with the specified detail message.
49+
* Construct a new {@code AlreadySelectedException} with the specified detail message.
5050
*
5151
* @param message the detail message
5252
*/

src/main/java/org/apache/commons/cli/BasicParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public class BasicParser extends Parser {
3232
* </p>
3333
*
3434
* <p>
35-
* <b>Note:</b> <code>options</code> and <code>stopAtNonOption</code> are not used in this <code>flatten</code> method.
35+
* <b>Note:</b> {@code options} and {@code stopAtNonOption} are not used in this {@code flatten} method.
3636
* </p>
3737
*
3838
* @param options The command line {@link Options}
3939
* @param arguments The command line arguments to be parsed
4040
* @param stopAtNonOption Specifies whether to stop flattening when an non option is found.
41-
* @return The <code>arguments</code> String array.
41+
* @return The {@code arguments} String array.
4242
*/
4343
@Override
4444
protected String[] flatten(@SuppressWarnings("unused") final Options options, final String[] arguments,

src/main/java/org/apache/commons/cli/CommandLine.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
3535
*/
3636
public class CommandLine implements Serializable {
3737
/**
38-
* A nested builder class to create <code>CommandLine</code> instance using descriptive methods.
38+
* A nested builder class to create {@code CommandLine} instance using descriptive methods.
3939
*
4040
* @since 1.4
4141
*/
@@ -111,7 +111,7 @@ protected void addOption(final Option opt) {
111111
/**
112112
* Retrieve any left-over non-recognized options and arguments
113113
*
114-
* @return remaining items passed in but not parsed as a <code>List</code>.
114+
* @return remaining items passed in but not parsed as a {@code List}.
115115
*/
116116
public List<String> getArgList() {
117117
return args;
@@ -131,7 +131,7 @@ public String[] getArgs() {
131131
}
132132

133133
/**
134-
* Return the <code>Object</code> type of this <code>Option</code>.
134+
* Return the {@code Object} type of this {@code Option}.
135135
*
136136
* @deprecated due to System.err message. Instead use getParsedOptionValue(char)
137137
* @param opt the name of the option.
@@ -143,10 +143,10 @@ public Object getOptionObject(final char opt) {
143143
}
144144

145145
/**
146-
* Return the <code>Object</code> type of this <code>Option</code>.
146+
* Return the {@code Object} type of this {@code Option}.
147147
*
148148
* @param opt the name of the option.
149-
* @return the type of this <code>Option</code>.
149+
* @return the type of this {@code Option}.
150150
* @deprecated due to System.err message. Instead use getParsedOptionValue(String)
151151
*/
152152
@Deprecated
@@ -163,10 +163,10 @@ public Object getOptionObject(final String opt) {
163163
* Retrieve the map of values associated to the option. This is convenient for options specifying Java properties like
164164
* <code>-Dparam1=value1
165165
* -Dparam2=value2</code>. The first argument of the option is the key, and the 2nd argument is the value. If the option
166-
* has only one argument (<code>-Dfoo</code>) it is considered as a boolean flag and the value is <code>"true"</code>.
166+
* has only one argument ({@code -Dfoo}) it is considered as a boolean flag and the value is {@code "true"}.
167167
*
168168
* @param option name of the option.
169-
* @return The Properties mapped by the option, never <code>null</code> even if the option doesn't exists.
169+
* @return The Properties mapped by the option, never {@code null} even if the option doesn't exists.
170170
* @since 1.5
171171
*/
172172
public Properties getOptionProperties(final Option option) {
@@ -192,10 +192,10 @@ public Properties getOptionProperties(final Option option) {
192192
* Retrieve the map of values associated to the option. This is convenient for options specifying Java properties like
193193
* <code>-Dparam1=value1
194194
* -Dparam2=value2</code>. The first argument of the option is the key, and the 2nd argument is the value. If the option
195-
* has only one argument (<code>-Dfoo</code>) it is considered as a boolean flag and the value is <code>"true"</code>.
195+
* has only one argument ({@code -Dfoo}) it is considered as a boolean flag and the value is {@code "true"}.
196196
*
197197
* @param opt name of the option.
198-
* @return The Properties mapped by the option, never <code>null</code> even if the option doesn't exists.
198+
* @return The Properties mapped by the option, never {@code null} even if the option doesn't exists.
199199
* @since 1.2
200200
*/
201201
public Properties getOptionProperties(final String opt) {
@@ -247,7 +247,7 @@ public String getOptionValue(final char opt) {
247247
*
248248
* @param opt character name of the option
249249
* @param defaultValue is the default value to be returned if the option is not specified.
250-
* @return Value of the argument if option is set, and has an argument, otherwise <code>defaultValue</code>.
250+
* @return Value of the argument if option is set, and has an argument, otherwise {@code defaultValue}.
251251
*/
252252
public String getOptionValue(final char opt, final String defaultValue) {
253253
return getOptionValue(String.valueOf(opt), defaultValue);
@@ -273,7 +273,7 @@ public String getOptionValue(final Option option) {
273273
*
274274
* @param option name of the option.
275275
* @param defaultValue is the default value to be returned if the option is not specified.
276-
* @return Value of the argument if option is set, and has an argument, otherwise <code>defaultValue</code>.
276+
* @return Value of the argument if option is set, and has an argument, otherwise {@code defaultValue}.
277277
* @since 1.5
278278
*/
279279
public String getOptionValue(final Option option, final String defaultValue) {
@@ -296,7 +296,7 @@ public String getOptionValue(final String opt) {
296296
*
297297
* @param opt name of the option.
298298
* @param defaultValue is the default value to be returned if the option is not specified.
299-
* @return Value of the argument if option is set, and has an argument, otherwise <code>defaultValue</code>.
299+
* @return Value of the argument if option is set, and has an argument, otherwise {@code defaultValue}.
300300
*/
301301
public String getOptionValue(final String opt, final String defaultValue) {
302302
return getOptionValue(resolveOption(opt), defaultValue);
@@ -342,7 +342,7 @@ public String[] getOptionValues(final String opt) {
342342
}
343343

344344
/**
345-
* Return a version of this <code>Option</code> converted to a particular type.
345+
* Return a version of this {@code Option} converted to a particular type.
346346
*
347347
* @param opt the name of the option.
348348
* @return the value parsed into a particular object.
@@ -355,7 +355,7 @@ public Object getParsedOptionValue(final char opt) throws ParseException {
355355
}
356356

357357
/**
358-
* Return a version of this <code>Option</code> converted to a particular type.
358+
* Return a version of this {@code Option} converted to a particular type.
359359
*
360360
* @param option the name of the option.
361361
* @return the value parsed into a particular object.
@@ -375,7 +375,7 @@ public Object getParsedOptionValue(final Option option) throws ParseException {
375375
}
376376

377377
/**
378-
* Return a version of this <code>Option</code> converted to a particular type.
378+
* Return a version of this {@code Option} converted to a particular type.
379379
*
380380
* @param opt the name of the option.
381381
* @return the value parsed into a particular object.
@@ -439,7 +439,7 @@ public boolean hasOption(final String opt) {
439439
/**
440440
* Returns an iterator over the Option members of CommandLine.
441441
*
442-
* @return an <code>Iterator</code> over the processed {@link Option} members of this {@link CommandLine}.
442+
* @return an {@code Iterator} over the processed {@link Option} members of this {@link CommandLine}.
443443
*/
444444
public Iterator<Option> iterator() {
445445
return options.iterator();

src/main/java/org/apache/commons/cli/CommandLineParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
1818
package org.apache.commons.cli;
1919

2020
/**
21-
* A class that implements the <code>CommandLineParser</code> interface can parse a String array according to the
21+
* A class that implements the {@code CommandLineParser} interface can parse a String array according to the
2222
* {@link Options} specified and return a {@link CommandLine}.
2323
*/
2424
public interface CommandLineParser {
@@ -54,8 +54,8 @@ public interface CommandLineParser {
5454
*
5555
* @param options the specified Options
5656
* @param arguments the command line arguments
57-
* @param stopAtNonOption if <code>true</code> an unrecognized argument stops the parsing and the remaining arguments
58-
* are added to the {@link CommandLine}s args list. If <code>false</code> an unrecognized argument triggers a
57+
* @param stopAtNonOption if {@code true} an unrecognized argument stops the parsing and the remaining arguments
58+
* are added to the {@link CommandLine}s args list. If {@code false} an unrecognized argument triggers a
5959
* ParseException.
6060
*
6161
* @return the list of atomic option and value tokens
@@ -69,8 +69,8 @@ public interface CommandLineParser {
6969
* @param options the specified Options
7070
* @param arguments the command line arguments
7171
* @param properties command line option name-value pairs
72-
* @param stopAtNonOption if <code>true</code> an unrecognized argument stops the parsing and the remaining arguments
73-
* are added to the {@link CommandLine}s args list. If <code>false</code> an unrecognized argument triggers a
72+
* @param stopAtNonOption if {@code true} an unrecognized argument stops the parsing and the remaining arguments
73+
* are added to the {@link CommandLine}s args list. If {@code false} an unrecognized argument triggers a
7474
* ParseException.
7575
*
7676
* @return the list of atomic option and value tokens

src/main/java/org/apache/commons/cli/DefaultParser.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class DefaultParser implements CommandLineParser {
3535
protected Options options;
3636

3737
/**
38-
* Flag indicating how unrecognized tokens are handled. <code>true</code> to stop the parsing and add the remaining
39-
* tokens to the args list. <code>false</code> to throw an exception.
38+
* Flag indicating how unrecognized tokens are handled. {@code true} to stop the parsing and add the remaining
39+
* tokens to the args list. {@code false} to throw an exception.
4040
*/
4141
protected boolean stopAtNonOption;
4242

@@ -70,8 +70,8 @@ public class DefaultParser implements CommandLineParser {
7070
* }
7171
* </pre>
7272
*
73-
* with "partial matching" turned on, <code>-de</code> only matches the <code>"debug"</code> option. However, with
74-
* "partial matching" disabled, <code>-de</code> would enable both <code>debug</code> as well as <code>extract</code>
73+
* with "partial matching" turned on, {@code -de} only matches the {@code "debug"} option. However, with
74+
* "partial matching" disabled, {@code -de} would enable both {@code debug} as well as {@code extract}
7575
* options.
7676
*/
7777
public DefaultParser() {
@@ -93,8 +93,8 @@ public DefaultParser() {
9393
* }
9494
* </pre>
9595
*
96-
* with "partial matching" turned on, <code>-de</code> only matches the <code>"debug"</code> option. However, with
97-
* "partial matching" disabled, <code>-de</code> would enable both <code>debug</code> as well as <code>extract</code>
96+
* with "partial matching" turned on, {@code -de} only matches the {@code "debug"} option. However, with
97+
* "partial matching" disabled, {@code -de} would enable both {@code debug} as well as {@code extract}
9898
* options.
9999
*
100100
* @param allowPartialMatching if partial matching of long options shall be enabled
@@ -165,7 +165,7 @@ private List<String> getMatchingLongOptions(final String token) {
165165
}
166166

167167
/**
168-
* Breaks <code>token</code> into its constituent parts using the following algorithm.
168+
* Breaks {@code token} into its constituent parts using the following algorithm.
169169
*
170170
* <ul>
171171
* <li>ignore the first character ("<b>-</b>")</li>
@@ -174,10 +174,10 @@ private List<String> getMatchingLongOptions(final String token) {
174174
* tokens.</li>
175175
* <li>if the {@link Option} can have an argument value and there are remaining characters in the token then add the
176176
* remaining characters as a token to the list of processed tokens.</li>
177-
* <li>if an {@link Option} does <b>NOT</b> exist <b>AND</b> <code>stopAtNonOption</code> <b>IS</b> set then add the
177+
* <li>if an {@link Option} does <b>NOT</b> exist <b>AND</b> {@code stopAtNonOption} <b>IS</b> set then add the
178178
* special token "<b>--</b>" followed by the remaining characters and also the remaining tokens directly to the
179179
* processed tokens list.</li>
180-
* <li>if an {@link Option} does <b>NOT</b> exist <b>AND</b> <code>stopAtNonOption</code> <b>IS NOT</b> set then add
180+
* <li>if an {@link Option} does <b>NOT</b> exist <b>AND</b> {@code stopAtNonOption} <b>IS NOT</b> set then add
181181
* that character prepended with "<b>-</b>".</li>
182182
* </ul>
183183
*
@@ -287,7 +287,7 @@ private void handleOption(Option option) throws ParseException {
287287
}
288288

289289
/**
290-
* Sets the values of Options using the values in <code>properties</code>.
290+
* Sets the values of Options using the values in {@code properties}.
291291
*
292292
* @param properties The value properties to be processed.
293293
*/
@@ -565,8 +565,8 @@ public CommandLine parse(final Options options, final String[] arguments, final
565565
* @param options the specified Options
566566
* @param arguments the command line arguments
567567
* @param properties command line option name-value pairs
568-
* @param stopAtNonOption if <code>true</code> an unrecognized argument stops the parsing and the remaining arguments
569-
* are added to the {@link CommandLine}s args list. If <code>false</code> an unrecognized argument triggers a
568+
* @param stopAtNonOption if {@code true} an unrecognized argument stops the parsing and the remaining arguments
569+
* are added to the {@link CommandLine}s args list. If {@code false} an unrecognized argument triggers a
570570
* ParseException.
571571
*
572572
* @return the list of atomic option and value tokens

src/main/java/org/apache/commons/cli/GnuParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class GnuParser extends Parser {
3131
/**
3232
* This flatten method does so using the following rules:
3333
* <ol>
34-
* <li>If an {@link Option} exists for the first character of the <code>arguments</code> entry <b>AND</b> an
35-
* {@link Option} does not exist for the whole <code>argument</code> then add the first character as an option to the
34+
* <li>If an {@link Option} exists for the first character of the {@code arguments} entry <b>AND</b> an
35+
* {@link Option} does not exist for the whole {@code argument} then add the first character as an option to the
3636
* processed tokens list e.g. "-D" and add the rest of the entry to the also.</li>
3737
* <li>Otherwise just add the token to the processed tokens list.</li>
3838
* </ol>

0 commit comments

Comments
 (0)