1 4 package com.tc.config.schema.utils; 5 6 import org.apache.xmlbeans.XmlObject; 7 8 13 public class ObjectEqualsXmlObjectComparator implements XmlObjectComparator { 14 15 public boolean equals(XmlObject one, XmlObject two) { 16 try { 17 checkEquals(one, two); 18 return true; 19 } catch (NotEqualException nee) { 20 return false; 21 } 22 } 23 24 public void checkEquals(XmlObject one, XmlObject two) throws NotEqualException { 25 if ((one == null) != (two == null)) throw new NotEqualException("nullness not the same"); 26 if (one == null) return; 27 if (!one.equals(two)) throw new NotEqualException("not equal"); 28 } 29 30 } 31 | Popular Tags |