1 58 package org.krysalis.barcode; 59 60 import java.util.Map ; 61 62 import org.apache.avalon.framework.Enum; 63 64 69 public class BarGroup extends Enum { 70 71 private static final Map MAP = new java.util.HashMap (); 72 73 74 public static final BarGroup START_CHARACTER = new BarGroup("start-char", MAP); 75 76 public static final BarGroup STOP_CHARACTER = new BarGroup("stop-char", MAP); 77 78 public static final BarGroup MSG_CHARACTER = new BarGroup("msg-char", MAP); 79 80 public static final BarGroup UPC_EAN_GUARD = new BarGroup("upc-ean-guard", MAP); 81 82 public static final BarGroup UPC_EAN_LEAD = new BarGroup("upc-ean-lead", MAP); 83 84 public static final BarGroup UPC_EAN_GROUP = new BarGroup("upc-ean-group", MAP); 85 86 public static final BarGroup UPC_EAN_CHECK = new BarGroup("upc-ean-check", MAP); 87 88 public static final BarGroup UPC_EAN_SUPP = new BarGroup("upc-ean-supp", MAP); 89 90 95 protected BarGroup(String name, final Map map) { 96 super(name, map); 97 } 98 99 104 public static BarGroup byName(String name) { 105 final BarGroup bg = (BarGroup)MAP.get(name); 106 if (bg == null) { 107 throw new IllegalArgumentException ("Invalid BarGroup: " + name); 108 } 109 return bg; 110 } 111 112 } 113 | Popular Tags |