Skip to content

Commit

Permalink
Fixing Javadoc problems - prt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
SingingBush committed Oct 11, 2024
1 parent 3c4a5b5 commit a01825b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* This is a "read only" interface preventing applications from modifying their
* own configurations. Once it is created, the information never changes.
* </p>
* <h3>Data Model</h3>
* <h2>Data Model</h2>
* <p>
* The data model is a subset of XML's; a single-rooted hierarchical tree where each
* node can contain multiple <em>attributes</em>, and leaf nodes can also
Expand All @@ -22,15 +22,15 @@
* class, or directly by a SAX parser using a SAXConfigurationHandler or
* NamespacedSAXConfigurationHandler event handler.
* </p>
* <h4>Namespace support</h4>
* <h3>Namespace support</h3>
* <p>
* Since version 4.1, each <code>Configuration</code> node has a namespace
* associated with it, in the form of a string, accessible through {@link
* #getNamespace}. If no namespace is present, <code>getNamespace</code> will
* return blank (""). See DefaultConfigurationBuilder for details on how
* XML namespaces are mapped to <code>Configuration</code> namespaces.
* </p>
* <h3>Example</h3>
* <h2>Example</h2>
* <p>
* As an example, consider two <code>Configuration</code>s (with and without
* namespaces) built from this XML:
Expand All @@ -55,11 +55,9 @@
* an attribute named "xmlns:doc", and a child called "doc:desc".
* </p>
* <p>
* Assuming the <code>Configuration</code> object is named <code>conf</code>,
* here is how the data could be retrieved:
* Assuming the <code>Configuration</code> object is named <code>conf</code>, here is how the data could be retrieved:
* </p>
* <p>
* <table border="1">
* <table border="1"><tbody>
* <tr><th>Code</th><th>No namespaces</th><th>With namespaces</th></tr>
* <tr><td>
* <code>conf.{@link #getName getName}()</code></td><td colspan="2">my-system</td></tr>
Expand Down Expand Up @@ -97,14 +95,14 @@
* <tr><td>
* <code>conf.{@link #getChild(String) getChild}("desc").{@link #getNamespace getNamespace}()</code>
* </td><td>&nbsp;</td><td>http://myco.com/documentation"</td></tr>
* </table>
* </p>
* </tbody></table>
*
* <p>
* Type-safe utility methods are provided for retrieving attribute and element
* values as <code>String</code>, <code>int</code>, <code>long</code>,
* <code>float</code> and <code>boolean</code>.
* </p>
* <h3>Miscellanea</h3>
* <h2>Miscellanea</h2>
* <p>
* Currently, the configuration tree can only be traversed one node at a time,
* eg., through {@link #getChild(String) getChild("foo")} or {@link #getChildren()}. In
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright 2005 Jeremias Maerki and Dietmar Bürkle.
*
*
* Licensed 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.
Expand All @@ -15,33 +15,37 @@
*/
package org.krysalis.barcode4j.impl.code128;

import org.jetbrains.annotations.NotNull;

public class CheckDigit {
/**
* @since 2.0
*/
class CheckDigit {

public final static byte CDNone = 0;
public final static byte CD31 = 1;
public final static byte CD11 = 2;

public static char calcCheckdigit(String msg, int start, int end, byte type) {
/*
* @param msg the full barcode message
* @param start
* @param end
* @param type one of either {@link CheckDigit#CD31} or {@link CheckDigit#CD11}
* @return The check digit value as a char
*/
// todo: consider removing this class. It's only used by EAN128LogicImpl and could be a private method. There's no need for it to be publicly available
static char calcCheckdigit(@NotNull final String msg, int start, int end, byte type) {
switch (type) {
case CD31 : return calcCheckdigit(3, 1, msg, start, end);
case CD11 : return calcCheckdigit(1, 1, msg, start, end);
case CD31 : return calcCheckdigit(3, 1, msg, start, end);
case CD11 : return calcCheckdigit(1, 1, msg, start, end);
default : return '0';
}
}

public static char calcCheckdigit31(String msg, int start, int end) {
return calcCheckdigit(3, 1, msg, start, end);
}

public static char calcCheckdigit11(String msg, int start, int end) {
return calcCheckdigit(1, 1, msg, start, end);
}

public static char calcCheckdigit(int oddMult, int evenMult, String msg, int start, int end) {
private static char calcCheckdigit(int oddMult, int evenMult, String msg, int start, int end) {
int oddSum = 0;
int evenSum = 0;
boolean even = false;
boolean even = false;
for (int i = end - 1; i >= start; i--) {
if (even) {
evenSum += Character.digit(msg.charAt(i), 10);
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@
</execution>
</executions>
<configuration>
<doclint>all,-missing,-accessibility</doclint>
<quiet>true</quiet>
<failOnWarnings>false</failOnWarnings>
<failOnError>true</failOnError>
Expand Down Expand Up @@ -692,6 +693,7 @@
</execution>
</executions>
<configuration>
<doclint>all,-missing,-accessibility</doclint>
<quiet>true</quiet>
<failOnWarnings>false</failOnWarnings>
<failOnError>true</failOnError>
Expand Down

0 comments on commit a01825b

Please sign in to comment.