1 16 17 package test.encoding; 18 19 import org.apache.axis.description.AttributeDesc; 20 import org.apache.axis.description.ElementDesc; 21 import org.apache.axis.description.FieldDesc; 22 import org.apache.axis.description.TypeDesc; 23 24 import javax.xml.namespace.QName ; 25 26 29 public class AttributeBean extends ParentBean { 30 private int age; 31 private float iD; 32 public String company; private java.lang.String name; private boolean male; 36 public AttributeBean() {} 37 38 public AttributeBean(int age, float iD, String name, String company, boolean male) { 39 this.age = age; 40 this.iD = iD; 41 this.name = name; 42 this.male = male; 43 this.company = company; 44 } 45 46 public int getAge() { 47 return age; 48 } 49 50 public void setAge(int age) { 51 this.age = age; 52 } 53 54 public float getID() { 55 return iD; 56 } 57 58 public void setID(float iD) { 59 this.iD = iD; 60 } 61 62 public java.lang.String getName() { 63 return name; 64 } 65 66 public void setName(java.lang.String name) { 67 this.name = name; 68 } 69 70 public boolean getMale() { 71 return male; 72 } 73 74 public void setMale(boolean male) { 75 this.male = male; 76 } 77 78 public boolean equals(Object obj) 79 { 80 if (obj == null || !(obj instanceof AttributeBean)) 81 return false; 82 AttributeBean other = (AttributeBean)obj; 83 if (other.getAge() != age) 84 return false; 85 if (other.getID() != iD) 86 return false; 87 if (other.getMale() != male) 88 return false; 89 if (name == null) { 90 if (other.getName() != null) { 91 return false; 92 } 93 }else if (!name.equals(other.getName())) { 94 return false; 95 } 96 if (company == null) { 97 if (other.company != null) { 98 return false; 99 } 100 } else if (!company.equals(other.company)) { 101 return false; 102 } 103 if (getParentFloat() != other.getParentFloat()) 104 return false; 105 if (getParentStr() != null) { 106 return getParentStr().equals(other.getParentStr()); 107 } 108 return other.getParentStr() == null; 109 } 110 111 private static TypeDesc typeDesc; 113 114 static { 115 typeDesc = new TypeDesc(AttributeBean.class); 116 FieldDesc field; 117 118 field = new AttributeDesc(); 120 field.setFieldName("name"); 121 field.setXmlName(new QName ("foo", "nameAttr")); 122 typeDesc.addFieldDesc(field); 123 124 field = new AttributeDesc(); 126 field.setFieldName("male"); 127 typeDesc.addFieldDesc(field); 128 129 field = new ElementDesc(); 131 field.setFieldName("age"); 132 field.setXmlName(new QName ("foo", "ageElement")); 133 typeDesc.addFieldDesc(field); 134 } 135 136 public static TypeDesc getTypeDesc() 137 { 138 return typeDesc; 139 } 140 } 141 | Popular Tags |