public String getFaultActor() { Node node = getFaultActorNode(); if (node == null) return ""; return node.getValue(); }
public String getVarName() { Node node = getVarNameNode(); if (node == null) return ""; return node.getValue(); }
public String getNodeValue(String name) { Node node = getNode(name); if (node != null) return node.getValue(); return ""; }
public int getUPnPErrorCode() { Node errorCodeNode = getUPnPErrorCodeNode(); if (errorCodeNode == null) return -1; String errorCodeStr = errorCodeNode.getValue(); try { return Integer.parseInt(errorCodeStr); } catch (Exception e) { return -1; } }
public String getFaultCode() { Node node = getFaultCodeNode(); if (node == null) return ""; return node.getValue(); }
public String getFaultString() { Node node = getFaultStringNode(); if (node == null) return ""; return node.getValue(); }
public String getReturnValue() { Node node = getReturnNode(); if (node == null) return ""; return node.getValue(); }
public String getValue() { return getAllowedValueNode().getValue(); } }
public String getUPnPErrorDescription() { Node errorDescNode = getUPnPErrorDescriptionNode(); if (errorDescNode == null) return ""; return errorDescNode.getValue(); }
private Property getProperty(Node varNode) { Property prop = new Property(); if (varNode == null) return prop; // remove the event namespace String variableName = varNode.getName(); int index = variableName.lastIndexOf(':'); if (index != -1) variableName = variableName.substring(index + 1); prop.setName(variableName); prop.setValue(varNode.getValue()); return prop; }
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 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 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 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; }
public String getReturnValue() { Node node = getReturnNode(); if (node == null) return ""; return node.getValue(); }
public String getFaultString() { Node node = getFaultStringNode(); if (node == null) return ""; return node.getValue(); }
public String getFaultActor() { Node node = getFaultActorNode(); if (node == null) return ""; return node.getValue(); }
public String getNodeValue(String name) { Node node = getNode(name); if (node != null) return node.getValue(); return ""; }
public String getVarName() { Node node = getVarNameNode(); if (node == null) return ""; return node.getValue(); }
public String getFaultCode() { Node node = getFaultCodeNode(); if (node == null) return ""; return node.getValue(); }