1 58 package org.krysalis.barcode; 59 60 import org.apache.avalon.framework.Enum; 61 62 67 public class BaselineAlignment extends Enum { 68 69 70 public static final BaselineAlignment ALIGN_TOP = new BaselineAlignment("top"); 71 72 public static final BaselineAlignment ALIGN_BOTTOM = new BaselineAlignment("bottom"); 73 74 78 protected BaselineAlignment(String name) { 79 super(name); 80 } 81 82 87 public static BaselineAlignment byName(String name) { 88 if (name.equalsIgnoreCase(BaselineAlignment.ALIGN_TOP.getName())) { 89 return BaselineAlignment.ALIGN_TOP; 90 } else if (name.equalsIgnoreCase(BaselineAlignment.ALIGN_BOTTOM.getName())) { 91 return BaselineAlignment.ALIGN_BOTTOM; 92 } else { 93 throw new IllegalArgumentException ( 94 "Invalid BaselineAlignment: " + name); 95 } 96 } 97 98 99 100 101 } 102 | Popular Tags |