Coverage Report - com.buckosoft.PicMan.dom.ImportAnalyzeDom
 
Classes in this File Line Coverage Branch Coverage Complexity
ImportAnalyzeDom
0%
0/15
0%
0/12
7
 
 1  
 /******************************************************************************
 2  
  * ImportAnalyzeDom.java - XML for PicMan's Import Pics Editor
 3  
  * 
 4  
  * PicMan - The BuckoSoft Picture Manager in Java
 5  
  * Copyright(c) 2015 - Dick Balaska
 6  
  * 
 7  
  */
 8  
 package com.buckosoft.PicMan.dom;
 9  
 
 10  
 import java.util.List;
 11  
 
 12  
 import org.dom4j.Document;
 13  
 import org.dom4j.DocumentHelper;
 14  
 import org.dom4j.Element;
 15  
 
 16  
 import com.buckosoft.PicMan.business.PicImporterImpl.PossibleDates;
 17  
 import com.buckosoft.PicMan.domain.Pic;
 18  
 
 19  
 /** XML for PicMan's Import Pics Editor
 20  
  * @author Dick Balaska
 21  
  */
 22  0
 public class ImportAnalyzeDom {
 23  
 
 24  
         static public Document createDocument(List<Pic> possibleDups, PossibleDates pds) {
 25  0
                 Document document = DocumentHelper.createDocument();
 26  0
                 Element root = document.addElement("ImportAnalysis");
 27  0
                 if (possibleDups != null && !possibleDups.isEmpty()) {
 28  0
                         Element ele = root.addElement("PossibleDuplicates");
 29  0
                         for (Pic pic : possibleDups) {
 30  0
                                 ele.addElement("pic").addText(pic.getName());
 31  0
                         }
 32  
                 }
 33  0
                 if (pds.getFileDate() != null)
 34  0
                         root.addElement("fileDate").addText("" + pds.getFileDate().getTime());
 35  0
                 if (pds.getTakenDate() != null)
 36  0
                         root.addElement("takenDate").addText("" + pds.getTakenDate().getTime());
 37  0
                 if (pds.getCustomDate() != null)
 38  0
                         root.addElement("customDate").addText("" + pds.getCustomDate().getTime());
 39  0
                 return(document);
 40  
         }
 41  
 
 42  
 }