Skip to content

Commit 4a87127

Browse files
committed
Use Javadoc @code and @link
1 parent a312024 commit 4a87127

File tree

77 files changed

+995
-984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+995
-984
lines changed

src/main/java/org/apache/commons/validator/Arg.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@
1717
package org.apache.commons.validator;
1818

1919
import java.io.Serializable;
20+
import java.text.MessageFormat;
2021

2122
/**
2223
* <p>
2324
* A default argument or an argument for a
2425
* specific validator definition (ex: required)
2526
* can be stored to pass into a message as parameters. This can be used in a
2627
* pluggable validator for constructing locale
27-
* sensitive messages by using <code>java.text.MessageFormat</code>
28+
* sensitive messages by using {@link MessageFormat}
2829
* or an equivalent class. The resource field can be
2930
* used to determine if the value stored in the argument
3031
* is a value to be retrieved from a locale sensitive
31-
* message retrieval system like <code>java.util.PropertyResourceBundle</code>.
32+
* message retrieval system like {@code java.util.PropertyResourceBundle}.
3233
* The resource field defaults to 'true'.
3334
* </p>
3435
* <p>Instances of this class are configured with an &lt;arg&gt; xml element.</p>
@@ -39,7 +40,7 @@ public class Arg implements Cloneable, Serializable {
3940
private static final long serialVersionUID = -8922606779669839294L;
4041

4142
/**
42-
* The resource bundle name that this Arg's <code>key</code> should be
43+
* The resource bundle name that this Arg's {@code key} should be
4344
* resolved in (optional).
4445
* @since 1.1
4546
*/

src/main/java/org/apache/commons/validator/CreditCardValidator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
* </p>
3232
*
3333
* <pre>
34-
* <code>CreditCardValidator ccv = new CreditCardValidator(CreditCardValidator.AMEX + CreditCardValidator.VISA);</code>
34+
* {@code CreditCardValidator ccv = new CreditCardValidator(CreditCardValidator.AMEX + CreditCardValidator.VISA);}
3535
* </pre>
3636
*
3737
* <p>
3838
* configures the validator to only pass American Express and Visa cards.
3939
* If a card type is not directly supported by this class, you can implement
4040
* the CreditCardType interface and pass an instance into the
41-
* <code>addAllowedCardType</code> method.
41+
* {@code addAllowedCardType} method.
4242
* </p>
4343
*
4444
* <p>
@@ -77,7 +77,7 @@ public interface CreditCardType {
7777
* Returns true if the card number matches this type of credit
7878
* card. Note that this method is <strong>not</strong> responsible
7979
* for analyzing the general form of the card number because
80-
* <code>CreditCardValidator</code> performs those checks before
80+
* {@code CreditCardValidator} performs those checks before
8181
* calling this method. It is generally only required to valid the
8282
* length and prefix of the number to determine if it's the correct
8383
* type.
@@ -126,11 +126,11 @@ public boolean matches(final String card) {
126126
* you want only custom card types to validate so you turn off the
127127
* default cards with this option.
128128
* <pre>
129-
* <code>
129+
* {@code
130130
* CreditCardValidator v = new CreditCardValidator(CreditCardValidator.NONE);
131131
* v.addAllowedCardType(customType);
132132
* v.isValid(aCardNumber);
133-
* </code>
133+
* }
134134
* </pre>
135135
* @since 1.1.2
136136
*/

src/main/java/org/apache/commons/validator/DateValidator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ protected DateValidator() {
5555
}
5656

5757
/**
58-
* <p>Checks if the field is a valid date. The <code>Locale</code> is
59-
* used with <code>java.text.DateFormat</code>. The setLenient method
58+
* <p>Checks if the field is a valid date. The {@link Locale} is
59+
* used with {@link DateFormat}. The setLenient method
6060
* is set to {@code false} for all.</p>
6161
*
6262
* @param value The value validation is being performed on.
@@ -93,13 +93,13 @@ public boolean isValid(final String value, final Locale locale) {
9393

9494
/**
9595
* <p>Checks if the field is a valid date. The pattern is used with
96-
* <code>java.text.SimpleDateFormat</code>. If strict is true, then the
96+
* {@link SimpleDateFormat}. If strict is true, then the
9797
* length will be checked so '2/12/1999' will not pass validation with
9898
* the format 'MM/dd/yyyy' because the month isn't two digits.
9999
* The setLenient method is set to {@code false} for all.</p>
100100
*
101101
* @param value The value validation is being performed on.
102-
* @param datePattern The pattern passed to <code>SimpleDateFormat</code>.
102+
* @param datePattern The pattern passed to {@link SimpleDateFormat}.
103103
* @param strict Whether or not to have an exact match of the datePattern.
104104
* @return true if the date is valid.
105105
*/

src/main/java/org/apache/commons/validator/Field.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Field implements Cloneable, Serializable {
4949
private static final long serialVersionUID = -8502647722530192185L;
5050

5151
/**
52-
* This is the value that will be used as a key if the <code>Arg</code>
52+
* This is the value that will be used as a key if the {@code Arg}
5353
* name field has no value.
5454
*/
5555
private static final String DEFAULT_ARG =
@@ -147,7 +147,7 @@ public class Field implements Cloneable, Serializable {
147147
protected Map<String, Arg>[] args = new Map[0];
148148

149149
/**
150-
* Add an <code>Arg</code> to the replacement argument list.
150+
* Add an {@code Arg} to the replacement argument list.
151151
* @since 1.1
152152
* @param arg Validation message's argument.
153153
*/
@@ -175,16 +175,16 @@ public void addArg(final Arg arg) {
175175
}
176176

177177
/**
178-
* Add a <code>Msg</code> to the <code>Field</code>.
178+
* Add a {@code Msg} to the {@code Field}.
179179
* @param msg A validation message.
180180
*/
181181
public void addMsg(final Msg msg) {
182182
getMsgMap().put(msg.getName(), msg);
183183
}
184184

185185
/**
186-
* Add a <code>Var</code>, based on the values passed in, to the
187-
* <code>Field</code>.
186+
* Add a {@code Var}, based on the values passed in, to the
187+
* {@code Field}.
188188
* @param name Name of the validation.
189189
* @param value The Argument's value.
190190
* @param jsType The JavaScript type.
@@ -194,7 +194,7 @@ public void addVar(final String name, final String value, final String jsType) {
194194
}
195195

196196
/**
197-
* Add a <code>Var</code> to the <code>Field</code>.
197+
* Add a {@code Var} to the {@code Field}.
198198
* @param v The Validator Argument.
199199
*/
200200
public void addVar(final Var v) {
@@ -291,7 +291,7 @@ private void ensureArgsCapacity(final Arg arg) {
291291
}
292292

293293
/**
294-
* Generate correct <code>key</code> value.
294+
* Generate correct {@code key} value.
295295
*/
296296
public void generateKey() {
297297
if (this.isIndexed()) {
@@ -302,7 +302,7 @@ public void generateKey() {
302302
}
303303

304304
/**
305-
* Gets the default <code>Arg</code> object at the given position.
305+
* Gets the default {@code Arg} object at the given position.
306306
* @param position Validation message argument's position.
307307
* @return The default Arg or null if not found.
308308
* @since 1.1
@@ -312,7 +312,7 @@ public Arg getArg(final int position) {
312312
}
313313

314314
/**
315-
* Gets the <code>Arg</code> object at the given position. If the key
315+
* Gets the {@code Arg} object at the given position. If the key
316316
* finds a {@code null} value then the default value will be
317317
* retrieved.
318318
* @param key The name the Arg is stored under. If not found, the default
@@ -355,7 +355,7 @@ public Arg[] getArgs(final String key) {
355355
}
356356

357357
/**
358-
* Gets an unmodifiable <code>List</code> of the dependencies in the same
358+
* Gets an unmodifiable {@code List} of the dependencies in the same
359359
* order they were defined in parameter passed to the setDepends() method.
360360
* @return A list of the Field's dependancies.
361361
*/
@@ -372,7 +372,7 @@ public String getDepends() {
372372
}
373373

374374
/**
375-
* Gets the position of the <code>Field</code> in the validation list.
375+
* Gets the position of the {@code Field} in the validation list.
376376
* @return The field position.
377377
*/
378378
public int getFieldOrder() {
@@ -382,7 +382,7 @@ public int getFieldOrder() {
382382
/**
383383
* Gets the indexed property name of the field. This
384384
* is the method name that will return an array or a
385-
* <code>Collection</code> used to retrieve the
385+
* {@link Collection} used to retrieve the
386386
* list and then loop through the list performing the specified
387387
* validations.
388388
* @return The field's indexed List property name.
@@ -393,7 +393,7 @@ public String getIndexedListProperty() {
393393

394394
/**
395395
* Gets the indexed property name of the field. This
396-
* is the method name that can take an <code>int</code> as
396+
* is the method name that can take an {@code int} as
397397
* a parameter for indexed property value retrieval.
398398
* @return The field's indexed property name.
399399
*/
@@ -483,8 +483,8 @@ public Msg getMessage(final String key) {
483483
}
484484

485485
/**
486-
* The <code>Field</code>'s messages are returned as an
487-
* unmodifiable <code>Map</code>.
486+
* The {@code Field}'s messages are returned as an
487+
* unmodifiable {@link Map}.
488488
* @since 1.1.4
489489
* @return Map of validation messages for the field.
490490
*/
@@ -549,8 +549,8 @@ protected Map<String, Var> getVarMap() {
549549
}
550550

551551
/**
552-
* The <code>Field</code>'s variables are returned as an
553-
* unmodifiable <code>Map</code>.
552+
* The {@code Field}'s variables are returned as an
553+
* unmodifiable {@link Map}.
554554
* @return the Map of Variable's for a Field.
555555
*/
556556
public Map<String, Var> getVars() {
@@ -616,7 +616,7 @@ public boolean isIndexed() {
616616

617617
/**
618618
* Replace constants with values in fields and process the depends field
619-
* to create the dependency <code>Map</code>.
619+
* to create the dependency {@link Map}.
620620
*/
621621
void process(final Map<String, String> globalConstants, final Map<String, String> constants) {
622622
this.hMsgs.setFast(false);
@@ -663,7 +663,7 @@ void process(final Map<String, String> globalConstants, final Map<String, String
663663
}
664664

665665
/**
666-
* Replace the arg <code>Collection</code> key value with the key/value
666+
* Replace the arg {@link Collection} key value with the key/value
667667
* pairs passed in.
668668
*/
669669
private void processArg(final String key, final String replaceValue) {
@@ -774,7 +774,7 @@ public void setDepends(final String depends) {
774774
}
775775

776776
/**
777-
* Sets the position of the <code>Field</code> in the validation list.
777+
* Sets the position of the {@code Field} in the validation list.
778778
* @param fieldOrder The field position.
779779
*/
780780
public void setFieldOrder(final int fieldOrder) {

src/main/java/org/apache/commons/validator/Form.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* <p>
3030
* This contains a set of validation rules for a form/JavaBean. The information
31-
* is contained in a list of <code>Field</code> objects. Instances of this class
31+
* is contained in a list of {@code Field} objects. Instances of this class
3232
* are configured with a &lt;form&gt; xml element.
3333
* </p>
3434
* <p>
@@ -45,14 +45,14 @@ public class Form implements Serializable {
4545
protected String name;
4646

4747
/**
48-
* List of <code>Field</code>s. Used to maintain the order they were added
49-
* in although individual <code>Field</code>s can be retrieved using <code>Map</code>
50-
* of <code>Field</code>s.
48+
* List of {@code Field}s. Used to maintain the order they were added
49+
* in although individual {@code Field}s can be retrieved using {@link Map}
50+
* of {@code Field}s.
5151
*/
5252
protected List<Field> lFields = new ArrayList<>();
5353

5454
/**
55-
* Map of <code>Field</code>s keyed on their property value.
55+
* Map of {@code Field}s keyed on their property value.
5656
*
5757
* @deprecated Subclasses should use getFieldMap() instead.
5858
*/
@@ -67,13 +67,13 @@ public class Form implements Serializable {
6767
protected String inherit;
6868

6969
/**
70-
* Whether or not the this <code>Form</code> was processed for replacing
70+
* Whether or not the this {@code Form} was processed for replacing
7171
* variables in strings with their values.
7272
*/
7373
private boolean processed;
7474

7575
/**
76-
* Add a <code>Field</code> to the <code>Form</code>.
76+
* Add a {@code Field} to the {@code Form}.
7777
*
7878
* @param f The field
7979
*/
@@ -127,8 +127,8 @@ protected Map<String, Field> getFieldMap() {
127127
}
128128

129129
/**
130-
* A <code>List</code> of <code>Field</code>s is returned as an unmodifiable
131-
* <code>List</code>.
130+
* A {@code List} of {@code Field}s is returned as an unmodifiable
131+
* {@code List}.
132132
*
133133
* @return The fields value
134134
*/
@@ -156,7 +156,7 @@ public boolean isExtending() {
156156
}
157157

158158
/**
159-
* Whether or not the this <code>Form</code> was processed for replacing
159+
* Whether or not the this {@code Form} was processed for replacing
160160
* variables in strings with their values.
161161
*
162162
* @return The processed value
@@ -167,8 +167,8 @@ public boolean isProcessed() {
167167
}
168168

169169
/**
170-
* Merges the given form into this one. For any field in <code>depends</code>
171-
* not present in this form, include it. <code>depends</code> has precedence
170+
* Merges the given form into this one. For any field in {@code depends}
171+
* not present in this form, include it. {@code depends} has precedence
172172
* in the way the fields are ordered.
173173
*
174174
* @param depends the form we want to merge
@@ -201,7 +201,7 @@ protected void merge(final Form depends) {
201201
}
202202

203203
/**
204-
* Processes all of the <code>Form</code>'s <code>Field</code>s.
204+
* Processes all of the {@code Form}'s {@code Field}s.
205205
*
206206
* @param globalConstants A map of global constants
207207
* @param constants Local constants

0 commit comments

Comments
 (0)