Package info.bliki.wiki.template

Examples of info.bliki.wiki.template.ITemplateFunction


        sb.append("<table border=\"1\"><th>Template name</th><th>Implemented in class</th><th>Description</th>");
        for (Map.Entry<String, ITemplateFunction> e : t.entrySet()) {
            sb.append("<tr><td>");
            sb.append(e.getKey());
            sb.append("</td><td>");
            ITemplateFunction tf = e.getValue();
            Class<?> cl1 = tf.getClass().getEnclosingClass();
            if (cl1 == null)
                cl1 = tf.getClass();
            String s1 = cl1.getCanonicalName();
            sb.append(s1);
            sb.append("</td><td>");
            doc = tf.getFunctionDoc();
            if (doc == null) {
                sb.append("No documentation available");
            } else {
                sb.append(doc);
            }
View Full Code Here


        int endOffset = fCurrentPosition - 2;
        Object[] objs = createParameterMap(fSource, startTemplatePosition, fCurrentPosition - startTemplatePosition - 2);
        String templateName = ((String) objs[1]);
        @SuppressWarnings("unchecked")
        List<String> parts = (List<String>) objs[0];
        ITemplateFunction templateFunction = null;
        int currOffset = 0;
        if (templateName.startsWith("subst:")) {
            templateFunction = Subst.CONST;
            currOffset = 6;
        } else if (templateName.startsWith("safesubst:")) {
            templateFunction = Safesubst.CONST;
            currOffset = 10;
        } else {
            return false;
        }

        parts.set(0, templateName.substring(currOffset));
        plainContent = templateFunction.parseFunction(parts, fWikiModel, fSource, startTemplatePosition + currOffset, endOffset, false);
        fCurrentPosition = endPosition;
        if (plainContent != null) {
            writer.append(plainContent);
            return true;
        }
View Full Code Here

            String function = templateName.substring(0, currOffset - 1).trim();
            if (function != null) {
                if (Configuration.PARSER_FUNCTIONS) {
                    System.out.println(function);
                }
                ITemplateFunction templateFunction = fWikiModel.getTemplateFunction(function);
                if (templateFunction != null) {
                    // if (function.charAt(0) == '#') {
                    // #if:, #ifeq:,...
                    parts.set(0, templateName.substring(currOffset));
                    // if (Configuration.PARSER_FUNCTIONS) {
                    // System.out.println(function + ": " + parts);
                    // }
                    plainContent = templateFunction.parseFunction(parts, fWikiModel, fSource, startTemplatePosition + currOffset, endOffset,
                            false);
                    fCurrentPosition = endPosition;
                    if (plainContent != null) {
                        TemplateParser.parseRecursive(plainContent, fWikiModel, writer, false, false);
                    }
View Full Code Here

    sb.append("<table border=\"1\"><th>Template name</th><th>Implemented in class</th><th>Description</th>");
    for (Map.Entry<String, ITemplateFunction> e : t.entrySet()) {
      sb.append("<tr><td>");
      sb.append(e.getKey());
      sb.append("</td><td>");
      ITemplateFunction tf = e.getValue();
      Class<?> cl1 = tf.getClass().getEnclosingClass();
      if (cl1 == null)
        cl1 = tf.getClass();
      String s1 = cl1.getCanonicalName();
      sb.append(s1);
      sb.append("</td><td>");
      doc = tf.getFunctionDoc();
      if (doc == null) {
        sb.append("No documentation available");
      } else {
        sb.append(doc);
      }
View Full Code Here

    templateName = buf.toString();
    int currOffset = checkParserFunction(templateName);
    if (currOffset > 0) {
      String function = templateName.substring(0, currOffset - 1).trim();
      if (function != null) {
        ITemplateFunction templateFunction = fWikiModel.getTemplateFunction(function);
        if (templateFunction != null) {
          // if (function.charAt(0) == '#') {
          // #if:, #ifeq:,...
          parts.set(0, templateName.substring(currOffset));
          plainContent = templateFunction.parseFunction(parts, fWikiModel, fSource, startTemplatePosition + currOffset, endOffset);
          fCurrentPosition = endPosition;
          if (plainContent != null) {
            TemplateParser.parseRecursive(plainContent, fWikiModel, writer, false, false);
            return true;
          }
View Full Code Here

TOP

Related Classes of info.bliki.wiki.template.ITemplateFunction

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.