Examples of childAt()


Examples of org.htmlparser.tags.Bullet.childAt()

    NodeList nestedBulletLists = ((CompositeTag) node[0]).searchFor(BulletList.class);
    assertEquals("bullets in first list", 2, nestedBulletLists.size());
    BulletList firstList = (BulletList) nestedBulletLists.elementAt(0);
    Bullet firstBullet = (Bullet) firstList.childAt(0);
    Node firstNodeInFirstBullet = firstBullet.childAt(0);
    assertType("first child in bullet", StringNode.class, firstNodeInFirstBullet);
    assertStringEquals("expected text", "Energy supply\r\n" + " (Campbell)  ", firstNodeInFirstBullet
        .toPlainTextString());
  }
}
View Full Code Here

Examples of org.htmlparser.tags.BulletList.childAt()

        NodeList nestedBulletLists =
            ((CompositeTag) node[0]).searchFor(BulletList.class);
        assertEquals("bullets in first list", 2, nestedBulletLists.size());
        BulletList firstList = (BulletList) nestedBulletLists.elementAt(0);
        Bullet firstBullet = (Bullet) firstList.childAt(0);
        Node firstNodeInFirstBullet = firstBullet.childAt(0);
        assertType(
            "first child in bullet",
            StringNode.class,
            firstNodeInFirstBullet);
View Full Code Here

Examples of org.htmlparser.tags.BulletList.childAt()

            nestedBulletLists.size()
        );
        BulletList firstList =
            (BulletList)nestedBulletLists.elementAt(0);
        Bullet firstBullet =
            (Bullet)firstList.childAt(0);
        Node firstNodeInFirstBullet =
            firstBullet.childAt(0);
        assertType(
            "first child in bullet",
            Text.class,
View Full Code Here

Examples of org.htmlparser.tags.BulletList.childAt()

    parseAndAssertNodeCount(1);

    NodeList nestedBulletLists = ((CompositeTag) node[0]).searchFor(BulletList.class);
    assertEquals("bullets in first list", 2, nestedBulletLists.size());
    BulletList firstList = (BulletList) nestedBulletLists.elementAt(0);
    Bullet firstBullet = (Bullet) firstList.childAt(0);
    Node firstNodeInFirstBullet = firstBullet.childAt(0);
    assertType("first child in bullet", StringNode.class, firstNodeInFirstBullet);
    assertStringEquals("expected text", "Energy supply\r\n" + " (Campbell)  ", firstNodeInFirstBullet
        .toPlainTextString());
  }
View Full Code Here

Examples of org.htmlparser.tags.CompositeTag.childAt()

                    url,
                    tag.isEmptyXmlTag()),
                new CompositeTagData(tag, endTag, nodeList));
        for (int i = 0; i < newTag.getChildCount(); i++)
        {
            Node child = newTag.childAt(i);
            child.setParent(newTag);
        }
        return newTag;
    }
View Full Code Here

Examples of org.htmlparser.tags.CompositeTag.childAt()

  private Tag createTag() throws ParserException {
    CompositeTag newTag = (CompositeTag) scanner.createTag(new TagData(tag.elementBegin(), endTag.elementEnd(),
        startingLineNumber, endingLineNumber, tag.getText(), currLine, url, tag.isEmptyXmlTag()),
        new CompositeTagData(tag, endTag, nodeList));
    for (int i = 0; i < newTag.getChildCount(); i++) {
      Node child = newTag.childAt(i);
      child.setParent(newTag);
    }
    return newTag;
  }
View Full Code Here

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

        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
        assertType ("bogus div", Div.class, div.childAt (2));
        assertTrue ("bogus div should have no children", 0 == ((Div)div.childAt (2)).getChildCount ());
    }
View Full Code Here

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

        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
        assertType ("bogus div", Div.class, div.childAt (2));
        assertTrue ("bogus div should have no children", 0 == ((Div)div.childAt (2)).getChildCount ());
    }
}
View Full Code Here

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

        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
        assertType ("bogus div", Div.class, div.childAt (2));
        assertTrue ("bogus div should have no children", 0 == ((Div)div.childAt (2)).getChildCount ());
    }
}
View Full Code Here

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

        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
        assertType ("bogus div", Div.class, div.childAt (2));
        assertTrue ("bogus div should have no children", 0 == ((Div)div.childAt (2)).getChildCount ());
    }
}
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.