Subversion Repositories svn.mios

Rev

Rev 709 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
709 adamjking 1
package org.midibox.mios.xml;
2
 
721 adamjking 3
import java.util.Iterator;
709 adamjking 4
 
721 adamjking 5
import org.midibox.mios.HexFileUploadDevice;
6
import org.midibox.mios.HexFileUploadDeviceManager;
7
import org.midibox.utils.xml.XMLUtils;
8
import org.w3c.dom.Element;
9
import org.w3c.dom.Node;
10
 
11
public class HexFileUploadDeviceManagerXML extends XMLUtils {
12
 
13
    protected HexFileUploadDeviceManager hexFileUploadDeviceManager;
14
 
15
    protected String hexFileUploadDevicesTag = "hexFileUploadDevices";
16
 
17
    protected String hexFileUploadDeviceTag = "hexFileUploadDevice";
18
 
19
    public HexFileUploadDeviceManagerXML(
20
            HexFileUploadDeviceManager hexFileUploadDeviceManager,
21
            String rootElementTag) {
22
 
23
        super(rootElementTag);
24
 
25
        this.hexFileUploadDeviceManager = hexFileUploadDeviceManager;
26
    }
27
 
28
    public void saveXML(Node node) {
29
 
30
        super.saveXML(node);
31
 
32
        Element hexFileUploadDevicesElement = document
33
                .createElement(hexFileUploadDevicesTag);
34
 
35
        rootElement.appendChild(hexFileUploadDevicesElement);
36
 
37
        Iterator it = hexFileUploadDeviceManager.getHexFileUploadDevices()
38
                .iterator();
39
 
40
        while (it.hasNext()) {
41
 
42
            HexFileUploadDevice hexFileUploadDevice = (HexFileUploadDevice) it
43
                    .next();
44
 
45
            HexFileUploadDeviceXML hexFileUploadDeviceXML = new HexFileUploadDeviceXML(
46
                    hexFileUploadDevice, hexFileUploadDeviceTag);
47
 
48
            hexFileUploadDeviceXML.saveXML(hexFileUploadDevicesElement);
49
        }
50
    }
709 adamjking 51
}