1 16 package test.encoding; 17 18 import org.apache.axis.description.AttributeDesc; 19 import org.apache.axis.description.FieldDesc; 20 import org.apache.axis.description.TypeDesc; 21 import org.apache.axis.encoding.SimpleType; 22 23 import javax.xml.namespace.QName ; 24 25 28 public class SimpleBean implements SimpleType { 29 public String value; public float temp; 32 private static TypeDesc typeDesc = new TypeDesc(SimpleBean.class); 33 static { 34 FieldDesc fd = new AttributeDesc(); 35 fd.setFieldName("temp"); 36 fd.setXmlName(new QName ("foo", "temp")); 37 typeDesc.addFieldDesc(fd); 38 } 39 public static TypeDesc getTypeDesc() { return typeDesc; } 40 41 44 public SimpleBean(String val) 45 { 46 value = val; 47 } 48 49 public String getValue() { 50 return value; 51 } 52 53 public void setValue(String value) { 54 this.value = value; 55 } 56 57 public float getTemp() { 58 return temp; 59 } 60 61 public void setTemp(float temp) { 62 this.temp = temp; 63 } 64 65 public String toString() { 66 return value; 67 } 68 69 public boolean equals(Object obj) 70 { 71 if (obj == null || !(obj instanceof SimpleBean)) 72 return false; 73 SimpleBean other = (SimpleBean)obj; 74 if (other.getTemp() != temp) { 75 return false; 76 } 77 if (value == null) { 78 return other.getValue() == null; 79 } 80 return value.equals(other.getValue()); 81 } 82 } 83 | Popular Tags |