1 2 17 18 19 package org.apache.poi.hwpf.usermodel; 20 21 import org.apache.poi.hwpf.model.types.SEPAbstractType; 22 23 import java.lang.reflect.Field ; 24 import java.lang.reflect.AccessibleObject ; 25 import java.lang.reflect.Array ; 26 27 public class SectionProperties 28 extends SEPAbstractType 29 { 30 public SectionProperties() 31 { 32 field_20_brcTop = new BorderCode(); 33 field_21_brcLeft = new BorderCode(); 34 field_22_brcBottom = new BorderCode(); 35 field_23_brcRight = new BorderCode(); 36 field_26_dttmPropRMark = new DateAndTime(); 37 } 38 39 public Object clone() 40 throws CloneNotSupportedException 41 { 42 SectionProperties copy = (SectionProperties)super.clone(); 43 copy.field_20_brcTop = (BorderCode)field_20_brcTop.clone(); 44 copy.field_21_brcLeft = (BorderCode)field_21_brcLeft.clone(); 45 copy.field_22_brcBottom = (BorderCode)field_22_brcBottom.clone(); 46 copy.field_23_brcRight = (BorderCode)field_23_brcRight.clone(); 47 copy.field_26_dttmPropRMark = (DateAndTime)field_26_dttmPropRMark.clone(); 48 49 return copy; 50 } 51 52 public boolean equals(Object obj) 53 { 54 Field [] fields = SectionProperties.class.getSuperclass().getDeclaredFields(); 55 AccessibleObject.setAccessible(fields, true); 56 try 57 { 58 for (int x = 0; x < fields.length; x++) 59 { 60 Object obj1 = fields[x].get(this); 61 Object obj2 = fields[x].get(obj); 62 if (obj1 == null && obj2 == null) 63 { 64 continue; 65 } 66 if (!obj1.equals(obj2)) 67 { 68 return false; 69 } 70 } 71 return true; 72 } 73 catch (Exception e) 74 { 75 return false; 76 } 77 } 78 79 } 80 | Popular Tags |