示例#1
0
 // Thanks for Giordano Sassaroli <*****@*****.**> (09/08/03)
 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;
 }
示例#2
0
 // Thanks for Giordano Sassaroli <*****@*****.**> (09/08/03)
 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;
 }
示例#3
0
 private Node getVariableNode() {
   Node rootNode = getEnvelopeNode();
   if (rootNode == null) return null;
   if (rootNode.hasNodes() == false) return null;
   Node propNode = rootNode.getNode(0);
   if (propNode.hasNodes() == false) return null;
   return propNode.getNode(0);
 }
示例#4
0
  private Node createPropertySetNode(String varName, String value) {
    Node propSetNode = new Node(/*XMLNS + SOAP.DELIM + */ PROPERTYSET);

    propSetNode.setNameSpace(XMLNS, Subscription.XMLNS);

    Node propNode = new Node(/*XMLNS + SOAP.DELIM + */ PROPERTY);
    propSetNode.addNode(propNode);

    // Thanks for Giordano Sassaroli <*****@*****.**> (05/22/03)
    // Node varNameNode = new Node(XMLNS + SOAP.DELIM + varName);
    Node varNameNode = new Node(varName);
    varNameNode.setValue(value);
    propNode.addNode(varNameNode);

    return propSetNode;
  }