1 19 package org.netbeans.modules.xml.xdm.diff; 20 21 import java.io.IOException ; 22 import java.util.List ; 23 import org.netbeans.modules.xml.xdm.nodes.Document; 24 25 30 public class SyncPreparation { 31 private Document newDoc; 32 private Document oldDoc; 33 private List <Difference> diffs; 34 private IOException error; 35 36 37 public SyncPreparation(Document newDoc) { 38 assert newDoc != null : "Argument newDoc is null"; 39 this.newDoc = newDoc; 40 } 41 42 public SyncPreparation(Document oldDoc, List <Difference> diffs) { 43 assert oldDoc != null : "Argument oldDoc is null."; 44 this.oldDoc = oldDoc; 45 this.diffs = diffs; 46 } 47 48 public SyncPreparation(Exception err) { 49 assert err != null : "Argument err is null."; 50 if (err instanceof IOException ) { 51 error = (IOException ) err; 52 } else { 53 error = new IOException (); 54 error.initCause(err); 55 } 56 } 57 58 public Document getNewDocument() { 59 return newDoc; 60 } 61 62 public Document getOldDocument() { 63 return oldDoc; 64 } 65 66 public List <Difference> getDifferences() { 67 return diffs; 68 } 69 70 public boolean hasErrors() { 71 return error != null; 72 } 73 74 public IOException getError() { 75 return error; 76 } 77 78 } 79 | Popular Tags |