1 17 package com.finalist.jaggenerator.template; 18 19 import java.util.HashMap ; 20 21 22 28 public class TemplateConfigParameter { 29 30 33 public static final Type TYPE_TEXT = new Type("text"); 34 37 public static final Type TYPE_CHECKBOX = new Type("checkbox"); 38 41 public static final Type TYPE_LIST = new Type("list"); 42 47 public static final Type TYPE_EDITABLE_LIST = new Type("list-editable"); 48 49 private static final HashMap types = new HashMap (); 50 static { 51 types.put(TYPE_TEXT.toString(), TYPE_TEXT); 52 types.put(TYPE_CHECKBOX.toString(), TYPE_CHECKBOX); 53 types.put(TYPE_LIST.toString(), TYPE_LIST); 54 types.put(TYPE_EDITABLE_LIST.toString(), TYPE_EDITABLE_LIST); 55 } 56 57 private String id; 58 private String name; 59 private String description; 60 private Type type; 61 private String [] presetValues; 62 private String value; 63 64 65 71 public String getId() { 72 return id; 73 } 74 75 82 public void setId(String id) { 83 this.id = id; 84 } 85 86 91 public String getName() { 92 return name; 93 } 94 95 100 public void setName(String name) { 101 this.name = name; 102 } 103 104 109 public String getDescription() { 110 return description; 111 } 112 113 118 public void setDescription(String description) { 119 this.description = description; 120 } 121 122 127 public TemplateConfigParameter.Type getType() { 128 return type; 129 } 130 131 136 public void setType(TemplateConfigParameter.Type type) { 137 this.type = type; 138 } 139 140 145 public String [] getPresetValues() { 146 return presetValues; 147 } 148 149 public void setPresetValues(String [] presetValues) { 150 this.presetValues = presetValues; 151 } 152 153 public String getValue() { 154 return value; 155 } 156 157 public void setValue(String value) { 158 this.value = value; 159 } 160 161 167 public static Type getTypeByName(String name) { 168 return (Type) types.get(name); 169 } 170 171 172 173 private final static class Type { 174 private String type; 175 176 private Type(String type) { 177 this.type = type; 178 } 179 180 public String toString() { 181 return type; 182 } 183 } 184 185 } 186 | Popular Tags |