Package info.bliki.htmlcleaner

Examples of info.bliki.htmlcleaner.ContentToken


    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();

    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here


    append(aTagNode);
    aTagNode.addAttribute("href", isbnString, true);
    aTagNode.addAttribute("class", "external text", true);
    aTagNode.addAttribute("title", isbnString, true);
    aTagNode.addAttribute("rel", "nofollow", true);
    aTagNode.addChild(new ContentToken(isbnPureText));
  }
View Full Code Here

    append(aTagNode);
    aTagNode.addAttribute("href", link, true);
    aTagNode.addAttribute("class", "external free", true);
    aTagNode.addAttribute("title", link, true);
    aTagNode.addAttribute("rel", "nofollow", true);
    aTagNode.addChild(new ContentToken(linkName));
  }
View Full Code Here

    if (whiteStart) {
      try {
        final int whiteEndPosition = fCurrentPosition - diff;
        int count = whiteEndPosition - whiteStartPosition;
        if (count > 0) {
          fWikiModel.append(new ContentToken(new String(fSource, whiteStartPosition, count)));
        }
      } finally {
        fWhiteStart = false;
      }
    }
View Full Code Here

          }
        } else if (rawNamespaceTopic.charAt(colonIndex + 1) == '=') {
          // found an SMW attribute
          String attributeValue = rawNamespaceTopic.substring(colonIndex + 2);
          if (addSemanticAttribute(nameSpace, attributeValue)) {
            append(new ContentToken(attributeValue));
            return true;
          }
        }

      }
View Full Code Here

    createContentToken(fWhiteStart, fWhiteStartPosition, 1);
    fWikiModel.pushNode(tag);
    // String subStr = fStringSource.substring(startPosition, endPosition);
    int count = endPosition - startPosition;
    if (count > 0) {
      fWikiModel.append(new ContentToken(new String(fSource, startPosition, count)));
    }
    fWikiModel.popNode();
  }
View Full Code Here

        fWikiModel.append(tag);
      } else {
        fWikiModel.pushNode(tag);
        if (null != bodyString) {
          if (tag instanceof INoBodyParsingTag) {
            ((TagNode) tag).addChild(new ContentToken(bodyString));
          } else {
            // recursively filter tags within the tags body string
            TracParser.parseRecursive(bodyString.trim(), fWikiModel, false, true);
          }
        }
        if (tag instanceof IBodyTag) {
          fWikiModel.popNode();
        }
      }
    } catch (IllegalArgumentException e) {
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken("IllegalArgumentException: " + command + " - " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    } catch (Throwable e) {
      e.printStackTrace();
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken(command + ": " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
      return;
    }
  }
View Full Code Here

    if (fWhiteStart) {
      try {
        final int whiteEndPosition = fCurrentPosition - diff;
        int count = whiteEndPosition - fWhiteStartPosition;
        if (count > 0) {
          fWikiModel.append(new ContentToken(fStringSource.substring(fWhiteStartPosition, fWhiteStartPosition + count)));
        }
      } finally {
        fWhiteStart = false;
      }
    }
View Full Code Here

        fWikiModel.append(tag);
      } else {
        fWikiModel.pushNode(tag);
        if (null != bodyString) {
          if (tag instanceof INoBodyParsingTag) {
            ((TagNode) tag).addChild(new ContentToken(bodyString));
          } else {
            // recursively filter tags within the tags body string
            WikipediaParser.parseRecursive(bodyString.trim(), fWikiModel, false, true);
          }
        }
        if (tag instanceof IBodyTag) {
          fWikiModel.popNode();
        }
      }
    } catch (IllegalArgumentException e) {
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken("IllegalArgumentException: " + command + " - " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    } catch (Throwable e) {
      e.printStackTrace();
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken(command + ": " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    }
  }
View Full Code Here

          Object item = childrenIt.next();
          if (item != null) {
            if (item instanceof List) {
              nodesToText((List) item, resultBuffer, model);
            } else if (item instanceof ContentToken) {
              ContentToken contentToken = (ContentToken) item;
              String content = contentToken.getContent();
              Utils.escapeXmlToBuffer(content, resultBuffer, true, true, true);
            } else if (item instanceof HTMLTag) {
              ((HTMLTag) item).renderHTML(this, resultBuffer, model);
            } else if (item instanceof TagNode) {
              TagNode node = (TagNode) item;
View Full Code Here

TOP

Related Classes of info.bliki.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.