Examples of NodeList


Examples of com.dotcms.repackage.org.w3c.dom.NodeList

      s = os.toString();

      is = new ByteArrayInputStream(s.getBytes());
      Document doc = builder.parse(is);

      NodeList nl = doc.getElementsByTagName("img");
      for (int i = 0; i < nl.getLength(); i++) {
        Node n = nl.item(i);
        Node srcNode = n.getAttributes().getNamedItem("src");
        String srcText = srcNode.getNodeValue();
        String newText = getRealPath(srcText, host, url);
        String cleanText = cleanPath(newText);
        srcNode.setNodeValue(cleanText);
View Full Code Here

Examples of com.google.gwt.dom.client.NodeList

     */

    public void apply(XPathContext context) {
        switch (position) {
            case FIRST: {
                NodeList list = content.getChildNodes();
                int count = list.getLength();
                for (int i=count-1; i>=0; i--) {
                    targetNode.insertFirst(list.getItem(i));
                }
                break;
            }
            case LAST:{
                while (content.hasChildNodes()) {
                    targetNode.appendChild(content.getFirstChild());
                }
                break;
            }
            case BEFORE: {
                Node refNode = targetNode.getChild(position);
                NodeList list = content.getChildNodes();
                int count = list.getLength();
                for (int i=0; i < count; i++) {
                    targetNode.insertBefore(list.getItem(i), refNode);
                }
                break;
            }
            case AFTER: {
                Node refNode = targetNode.getChild(position);
                NodeList list = content.getChildNodes();
                int count = list.getLength();
                for (int i=count-1; i>=0; i--) {
                    targetNode.insertAfter(list.getItem(i), refNode);
                }
                break;
            }
            default:
                throw new UnsupportedOperationException("Unknown insert position " + position);
View Full Code Here

Examples of com.google.gwt.xml.client.NodeList

   * {@inheritDoc }
   */
  @Override
  public Element getRootElement() throws XmlException {

    NodeList nodeList = this.document.getChildNodes();

    for (int i = 0; i < nodeList.getLength(); i++) {
      Node n = nodeList.item(i);
      if (n.getNodeType() == Node.ELEMENT_NODE) {
        Element root = (Element) n;
        return root;
      }
    }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.NodeList

    FunctionDefinition functionBar = unit.getChild(1);
    assertEquals("bar", functionBar.getName());
    ReturnStatement returnStatement = functionBar.getChild(0);
    FunctionInvocation callFoo = returnStatement.getExpression(0);
    assertEquals("foo", callFoo.getName());
    NodeList parameters = callFoo.getParameters();
    FunctionInvocation callFooAgain = parameters.get(0);
    assertEquals("foo", callFooAgain.getName());
    assertEquals(0, callFooAgain.getChildren().size());
  }
View Full Code Here

Examples of hudson.slaves.NodeList

        nl.remove(n);
        setNodes(nl);
    }

    public void setNodes(List<? extends Node> nodes) throws IOException {
        this.slaves = new NodeList(nodes);
        updateComputerList();
        trimLabels();
        save();
    }
View Full Code Here

Examples of jmt.engine.QueueNet.NodeList

   * the representation of classes and servers at CommonModel level (by a Key) and
   * the representation at engine level
   */
  public void initialize() {
    QueueNetwork net = dispatcher.getSimulation().getNetwork();
    NodeList nodeList = net.getNodes();
    JobClassList classList = net.getJobClasses();
    TreeMap<String, Object> tm = new TreeMap<String, Object>();
    //a TreeMap is used to speedup the following code
    for (int j = 0; j < servers.size(); j++) {
      Object thisKey = servers.get(j);
      String thisName = mediator.getStationDefinition().getStationName(thisKey);
      tm.put(thisName, thisKey);
    }
    //performs the server mapping
    for (int i = 0; i < nodeList.size(); i++) {
      NetNode temp = nodeList.get(i);
      NodeSection serviceSection = null;
      try {
        serviceSection = temp.getSection(NodeSection.SERVICE);
      } catch (NetException ne) {
      }
View Full Code Here

Examples of ma.glasnost.orika.impl.generator.Node.NodeList

        StringBuilder out = new StringBuilder();
        while (!fieldMappings.isEmpty()) {
            Set<FieldMap> associated = code.getAssociatedMappings(fieldMappings, fieldMappings.get(0));
            fieldMappings.removeAll(associated);
           
            NodeList sourceNodes = new NodeList();
            NodeList destNodes = new NodeList();
           
            for (FieldMap map : associated) {

                Node.addFieldMap(map, sourceNodes, true);
                Node.addFieldMap(map, destNodes, false);
View Full Code Here

Examples of mf.org.w3c.dom.NodeList

   
   
    public int getIndex()
    {
        Node        parent;
        NodeList    options;
        int            i;
       
        // Locate the parent SELECT. Note that this OPTION might be inside a
        // OPTGROUP inside the SELECT. Or it might not have a parent SELECT.
        // Everything is possible. If no parent is found, return -1.
        parent = getParentNode();
        while ( parent != null && ! ( parent instanceof HTMLSelectElement ) )
            parent = parent.getParentNode();
        if ( parent != null )
        {
            // Use getElementsByTagName() which creates a snapshot of all the
            // OPTION elements under the SELECT. Access to the returned NodeList
            // is very fast and the snapshot solves many synchronization problems.
            options = ( (HTMLElement) parent ).getElementsByTagName( "OPTION" );
            for ( i = 0 ; i < options.getLength() ; ++i )
                if ( options.item( i ) == this )
                    return i;
        }
        return -1;
    }
View Full Code Here

Examples of org.apache.axiom.c14n.omwrapper.interfaces.NodeList

        dp.init();
    }

    public void testGetChildNode() {
        // this nl should not contain any text node
        NodeList nl = dp.doc.getChildNodes();
        for (int i = 0; i < nl.getLength(); i++) {
            assertFalse("node type can't be Text", (Node.TEXT_NODE == nl.item(i).getNodeType()));
        }
    }
View Full Code Here

Examples of org.apache.kato.katoview.commands.helpers.NodeList

            //  set branch deadlock for all nodes between startNode
            //  and currNode
           
            endNode = currNode.waitingOn;
            currNode = startNode;
            NodeList branchList = null;
            while (currNode != endNode)
            {
              if (null == branchList)
              {
                branchList = new NodeList(currNode, nodeListNum++);
              }
              currNode.deadlock = MonitorNode.BRANCH_DEADLOCK;
              currNode = currNode.waitingOn;
              branchList.add(currNode);
              if (currNode != endNode)
                currNode.inList = branchList;
            }
           
            if (endNode.inList.isLoop())
            {
              lists.insertElementAt(branchList, lists.indexOf(endNode.inList));
            }
            else
            {
              NodeList oldList = endNode.inList;
             
              // FIXME: the below line will cause problems with at least
              //  one case that was not considered when attachOrSplit was
              //  coded: if a NodeList n1 has already been split and another
              //  NodeList n2 tries to attach to the end of n1, then n1 will
              //  allow n2 to attach to n1, while what n1 should really do is
              //  just return n2 and not allow n2 to attach to itself
              NodeList split = endNode.inList.attachOrSplit(branchList, nodeListNum++);
              if (null != split)
              {
                lists.insertElementAt(split, lists.indexOf(oldList));
                lists.insertElementAt(branchList, lists.indexOf(oldList));
              }
            }
            break;
          }
         
          if (currNode.waitingOn.visit == visit)
          {
            // we've encountered a node in the same visit as the current
            //  visit, ie. we've found a loop; first flag the whole loop
            //  with a loop deadlock flag, then flag the rest of the nodes
            //  in the chain with a branch deadlock
           
            endNode = currNode.waitingOn;
            currNode = endNode;
            NodeList loopList = new NodeList(currNode, nodeListNum++);
            lists.insertElementAt(loopList, 0);
           
            do
            {
              currNode.deadlock = MonitorNode.LOOP_DEADLOCK;
              currNode = currNode.waitingOn;
              loopList.add(currNode);
              currNode.inList = loopList;
            } while (currNode != endNode);
           
            currNode = startNode;
            NodeList branchList = null;
            while (currNode != endNode)
            {
              if (null == branchList)
              {
                branchList = new NodeList(currNode, nodeListNum++);
                lists.insertElementAt(branchList, 0);
              }
              currNode.deadlock = MonitorNode.BRANCH_DEADLOCK;
              currNode = currNode.waitingOn;
              branchList.add(currNode);
              if (currNode != endNode)
                currNode.inList = branchList;
            }
            break;
          }
         
          currNode = currNode.waitingOn;
        }
       
        visit++;
      }

      if (lists.isEmpty())
      {
        out.print("\n");
        out.print("\t no deadlocks detected");
        out.print("\n");
        return;
      }
     
      boolean lastListWasLoop = true;
      Iterator itList = lists.iterator();

      // Step 5. print the lists
      while (itList.hasNext())
      {
        NodeList list = (NodeList)itList.next();
       
        if (list.isLoop()) {
          out.print("\n    deadlock loop:\n");
          lastListWasLoop = true;
        } else if (lastListWasLoop)  { // && !list.isLoop()
          out.print("\n\n    deadlock branch(es):\n");
          lastListWasLoop = false;
        }
       
        out.print("\t  " + list.toString());
        out.print("\n");
      }
      out.print("\n");
      jrnum++;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.