*
* @author Stefano "Kismet" Lenzi - kismet-sl@users.sourceforge.net - 2005
*
*/
public void addDevice(Device d) {
Node deviceListNode = getDeviceNode().getNode(DeviceList.ELEM_NAME);
if (deviceListNode == null) {
// deviceListNode = new Node(ServiceList.ELEM_NAME); twa wrong
// ELEM_NAME;
deviceListNode = new Node(DeviceList.ELEM_NAME);
getDeviceNode().addNode(deviceListNode);
}
deviceListNode.addNode(d.getDeviceNode());
d.setRootNode(null);
if (getRootNode() == null) {
Node root = new Node(RootDescription.ROOT_ELEMENT);
root.setNameSpace("", RootDescription.ROOT_ELEMENT_NAMESPACE);
Node spec = new Node(RootDescription.SPECVERSION_ELEMENT);
Node maj = new Node(RootDescription.MAJOR_ELEMENT);
maj.setValue("1");
Node min = new Node(RootDescription.MINOR_ELEMENT);
min.setValue("0");
spec.addNode(maj);
spec.addNode(min);
root.addNode(spec);
setRootNode(root);
}