1 21 22 package org.apache.commons.validator; 23 24 import java.io.Serializable ; 25 26 31 public class Var implements Cloneable , Serializable { 32 33 37 public static final String JSTYPE_INT = "int"; 38 39 43 public static final String JSTYPE_STRING = "string"; 44 45 49 public static final String JSTYPE_REGEXP = "regexp"; 50 51 54 private String name = null; 55 56 59 private String value = null; 60 61 64 private String jsType = null; 65 66 public Var() { 67 super(); 68 } 69 70 public Var(String name, String value, String jsType) { 71 this.name = name; 72 this.value = value; 73 this.jsType = jsType; 74 } 75 76 79 public String getName() { 80 return this.name; 81 } 82 83 86 public void setName(String name) { 87 this.name = name; 88 } 89 90 93 public String getValue() { 94 return this.value; 95 } 96 97 100 public void setValue(String value) { 101 this.value = value; 102 } 103 104 107 public String getJsType() { 108 return this.jsType; 109 } 110 111 114 public void setJsType(String jsType) { 115 this.jsType = jsType; 116 } 117 118 121 public Object clone() { 122 try { 123 return super.clone(); 124 125 } catch(CloneNotSupportedException e) { 126 throw new RuntimeException (e.toString()); 127 } 128 } 129 130 133 public String toString() { 134 StringBuffer results = new StringBuffer (); 135 136 results.append("Var: name="); 137 results.append(name); 138 results.append(" value="); 139 results.append(value); 140 results.append(" jsType="); 141 results.append(jsType); 142 results.append("\n"); 143 144 return results.toString(); 145 } 146 147 } | Popular Tags |