1 19 package org.enhydra.zeus.transform; 20 21 31 public class TypeConversion { 32 33 34 private String name; 35 36 37 private String type; 38 39 40 private String parseMethod; 41 42 43 private String printMethod; 44 45 58 public TypeConversion(String name, String type) { 59 this(name, type, null, null); 60 } 61 62 79 public TypeConversion(String name, String type, 80 String parseMethod, String printMethod) { 81 82 if (name == null) { 84 throw new IllegalArgumentException ("A TypeConversion cannot " + 85 "have a null name."); 86 } 87 if (type == null) { 88 throw new IllegalArgumentException ("A TypeConversion cannot " + 89 "have a null type."); 90 } 91 92 this.name = name; 93 this.type = type; 94 this.parseMethod = parseMethod; 95 this.printMethod = printMethod; 96 } 97 98 105 public void setName(String name) { 106 if (name == null) { 107 throw new IllegalArgumentException ("A TypeConversion cannot " + 108 "have a null name."); 109 } 110 this.name = name; 111 } 112 113 120 public String getName() { 121 return name; 122 } 123 124 135 public void setType(String type) { 136 if (type == null) { 137 throw new IllegalArgumentException ("A TypeConversion cannot " + 138 "have a null type."); 139 } 140 141 this.type = type; 142 } 143 144 153 public String getType() { 154 return type; 155 } 156 157 166 public void setParseMethod(String parseMethod) { 167 this.parseMethod = parseMethod; 168 } 169 170 179 public String getParseMethod() { 180 return parseMethod; 181 } 182 183 191 public void setPrintMethod(String printMethod) { 192 this.printMethod = printMethod; 193 } 194 195 203 public String getPrintMethod() { 204 return printMethod; 205 } 206 } 207 | Popular Tags |