Package info.bliki.wiki.tags.util

Examples of info.bliki.wiki.tags.util.TagStack


  protected void initialize() {
    if (!fInitialized) {
      fWikiListener = null;
      fToCSet = null;
      fTableOfContent = null;
      fTagStack = new TagStack();
      fReferences = null;
      fReferenceNames = null;
      fParserRecursionCount = 0;
      fRecursionLevel = 0;
      fTemplateRecursionCount = 0;
View Full Code Here


    writer.append("}}");
    return;
  }

  public TagStack swapStack(TagStack stack) {
    TagStack temp = fTagStack;
    fTagStack = stack;
    return temp;
  }
View Full Code Here

          } else {
            // numbered list
            buf.append("</ol>");
          }
        } else {
          TagStack stack = ((WPListElement) element).getTagStack();
          if (stack != null) {
            converter.nodesToText(stack.getNodeList(), buf, wikiModel);
          }
          // wikiModel.appendStack(((WPListElement)
          // element).getTagStack());
        }
      }
View Full Code Here

        beginHTMLTag(buf, subList);
        // recursive call:
        renderSubListHTML(subList, converter, buf, wikiModel);
        endHTMLTag(buf, subList);
      } else {
        TagStack stack = ((WPListElement) element).getTagStack();
        if (stack != null) {
          converter.nodesToText(stack.getNodeList(), buf, wikiModel);
        }
        // wikiModel.appendStack(((WPListElement)
        // element).getTagStack());
      }
View Full Code Here

        // beginHTMLTag(buf, subList);
        // recursive call:
        renderSubListPlainText(subList, converter, buf, wikiModel);
        // endHTMLTag(buf, subList);
      } else {
        TagStack stack = ((WPListElement) element).getTagStack();
        if (stack != null) {
          converter.nodesToText(stack.getNodeList(), buf, wikiModel);
        }
        // wikiModel.appendStack(((WPListElement)
        // element).getTagStack());
      }
View Full Code Here

          // } else {
          // // numbered list
          // buf.append("</ol>");
          // }
        } else {
          TagStack stack = ((WPListElement) element).getTagStack();
          if (stack != null) {
            converter.nodesToText(stack.getNodeList(), buf, wikiModel);
          }
        }
      }
     
      if (NEW_LINES) {
View Full Code Here

    }
  }

  public TagStack parseRecursiveInternal(IWikiModel wikiModel, boolean createOnlyLocalStack, boolean noTOC) {
    // local stack for this wiki snippet
    TagStack localStack = new TagStack();
    // global wiki model stack
    TagStack globalWikiModelStack = wikiModel.swapStack(localStack);
    try {
      // fix for infinite recursion
      if (wikiModel.incrementParserRecursionCount() > Configuration.GLOBAL_RECURSION_LIMIT) {
        TagNode error = new TagNode("span");
        error.addAttribute("class", "error", true);
        error.addChild(new ContentToken("Error - total recursion count limit exceeded parsing wiki tags."));
        localStack.append(error);
        return localStack;
      }

      int level = wikiModel.incrementRecursionLevel();

      if (level > Configuration.PARSER_RECURSION_LIMIT) {
        TagNode error = new TagNode("span");
        error.addAttribute("class", "error", true);
        error.addChild(new ContentToken("Error - recursion limit exceeded parsing wiki tags."));
        localStack.append(error);
        return localStack;
      }
      // WikipediaParser parser = new WikipediaParser(rawWikitext,
      // wikiModel.isTemplateTopic(), wikiModel.getWikiListener());
      setModel(wikiModel);
      setNoToC(noTOC);
      runParser();
      return localStack;
    } catch (Exception e) {
      e.printStackTrace();
      TagNode error = new TagNode("span");
      error.addAttribute("class", "error", true);
      error.addChild(new ContentToken(e.getClass().getSimpleName()));
      localStack.append(error);
    } catch (Error e) {
      e.printStackTrace();
      TagNode error = new TagNode("span");
      error.addAttribute("class", "error", true);
      error.addChild(new ContentToken(e.getClass().getSimpleName()));
      localStack.append(error);
    } finally {
      wikiModel.decrementRecursionLevel();
      if (!createOnlyLocalStack) {
        // append the resursively parsed local stack to the global wiki
        // model
        // stack
        globalWikiModelStack.append(localStack);
      }
      wikiModel.swapStack(globalWikiModelStack);
    }

    return localStack;
View Full Code Here

      if (type != null) {
        clazzValue = type + clazzValue;
      }
      captionTagNode.addAttribute("class", clazzValue, false);
      //     
      TagStack localStack = WikipediaParser.parseRecursive(caption, this, true, true);
      captionTagNode.addChildren(localStack.getNodeList());
      String altAttribute = imageFormat.getAlt();
      if (altAttribute == null) {
        altAttribute = captionTagNode.getBodyString();
        imageFormat.setAlt(altAttribute);
      }
View Full Code Here

  protected void initialize() {
    if (!fInitialized) {
      fWikiListener = null;
      fToCSet = null;
      fTableOfContent = null;
      fTagStack = new TagStack();
      fReferences = null;
      fReferenceNames = null;
      fRecursionLevel = 0;
      fSectionCounter = 0;
      fReplaceColon = false;
View Full Code Here

  public int stackSize() {
    return fTagStack.size();
  }

  public TagStack swapStack(TagStack stack) {
    TagStack temp = fTagStack;
    fTagStack = stack;
    return temp;
  }
View Full Code Here

TOP

Related Classes of info.bliki.wiki.tags.util.TagStack

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.