Package org.htmlcleaner

Examples of org.htmlcleaner.ContentToken


  public void buildEditLinkUrl(int section) {
    if (fParserInput.getAllowSectionEdit()) {
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("style", "font-size:90%;float:right;margin-left:5px;", false);
      divTagNode.addChild(new ContentToken("["));
      append(divTagNode);

      String url = "";
      try {
        url = LinkUtil.buildEditLinkUrl(fParserInput.getContext(), fParserInput.getVirtualWiki(), fParserInput.getTopicName(),
            null, section);
      } catch (Exception e) {
        logger.severe("Failure while building link for topic " + fParserInput.getVirtualWiki() + " / "
            + fParserInput.getTopicName(), e);
      }
      TagNode aTagNode = new TagNode("a");
      aTagNode.addAttribute("href", url, false);
      aTagNode.addChild(new ContentToken(Utilities.formatMessage("common.sectionedit", fParserInput.getLocale())));
      divTagNode.addChild(aTagNode);
      divTagNode.addChild(new ContentToken("]"));
    }
  }
View Full Code Here


      Node out = new Node(hash, depth, height + 1);
      callback.handle(tn, out);

      return out;
    } else if (root instanceof ContentToken) {
      ContentToken cn = (ContentToken) root;

      int hash = HashCodeUtil.SEED;
      hash = HashCodeUtil.hash(hash, cn.getContent());
      hash = HashCodeUtil.hash(hash, depth);
      hash = HashCodeUtil.hash(hash, 0);

      Node out = new Node(hash, depth, 0);
      return out;
View Full Code Here

        if (item instanceof CommentToken) {
          CommentToken commentNode = (CommentToken) item;
          Comment comment = document.createComment( commentNode.getContent().toString() );
          element.appendChild(comment);
        } else if (item instanceof ContentToken) {
          ContentToken contentToken = (ContentToken) item;
          String content = contentToken.getContent();
          String nodeName = element.getNodeName();
          boolean specialCase = props.isUseCdataForScriptAndStyle() &&
          ("script".equalsIgnoreCase(nodeName) || "style".equalsIgnoreCase(nodeName));
          if (escapeXml && !specialCase) {
            content = escapeXml(content, props, true);
View Full Code Here

TOP

Related Classes of org.htmlcleaner.ContentToken

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.