mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Issue #63 : minor formatting and doc changes
This commit is contained in:
parent
347813c971
commit
bd4536f077
|
@ -32,7 +32,7 @@ public enum DecodeHintType {
|
||||||
/**
|
/**
|
||||||
* Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
* Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
||||||
*/
|
*/
|
||||||
OTHER(Object.class),
|
OTHER(Object.class),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
* Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
||||||
|
@ -90,12 +90,13 @@ public enum DecodeHintType {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allowed extension lengths for EAN or UPC barcodes.
|
* Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
||||||
* Other formats will ignore this.
|
|
||||||
* Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
* Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
||||||
* If it is optional to have an extension, do not set this hint.
|
* If it is optional to have an extension, do not set this hint. If this is set,
|
||||||
|
* and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
||||||
|
* at all.
|
||||||
*/
|
*/
|
||||||
ALLOWED_EAN_EXTENSIONS(int[].class);
|
ALLOWED_EAN_EXTENSIONS(int[].class),
|
||||||
|
|
||||||
// End of enumeration values.
|
// End of enumeration values.
|
||||||
;
|
;
|
||||||
|
|
|
@ -206,17 +206,17 @@ public abstract class UPCEANReader extends OneDReader {
|
||||||
// continue
|
// continue
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] allowedExtensions = hints == null ? null :
|
int[] allowedExtensions =
|
||||||
(int[])hints.get(DecodeHintType.ALLOWED_EAN_EXTENSIONS);
|
hints == null ? null : (int[]) hints.get(DecodeHintType.ALLOWED_EAN_EXTENSIONS);
|
||||||
if(allowedExtensions != null) {
|
if (allowedExtensions != null) {
|
||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
for (int length : allowedExtensions) {
|
for (int length : allowedExtensions) {
|
||||||
if(extensionLength == length) {
|
if (extensionLength == length) {
|
||||||
valid = true;
|
valid = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!valid) {
|
if (!valid) {
|
||||||
throw NotFoundException.getNotFoundInstance();
|
throw NotFoundException.getNotFoundInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue