Subversion Repositories svn.mios

Rev

Rev 727 | 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 org.midibox.midi.xml.VirtualMidiDeviceXML;
4
import org.midibox.mios.HexFileUploadDevice;
727 adamjking 5
import org.w3c.dom.Element;
721 adamjking 6
import org.w3c.dom.Node;
709 adamjking 7
 
721 adamjking 8
public class HexFileUploadDeviceXML extends VirtualMidiDeviceXML {
9
 
10
    protected HexFileUploadDevice hexFileUploadDevice;
11
 
722 adamjking 12
    public static final String TAG_ROOT_ELEMENT = "hexFileUploadDevice";
721 adamjking 13
 
14
    public HexFileUploadDeviceXML(HexFileUploadDevice hexFileUploadDevice,
15
            String rootElementTag) {
16
 
17
        super(hexFileUploadDevice, rootElementTag);
18
 
19
        this.hexFileUploadDevice = hexFileUploadDevice;
738 adamjking 20
 
727 adamjking 21
        tags.add(HexFileUploadXML.TAG_ROOT_ELEMENT);
721 adamjking 22
    }
23
 
727 adamjking 24
    protected void parseElement(Element element) {
25
 
26
        super.parseElement(element);
27
 
28
        String name = element.getNodeName();
29
 
30
        if (name == rootElementTag) {
31
 
32
            HexFileUploadXML hexFileUploadXML = new HexFileUploadXML(
33
                    hexFileUploadDevice.getHexFileUpload(),
34
                    HexFileUploadXML.TAG_ROOT_ELEMENT);
738 adamjking 35
 
727 adamjking 36
            hexFileUploadXML.loadXML(element);
37
        }
38
    }
39
 
721 adamjking 40
    public void saveXML(Node node) {
41
 
42
        super.saveXML(node);
43
 
44
        HexFileUploadXML hexFileUploadXML = new HexFileUploadXML(
722 adamjking 45
                hexFileUploadDevice.getHexFileUpload(),
46
                HexFileUploadXML.TAG_ROOT_ELEMENT);
721 adamjking 47
 
48
        hexFileUploadXML.saveXML(rootElement);
49
    }
709 adamjking 50
}