use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Device method addService.
/**
* Add a Service to device without checking for duplicate or syntax error
*
* @param s
* Add Service s to the Device
*/
public void addService(Service s) {
Node serviceListNode = getDeviceNode().getNode(ServiceList.ELEM_NAME);
if (serviceListNode == null) {
serviceListNode = new Node(ServiceList.ELEM_NAME);
getDeviceNode().addNode(serviceListNode);
}
serviceListNode.addNode(s.getServiceNode());
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Device method setURLBase.
private void setURLBase(String value) {
if (isRootDevice() == true) {
Node node = getRootNode().getNode(URLBASE_NAME);
if (node != null) {
node.setValue(value);
return;
}
node = new Node(URLBASE_NAME);
node.setValue(value);
int index = 1;
if (getRootNode().hasNodes() == false)
index = 1;
getRootNode().insertNode(node, index);
}
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Device method addIcon.
public boolean addIcon(Icon icon) {
Node deviceNode = getDeviceNode();
if (deviceNode == null)
return false;
Node iconListNode = deviceNode.getNode(IconList.ELEM_NAME);
if (iconListNode == null) {
iconListNode = new Node(IconList.ELEM_NAME);
deviceNode.addNode(iconListNode);
}
Node iconNode = new Node(Icon.ELEM_NAME);
if (icon.getIconNode() != null) {
iconNode.set(icon.getIconNode());
}
iconListNode.addNode(iconNode);
if (icon.hasURL() && icon.hasBytes()) {
iconBytesMap.put(icon.getURL(), icon.getBytes());
}
return true;
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class SOAPRequest method print.
// //////////////////////////////////////////////
// print
// //////////////////////////////////////////////
public void print() {
Debug.message(toString());
if (hasContent() == true)
return;
Node rootElem = getRootNode();
if (rootElem == null)
return;
Debug.message(rootElem.toString());
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class SOAPResponse method print.
// //////////////////////////////////////////////
// print
// //////////////////////////////////////////////
public void print() {
Debug.message(toString());
if (hasContent() == true)
return;
Node rootElem = getRootNode();
if (rootElem == null)
return;
Debug.message(rootElem.toString());
}
Aggregations