1 58 package org.krysalis.barcode; 59 60 import org.apache.avalon.framework.Enum; 61 62 67 public class HumanReadablePlacement extends Enum { 68 69 70 public static final HumanReadablePlacement HRP_NONE 71 = new HumanReadablePlacement("none"); 72 73 public static final HumanReadablePlacement HRP_TOP 74 = new HumanReadablePlacement("top"); 75 76 public static final HumanReadablePlacement HRP_BOTTOM 77 = new HumanReadablePlacement("bottom"); 78 79 83 protected HumanReadablePlacement(String name) { 84 super(name); 85 } 86 87 92 public static HumanReadablePlacement byName(String name) { 93 if (name.equalsIgnoreCase(HumanReadablePlacement.HRP_NONE.getName())) { 94 return HumanReadablePlacement.HRP_NONE; 95 } else if (name.equalsIgnoreCase(HumanReadablePlacement.HRP_TOP.getName())) { 96 return HumanReadablePlacement.HRP_TOP; 97 } else if (name.equalsIgnoreCase(HumanReadablePlacement.HRP_BOTTOM.getName())) { 98 return HumanReadablePlacement.HRP_BOTTOM; 99 } else { 100 throw new IllegalArgumentException ( 101 "Invalid HumanReadablePlacement: " + name); 102 } 103 } 104 105 106 } | Popular Tags |