1 32 33 package it.businesslogic.ireport.gui.expbuilder; 34 35 39 public class ExpObject { 40 41 public static final int TYPE_FIELD = 0; 42 public static final int TYPE_VARIABLE = 1; 43 public static final int TYPE_PARAM = 2; 44 45 private String name = ""; 46 private int type = TYPE_FIELD; 47 private String classType = "java.lang.String"; 48 49 50 public ExpObject(String name, int type, String classType) { 51 52 this.setName(name); 53 this.setType(type); 54 this.setClassType(classType); 55 } 56 57 public String getName() { 58 return name; 59 } 60 61 public void setName(String name) { 62 this.name = name; 63 } 64 65 public int getType() { 66 return type; 67 } 68 69 public void setType(int type) { 70 this.type = type; 71 } 72 73 public String getClassType() { 74 return classType; 75 } 76 77 public void setClassType(String classType) { 78 this.classType = classType; 79 } 80 81 public String getExpression() 82 { 83 if (getType() == TYPE_FIELD) return "$F{" + getName() + "}"; 84 if (getType() == TYPE_VARIABLE) return "$V{" + getName() + "}"; 85 if (getType() == TYPE_PARAM) return "$P{" + getName() + "}"; 86 return getName(); 87 } 88 89 90 91 } 92 | Popular Tags |