Examples of collectInto()


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

        parseAndAssertNodeCount(1);
        assertType("html tag",Html.class,node[0]);
        Html html = (Html)node[0];
        NodeList nodeList = new NodeList();
        NodeClassFilter filter = new NodeClassFilter (TitleTag.class);
        html.collectInto(nodeList, filter);
        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

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

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

        parser.addScanner(new SpanScanner());
        parser.addScanner(new TableScanner(parser));
        parseAndAssertNodeCount(1);
        TableTag tableTag = (TableTag) node[0];
        NodeList nodeList = new NodeList();
        tableTag.collectInto(nodeList, Span.class);
        Node[] spans = nodeList.toNodeArray();
        assertSpanContent(spans);
    }
}
View Full Code Here

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

    parser.addScanner(new SpanScanner());
    parser.addScanner(new TableScanner(parser));
    parseAndAssertNodeCount(1);
    TableTag tableTag = (TableTag) node[0];
    NodeList nodeList = new NodeList();
    tableTag.collectInto(nodeList, Span.class);
    Node[] spans = nodeList.toNodeArray();
    assertSpanContent(spans);
  }
}
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.