summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/uic')
-rw-r--r--src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java b/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java
index 22ba8ce..fdef178 100644
--- a/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java
+++ b/src/main/java/org/uic/barcode/staticFrame/UHEADDataRecord.java
@@ -224,6 +224,16 @@ public class UHEADDataRecord extends DataRecord{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
String issuerElement = String.format("%4s", this.issuer);
+
+ if (this.identifier == null || this.identifier.length() < 1) {
+ throw new EncodingFormatException("Identifier in U_HEAD missing");
+ }
+
+ if (this.identifier.length() > 20) {
+ throw new EncodingFormatException("Identifier in U_HEAD too long (max. 20 byte)");
+ }
+
+
String idElement = String.format("%20s", this.identifier);