1 18 19 package org.apache.jmeter.testelement.property; 20 21 import org.apache.jmeter.testelement.TestElement; 22 23 26 public class StringProperty extends AbstractProperty 27 { 28 String value; 29 String savedValue; 30 31 public StringProperty(String name, String value) 32 { 33 super(name); 34 this.value = value; 35 } 36 37 public StringProperty() 38 { 39 super(); 40 } 41 42 45 public void setRunningVersion(boolean runningVersion) 46 { 47 super.setRunningVersion(runningVersion); 48 if(runningVersion) 49 { 50 savedValue = value; 51 } 52 else 53 { 54 savedValue = null; 55 } 56 } 57 58 public void setObjectValue(Object v) 59 { 60 value = v.toString(); 61 } 62 63 66 public String getStringValue() 67 { 68 return value; 69 } 70 71 74 public Object getObjectValue() 75 { 76 return value; 77 } 78 79 82 public Object clone() 83 { 84 StringProperty prop = (StringProperty) super.clone(); 85 prop.value = value; 86 return prop; 87 } 88 89 93 public void setValue(String value) 94 { 95 this.value = value; 96 } 97 98 101 public void recoverRunningVersion(TestElement owner) 102 { 103 if (savedValue != null) 104 { 105 value = savedValue; 106 } 107 } 108 } 109 | Popular Tags |