Package org.htmlparser.tags.data

Examples of org.htmlparser.tags.data.CompositeTagData


        NodeList childVector = new NodeList();
        childVector.add(stringNode);
        ScriptTag scriptTag =
            new ScriptTag(
                new TagData(0, 10, "Tag Contents", "tagline"),
                new CompositeTagData(null, null, childVector));

        assertNotNull("Script Tag object creation", scriptTag);
        assertEquals("Script Tag Begin", 0, scriptTag.elementBegin());
        assertEquals("Script Tag End", 10, scriptTag.elementEnd());
        assertEquals(
View Full Code Here


                    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);
        }
View Full Code Here

    public void testTypeHttps() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("https://www.someurl.com", "", "", false, false));
        assertTrue("This is a https link", linkTag.isHTTPSLink());
    }
View Full Code Here

    public void testTypeFtp() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("ftp://www.someurl.com", "", "", false, false));
        assertTrue("This is an ftp link", linkTag.isFTPLink());
    }
View Full Code Here

    public void testTypeJavaScript() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData(
                    "javascript://www.someurl.com",
                    "",
                    "",
                    false,
View Full Code Here

    public void testTypeHttpLink() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("http://www.someurl.com", "", "", false, false));
        assertTrue(
            "This is a http link : " + linkTag.getLink(),
            linkTag.isHTTPLink());
        linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("somePage.html", "", "", false, false));
        assertTrue(
            "This relative link is alsp a http link : " + linkTag.getLink(),
            linkTag.isHTTPLink());
        linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("ftp://somePage.html", "", "", false, false));
        assertTrue(
            "This is not a http link : " + linkTag.getLink(),
            !linkTag.isHTTPLink());
    }
View Full Code Here

    public void testTypeHttpLikeLink() throws ParserException
    {
        LinkTag linkTag =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("http://", "", "", false, false));
        assertTrue("This is a http link", linkTag.isHTTPLikeLink());
        LinkTag linkTag2 =
            new LinkTag(
                new TagData(0, 0, "", ""),
                new CompositeTagData(null, null, null),
                new LinkData("https://www.someurl.com", "", "", false, false));
        assertTrue("This is a https link", linkTag2.isHTTPLikeLink());
    }
View Full Code Here

  public void testCreation() {
    StringNode stringNode = new StringNode(new StringBuffer("Script Code"), 0, 0);
    NodeList childVector = new NodeList();
    childVector.add(stringNode);
    ScriptTag scriptTag = new ScriptTag(new TagData(0, 10, "Tag Contents", "tagline"), new CompositeTagData(null,
        null, childVector));

    assertNotNull("Script Tag object creation", scriptTag);
    assertEquals("Script Tag Begin", 0, scriptTag.elementBegin());
    assertEquals("Script Tag End", 10, scriptTag.elementEnd());
View Full Code Here

        "<A HREF=\"http://ads.samachar.com/bin/redirect/tech.txt?http://www.samachar.com/tech\r\nnical.html\"> Journalism 3.0</A>",
        linkTag.toHtml());
  }

  public void testTypeHttps() throws ParserException {
    LinkTag linkTag = new LinkTag(new TagData(0, 0, "", ""), new CompositeTagData(null, null, null), new LinkData(
        "https://www.someurl.com", "", "", false, false));
    assertTrue("This is a https link", linkTag.isHTTPSLink());
  }
View Full Code Here

        "https://www.someurl.com", "", "", false, false));
    assertTrue("This is a https link", linkTag.isHTTPSLink());
  }

  public void testTypeFtp() throws ParserException {
    LinkTag linkTag = new LinkTag(new TagData(0, 0, "", ""), new CompositeTagData(null, null, null), new LinkData(
        "ftp://www.someurl.com", "", "", false, false));
    assertTrue("This is an ftp link", linkTag.isFTPLink());
  }
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.data.CompositeTagData

Copyright © 2018 www.massapicom. 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.