Examples of collectInto()


Examples of org.htmlparser.Node.collectInto()

            setListValues(item, list);
           
            //summary
            list.removeAll();
            NodeFilter summaryFilter = new CssClassFilter("summary");
            infoNode.collectInto(list, summaryFilter);
            item.setSummary(NodeUtils.getTextData(list));
           
            item.addDetailFlag(MovieItem.DETAIL_MEDIUM);
           
        } catch (ParserException e) {
View Full Code Here

Examples of org.htmlparser.Node.collectInto()

            all.removeAll();
            infoCollector.clear();
      Node disc = iter.nextNode();
     
      //collect all the nodes for the movie items
      disc.collectInto(all, infoCollector);
     
      int i=0;
      //parse out all the information
            String queueId = null;
            boolean discSet = false;
View Full Code Here

Examples of org.htmlparser.Node.collectInto()

  public void collectInto(NodeList collectionList, String filter) {
    super.collectInto(collectionList, filter);
    Node node;
    for (SimpleNodeIterator e = children(); e.hasMoreNodes();) {
      node = e.nextNode();
      node.collectInto(collectionList, filter);
    }
  }

  public void collectInto(NodeList collectionList, Class nodeType) {
    super.collectInto(collectionList, nodeType);
View Full Code Here

Examples of org.htmlparser.Node.collectInto()

    int i = 0;
    NodeList collectionList = new NodeList();

    for (NodeIterator e = parser.elements(); e.hasMoreNodes();) {
      Node node = e.nextNode();
      node.collectInto(collectionList, LinkTag.class);
    }
    assertEquals("Size of collection vector should be 11", 11, collectionList.size());
    // All items in collection vector should be links
    for (SimpleNodeIterator e = collectionList.elements(); e.hasMoreNodes();) {
      Node node = e.nextNode();
View Full Code Here

Examples of org.htmlparser.Node.collectInto()

    int i = 0;
    NodeList collectionList = new NodeList();

    for (NodeIterator e = parser.elements(); e.hasMoreNodes();) {
      Node node = e.nextNode();
      node.collectInto(collectionList, ImageTag.IMAGE_TAG_FILTER);
    }
    assertEquals("Size of collection vector should be 5", 5, collectionList.size());
    // All items in collection vector should be links
    for (SimpleNodeIterator e = collectionList.elements(); e.hasMoreNodes();) {
      Node node = e.nextNode();
View Full Code Here

Examples of org.htmlparser.Node.collectInto()

    protected String getTextAtNode(NodeList nodeList, int index) {
        Node node = nodeList.elementAt(index);

        NodeList textNode = new NodeList();
        node.collectInto(textNode, new NodeClassFilter(Text.class));

        return textNode.elementAt(0).getText();
    }

    protected abstract TableTag getReportTable(Parser htmlParser) throws ParserException;
View Full Code Here

Examples of org.htmlparser.Node.collectInto()

        if (nodeList.size() > 0) {
            Node first = nodeList.elementAt(0);
            nodeList = new NodeList();
            Node parent = first.getChildren() != null && first.getChildren().size() > 0?first:first.getParent();

            parent.collectInto(nodeList, new NodeClassFilter(Text.class));
            text = nodeList.toHtml(true).replaceAll(" ", "").trim();
        }

        return text;
    }
View Full Code Here

Examples of org.htmlparser.tags.Div.collectInto()

        parser.addScanner(new DivScanner());
        parser.addScanner(new SpanScanner());
        parseAndAssertNodeCount(1);
        Div div = (Div) node[0];
        NodeList nodeList = new NodeList();
        div.collectInto(nodeList, Span.class);
        Node[] spans = nodeList.toNodeArray();
        assertSpanContent(spans);
    }

    public void testTwoLevelNesting() throws ParserException
View Full Code Here

Examples of org.htmlparser.tags.Div.collectInto()

    parser.addScanner(new DivScanner());
    parser.addScanner(new SpanScanner());
    parseAndAssertNodeCount(1);
    Div div = (Div) node[0];
    NodeList nodeList = new NodeList();
    div.collectInto(nodeList, Span.class);
    Node[] spans = nodeList.toNodeArray();
    assertSpanContent(spans);
  }

  public void testTwoLevelNesting() throws ParserException {
View Full Code Here

Examples of org.htmlparser.tags.Html.collectInto()

        parser.addScanner(new HtmlScanner());
        parseAndAssertNodeCount(1);
        assertType("html tag", Html.class, node[0]);
        Html html = (Html) node[0];
        NodeList nodeList = new NodeList();
        html.collectInto(nodeList, TitleTag.class);
        assertEquals("nodelist size", 1, nodeList.size());
        Node node = nodeList.elementAt(0);
        assertType("expected title tag", TitleTag.class, node);
        TitleTag titleTag = (TitleTag) node;
        assertStringEquals("title", "Some Title", titleTag.getTitle());
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.