Package org.htmlparser.tags

Examples of org.htmlparser.tags.AppletTag


    // Register the image scanner
    parser.registerScanners();
    parseAndAssertNodeCount(2);
    assertTrue("Node should be an applet tag", node[0] instanceof AppletTag);
    // Check the data in the applet tag
    AppletTag appletTag = (AppletTag) node[0];
    String expectedRawString = "<APPLET CODE=\"Myclass.class\" CODEBASE=\"www.kizna.com\" ARCHIVE=\"test.jar\">\r\n"
        + "<PARAM VALUE=\"Value1\" NAME=\"Param1\">\r\n"
        + "<PARAM VALUE=\"Somik\" NAME=\"Name\">\r\n"
        + "<PARAM VALUE=\"23\" NAME=\"Age\">\r\n" + "</APPLET>";
    assertStringEquals("toHTML()", expectedRawString, appletTag.toHtml());
  }
View Full Code Here


    parser.addScanner(new AppletScanner("-a"));

    parseAndAssertNodeCount(2);
    assertTrue("Node should be an applet tag", node[0] instanceof AppletTag);
    // Check the data in the applet tag
    AppletTag appletTag = (AppletTag) node[0];
    assertEquals("Class Name", "Myclass.class", appletTag.getAppletClass());
    assertEquals("Archive", "test.jar", appletTag.getArchive());
    assertEquals("Codebase", "www.kizna.com", appletTag.getCodeBase());
    // Check the params data
    int cnt = 0;
    for (Enumeration e = appletTag.getParameterNames(); e.hasMoreElements();) {
      String paramName = (String) e.nextElement();
      String paramValue = appletTag.getAttribute(paramName);
      assertEquals("Param " + cnt + " value", paramsMap.get(paramName), paramValue);
      cnt++;
    }
    assertEquals("Number of params", new Integer(paramsData.length), new Integer(cnt));
  }
View Full Code Here

    return MATCH_STRING;
  }

  public Tag createTag(TagData tagData, CompositeTagData compositeTagData) throws ParserException {

    return new AppletTag(tagData, compositeTagData);
  }
View Full Code Here

          }
        } else if (node instanceof ImageTag) {
          ImageTag image = (ImageTag) node;
          binUrlStr = image.getImageURL();
        } else if (node instanceof AppletTag) {
          AppletTag applet = (AppletTag) node;
          binUrlStr = applet.getAppletClass();
        } else if (node instanceof InputTag) {
          InputTag input = (InputTag) node;
          // we check the input tag type for image
          String strType = input.getAttribute("type");
          if (strType != null && strType.equalsIgnoreCase("image")) {
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.AppletTag

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.