コード例 #1
0
ファイル: ConflictLog.java プロジェクト: BackupTheBerlios/tdm
 protected void add(
     boolean list,
     boolean warning,
     int type,
     String text,
     BaseNode b,
     BranchNode ba,
     BranchNode bb) {
   ConflictEntry ce = new ConflictEntry();
   ce.text = text;
   ce.type = type;
   ce.b = b;
   // let b1=left and b2=right
   if (ba == null) {
     ba = bb;
     bb = null;
   }
   if (ba != null && ba.isLeftTree()) {
     ce.b1 = ba;
     ce.b2 = bb;
   } else {
     ce.b1 = bb;
     ce.b2 = ba;
   }
   if (list) {
     ce.mergePath = pt.getPathString();
   } else ce.mergePath = pt.getFullPathString();
   if (warning) warnings.addLast(ce);
   else conflicts.addLast(ce);
 }
コード例 #2
0
ファイル: ConflictLog.java プロジェクト: BackupTheBerlios/tdm
  protected void outputConflict(ConflictEntry ce, ContentHandler ch) throws SAXException {
    AttributesImpl atts = new AttributesImpl();
    ch.startElement("", "", TYPETAGS[ce.type], atts);
    ch.characters(ce.text.toCharArray(), 0, ce.text.length());
    atts = new AttributesImpl();
    atts.addAttribute("", "", "tree", "CDATA", "merged");
    atts.addAttribute("", "", "path", "CDATA", ce.mergePath);
    ch.startElement("", "", "node", atts);
    ch.endElement("", "", "node");

    if (ce.b != null) {
      atts = new AttributesImpl();
      atts.addAttribute("", "", "tree", "CDATA", "base");
      atts.addAttribute("", "", "path", "CDATA", PathTracker.getPathString(ce.b));
      ch.startElement("", "", "node", atts);
      ch.endElement("", "", "node");
    }
    if (ce.b1 != null) {
      atts = new AttributesImpl();
      atts.addAttribute("", "", "tree", "CDATA", "branch1");
      atts.addAttribute("", "", "path", "CDATA", PathTracker.getPathString(ce.b1));
      ch.startElement("", "", "node", atts);
      ch.endElement("", "", "node");
    }
    if (ce.b2 != null) {
      atts = new AttributesImpl();
      atts.addAttribute("", "", "tree", "CDATA", "branch2");
      atts.addAttribute("", "", "path", "CDATA", PathTracker.getPathString(ce.b2));
      ch.startElement("", "", "node", atts);
      ch.endElement("", "", "node");
    }
    ch.endElement("", "", TYPETAGS[ce.type]);
  }