--- /dev/null
+package org.argeo.slc.diff;\r
+\r
+/**\r
+ * <code>DiffMissing</code> using the XPath of the position as\r
+ * <code>DiffKey</code>\r
+ */\r
+public class DiffMissingXml extends DiffMissing {\r
+\r
+ public DiffMissingXml(XPathDiffPosition position) {\r
+ super(position, new DiffKeyXml(position.getXPath()));\r
+ }\r
+\r
+ /** Implementation of <code>DiffKey</code> based on an XPath string. */\r
+ protected static class DiffKeyXml implements DiffKey {\r
+ private final String xPath;\r
+\r
+ public DiffKeyXml(String xPath) {\r
+ this.xPath = xPath;\r
+ }\r
+\r
+ public String getXPath() {\r
+ return xPath;\r
+ }\r
+\r
+ @Override\r
+ public String toString() {\r
+ return xPath;\r
+ }\r
+\r
+ @Override\r
+ public boolean equals(Object obj) {\r
+ if (!(obj instanceof DiffKeyXml))\r
+ return false;\r
+ return xPath.equals(((DiffKeyXml) obj).xPath);\r
+ }\r
+\r
+ @Override\r
+ public int hashCode() {\r
+ return xPath.hashCode();\r
+ }\r
+\r
+ }\r
+}\r