1 package examples.binding; 2 3 public class Property { 4 public static final int STRING=1; 5 public static final int INTEGER=2; 6 public static final int BEAN=3; 7 8 private String name; 9 private int type; 10 private String refType; 11 public Property(String name, 12 int type) { 13 this.name = name; 14 this.type = type; 15 } 16 public Property(String name, 17 int type, 18 String refType) { 19 this.name = name; 20 this.type = type; 21 this.refType = refType; 22 } 23 24 public String getName() { return name; } 25 public int getType() { return type; } 26 public String getRefType() { return refType; } 27 public String toString() { 28 if (type == STRING) { 29 return "String "+name; 30 } else if (type == INTEGER) { 31 return "Integer "+name; 32 } else { 33 return refType+" "+name; 34 } 35 } 36 } 37 | Popular Tags |