public boolean hasNodes() { if (0 < getNNodes()) return true; return false; }
public void output(PrintWriter ps, int indentLevel, boolean hasChildNode) { String indentString = getIndentLevelString(indentLevel); String name = getName(); String value = getValue(); if (hasNodes() == false || hasChildNode == false) { ps.print(indentString + "<" + name); outputAttributes(ps); // Thnaks for Tho Beisch (11/09/04) if (value == null || value.length() == 0) { // Not using the short notation <node /> because it cause compatibility trouble ps.println("></" + name + ">"); } else { ps.println(">" + XML.escapeXMLChars(value) + "</" + name + ">"); } return; } ps.print(indentString + "<" + name); outputAttributes(ps); ps.println(">"); int nChildNodes = getNNodes(); for (int n=0; n<nChildNodes; n++) { Node cnode = getNode(n); cnode.output(ps, indentLevel+1, true); } ps.println(indentString +"</" + name + ">"); }
public PropertyList getPropertyList() { PropertyList properties = new PropertyList(); Node varSetNode = getEnvelopeNode(); // I2P change: ParserException caught in getRootNode() causes // getEnvelopeNode() to return null if (varSetNode == null) return properties; for (int i = 0; i<varSetNode.getNNodes(); i++){ Node propNode = varSetNode.getNode(i); if (propNode == null) continue; Property prop = getProperty(propNode.getNode(0)); properties.add(prop); } return properties; }
public DeviceList getDeviceList() { DeviceList devList = new DeviceList(); Node devListNode = getDeviceNode().getNode(DeviceList.ELEM_NAME); if (devListNode == null) return devList; int nNode = devListNode.getNNodes(); for (int n = 0; n < nNode; n++) { Node node = devListNode.getNode(n); if (Device.isDeviceNode(node) == false) continue; Device dev = new Device(node); devList.add(dev); } return devList; }
public ServiceList getServiceList() { ServiceList serviceList = new ServiceList(); Node serviceListNode = getDeviceNode().getNode(ServiceList.ELEM_NAME); if (serviceListNode == null) return serviceList; int nNode = serviceListNode.getNNodes(); for (int n = 0; n < nNode; n++) { Node node = serviceListNode.getNode(n); if (Service.isServiceNode(node) == false) continue; Service service = new Service(node); serviceList.add(service); } return serviceList; }
public AllowedValueList getAllowedValueList() { AllowedValueList valueList= new AllowedValueList(); Node valueListNode = getStateVariableNode().getNode(AllowedValueList.ELEM_NAME); if (valueListNode == null) return null; int nNode = valueListNode.getNNodes(); for (int n=0; n<nNode; n++) { Node node = valueListNode.getNode(n); if (AllowedValue.isAllowedValueNode(node) == false) continue; AllowedValue allowedVal = new AllowedValue(node); valueList.add(allowedVal); } return valueList; }
public ArgumentList getResponse() { ArgumentList argList = new ArgumentList(); Node resNode = getActionResponseNode(); if (resNode == null) return argList; int nArgs = resNode.getNNodes(); for (int n=0; n<nArgs; n++) { Node node = resNode.getNode(n); String name = node.getName(); String value = node.getValue(); Argument arg = new Argument(name, value); argList.add(arg); } return argList; } }
public ActionList getActionList() { ActionList actionList = new ActionList(); Node scdpNode = getSCPDNode(); if (scdpNode == null) return actionList; Node actionListNode = scdpNode.getNode(ActionList.ELEM_NAME); if (actionListNode == null) return actionList; int nNode = actionListNode.getNNodes(); for (int n=0; n<nNode; n++) { Node node = actionListNode.getNode(n); if (Action.isActionNode(node) == false) continue; Action action = new Action(serviceNode, node); actionList.add(action); } return actionList; }
public ArgumentList getArgumentList() { ArgumentList argumentList = new ArgumentList(); Node argumentListNode = getActionNode().getNode(ArgumentList.ELEM_NAME); if (argumentListNode == null) return argumentList; int nodeCnt = argumentListNode.getNNodes(); for (int n=0; n<nodeCnt; n++) { Node node = argumentListNode.getNode(n); if (Argument.isArgumentNode(node) == false) continue; Argument argument = new Argument(getServiceNode(), node); argumentList.add(argument); } return argumentList; }
public boolean hasNodes() { if (0 < getNNodes()) return true; return false; }
public IconList getIconList() { IconList iconList = new IconList(); Node iconListNode = getDeviceNode().getNode(IconList.ELEM_NAME); if (iconListNode == null) return iconList; int nNode = iconListNode.getNNodes(); for (int n = 0; n < nNode; n++) { Node node = iconListNode.getNode(n); if (Icon.isIconNode(node) == false) continue; Icon icon = new Icon(node); if (icon.hasURL()) { String iconURL = icon.getURL(); byte iconBytes[] = iconBytesMap.get(iconURL); if (iconBytes != null) { icon.setBytes(iconBytes); } } iconList.add(icon); } return iconList; }
public ServiceStateTable getServiceStateTable() { ServiceStateTable stateTable = new ServiceStateTable(); Node stateTableNode = getSCPDNode().getNode(ServiceStateTable.ELEM_NAME); if (stateTableNode == null) return stateTable; Node serviceNode = getServiceNode(); int nNode = stateTableNode.getNNodes(); for (int n=0; n<nNode; n++) { Node node = stateTableNode.getNode(n); if (StateVariable.isStateVariableNode(node) == false) continue; StateVariable serviceVar = new StateVariable(serviceNode, node); stateTable.add(serviceVar); } return stateTable; }
public boolean hasNodes() { if (0 < getNNodes()) return true; return false; }
public ArgumentList getArgumentList() { Node actNode = getActionNode(); int nArgNodes = actNode.getNNodes(); ArgumentList argList = new ArgumentList(); for (int n=0; n<nArgNodes; n++) { Argument arg = new Argument(); Node argNode = actNode.getNode(n); arg.setName(argNode.getName()); arg.setValue(argNode.getValue()); argList.add(arg); } return argList; }
public int getNContentNodes() { return resultNode.getNNodes(); }
public int getNContentNodes() { return resultNode.getNNodes(); }
public boolean set(Node otherNode) { if (otherNode == null) return false; setName(otherNode.getName()); setValue(otherNode.getValue()); removeAllAttributes(); int nOtherAttributes = otherNode.getNAttributes(); for (int n=0; n<nOtherAttributes; n++) { Attribute otherAttr = otherNode.getAttribute(n); Attribute thisAttr = new Attribute(otherAttr); addAttribute(thisAttr); } removeAllNodes(); int nOtherChildNodes = otherNode.getNNodes(); for (int n=0; n<nOtherChildNodes; n++) { Node otherChildNode = otherNode.getNode(n); Node thisChildNode = new Node(); thisChildNode.set(otherChildNode); addNode(thisChildNode); } return true; }
void set(Node node) { int nElem = node.getNNodes(); for (int n=0; n<nElem; n++) { Node elem = node.getNode(n); if (elem.hasNodes() == true) continue; addRow(elem.getName(), elem.getValue()); } }
public PropertyList getPropertyList() { PropertyList properties = new PropertyList(); Node varSetNode = getEnvelopeNode(); for (int i = 0; i<varSetNode.getNNodes(); i++){ Node propNode = varSetNode.getNode(i); if (propNode == null) continue; Property prop = getProperty(propNode.getNode(0)); properties.add(prop); } return properties; }
public PropertyList getPropertyList() { PropertyList properties = new PropertyList(); Node varSetNode = getEnvelopeNode(); for (int i = 0; i<varSetNode.getNNodes(); i++){ Node propNode = varSetNode.getNode(i); if (propNode == null) continue; Property prop = getProperty(propNode.getNode(0)); properties.add(prop); } return properties; }