Skip to content

Commit a9dae2c

Browse files
committed
Java docs
1 parent 233d1cd commit a9dae2c

File tree

3 files changed

+40
-18
lines changed

3 files changed

+40
-18
lines changed

src/main/java/org/apache/commons/validator/routines/LeitwegValidator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public LeitwegValidator() {
106106
this.formatValidator = DEFAULT_FORMAT;
107107
}
108108

109+
/**
110+
* Retuens the RegexValidator for the format
111+
* @return formatValidator
112+
*/
109113
public RegexValidator getFormatValidator() {
110114
return formatValidator.validator;
111115
}

src/main/java/org/apache/commons/validator/routines/checkdigit/CheckDigitException.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,19 @@ public static final String invalidCode(final String code, final String detail) {
5959
return START_WITH_INVALID + "code \"" + code + "\"" + (detail == null ? "." : ", " + detail);
6060
}
6161

62+
/**
63+
* Convenient message text "Invalid Character [character]"
64+
* @param character the invalid character string
65+
* @return the message text
66+
*/
6267
public static final String invalidCharacter(final String character) {
6368
return START_WITH_INVALID + "Character \"" + character + "\"";
6469
}
70+
/**
71+
* Convenient message text "Invalid Character [character]" without pos
72+
* @param character the invalid character
73+
* @return the message text
74+
*/
6575
public static final String invalidCharacter(final char character) {
6676
return START_WITH_INVALID + "Character '" + character + "'";
6777
}

src/main/java/org/apache/commons/validator/routines/checkdigit/IsoIec7064PureSystem.java

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,28 @@
1616
*/
1717
package org.apache.commons.validator.routines.checkdigit;
1818

19-
/*
20-
die 5 subklassen Benennungen (mit rekursiven/iterativen Implementierung)
21-
22-
IsoIecPure11System : MOD 11-2 : eine Ziffer oder 'X'
23-
IsoIecPure37System : MOD 37-2 : ein alphanumerisches Zeichen oder '*'
24-
IsoIecPure97System : MOD 97-10: zwei Ziffern ==> toCheckDigit() , toInt() muss man also überschreiben
25-
IsoIecPure661System : MOD 661-26: zwei Buchstaben
26-
IsoIecPure1271System : MOD 1271_36: zwei alphanumerische Zeichen
27-
28-
MOD 11-2 und MOD 37-2 Implementierungen berechnen die pz auch für {"", "0", "00", ... }, die Norm konform "1" ergibt.
29-
Nicht aber für null!
30-
MOD 97-10 und MOD 1271_36 berechnen für {"", "0", "00", ... } "01" als pz.
31-
Auch in MOD 661-26 sind die zwei (int) pz 0 und 1, was als Buchstaben "AB" liefert.
32-
33-
IsoIec7064PurePolynomialSystem ist eine eigene abstrakte Klasse für die polynomiale Implementierung,
34-
daraus sind dann die endglültigen Klassen abgeleitet
35-
36-
*/
19+
/**
20+
* Abstract implementation for five check digit calculation/validation defined in the ISO/IEC 7064 standard.
21+
* <ul>
22+
* <li>ISO/IEC 7064, MOD 11-2 applies to numeric strings ({@link IsoIecPure11System})</li>
23+
* <li>ISO/IEC 7064, MOD 37-2 applies to alphanumeric strings ({@link IsoIecPure37System})</li>
24+
* <li>ISO/IEC 7064, MOD 97-10 applies to numeric strings ({@link IsoIecPure97System})</li>
25+
* <li>ISO/IEC 7064, MOD 661-26 applies to alphabetic strings ({@link IsoIecPure661System})</li>
26+
* <li>ISO/IEC 7064, MOD 1271_36 applies to alphanumeric strings ({@link IsoIecPure1271System})</li>
27+
* </ul>
28+
* <p>
29+
* <b>Pure</b> system algorithms use a single modulus value {@link #getModulus()} and a radix {@link #getRadix()},
30+
* f.i. the modulus for MOD 11-2 is 11, the radix is 2.
31+
* There is also an alternative polynomial implementation for the pure systems,
32+
* see {@link IsoIec7064PurePolynomialSystem} and subclasses.
33+
* </p>
34+
* <p>
35+
* The standard also defines hybrid systems with two modulus values (see {@link IsoIec7064HybridSystem}).
36+
* </p>
37+
*
38+
* @author EUG https://github.com/homebeaver
39+
* @since 1.10.0
40+
*/
3741
public abstract class IsoIec7064PureSystem extends ModulusCheckDigit {
3842

3943
private static final long serialVersionUID = 8956070914814659350L;
@@ -64,6 +68,10 @@ public abstract class IsoIec7064PureSystem extends ModulusCheckDigit {
6468
this.checkdigitLength = checkdigitLength;
6569
}
6670

71+
/**
72+
* Returns the lentgth of the check digit for the system
73+
* @return checkdigitLength can be one ore two chars
74+
*/
6775
public int getCheckdigitLength() {
6876
return checkdigitLength;
6977
}

0 commit comments

Comments
 (0)