Examples of TemplateSequenceModel


Examples of freemarker.template.TemplateSequenceModel

            if (node == null) {
                throw new _TemplateModelException(
                        "The target node of recursion is missing or null.");
            }
        }
        TemplateSequenceModel children = node.getChildNodes();
        if (children == null) return;
        for (int i=0; i<children.size(); i++) {
            TemplateNodeModel child = (TemplateNodeModel) children.get(i);
            if (child != null) {
                visit(child, namespaces);
            }
        }
    }
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

            Boolean result = entireInputMatched;
            return result != null ? result.booleanValue() : isEntrieInputMatchesAndStoreResults();
        }
       
        TemplateModel getGroups() {
           TemplateSequenceModel entireInputMatchGroups = this.entireInputMatchGroups;
           if (entireInputMatchGroups == null) {
               Matcher t = this.firedEntireInputMatcher;
               if (t == null) {
                   isEntrieInputMatchesAndStoreResults();
                   t = this.firedEntireInputMatcher;
               }
               final Matcher firedEntireInputMatcher = t;
              
                entireInputMatchGroups = new TemplateSequenceModel() {
                   
                    public TemplateModel get(int i) throws TemplateModelException {
                        try {
                            return new SimpleScalar(firedEntireInputMatcher.group(i));
                        } catch (Exception e) {
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

                    throws TemplateModelException {
                if (chunkIndex >= numberOfChunks) {
                    return null;
                }
               
                return new TemplateSequenceModel() {
                   
                    private final int baseIndex = chunkIndex * chunkSize;

                    public TemplateModel get(int relIndex)
                            throws TemplateModelException {
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

                    }
                    index++;
                }
            }
            else if (list instanceof TemplateSequenceModel) {
                TemplateSequenceModel tsm = (TemplateSequenceModel) list;
                int size = tsm.size();
                for (index =0; index <size; index++) {
                    loopVar = tsm.get(index);
                    hasNext = (size > index +1);
                    if (nestedBlock != null) {
                        env.visitByHiddingParent(nestedBlock);
                    }
                }
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

    }
   
    // A hacky routine used by VisitNode and RecurseNode
   
    TemplateSequenceModel evaluateStringsToNamespaces(Environment env) throws TemplateException {
        TemplateSequenceModel val = (TemplateSequenceModel) eval(env);
        SimpleSequence result = new SimpleSequence(val.size());
        for (int i=0; i<items.size(); i++) {
            Object itemExpr = items.get(i);
            if (itemExpr instanceof StringLiteral) {
                String s = ((StringLiteral) itemExpr).getAsString();
                try {
                    Environment.Namespace ns = env.importLib(s, null);
                    result.add(ns);
                }
                catch (IOException ioe) {
                    throw new _MiscTemplateException(((StringLiteral) itemExpr), new Object[] {
                            "Couldn't import library ", new _DelayedJQuote(s), ": ",
                            new _DelayedGetMessage(ioe) });
                }
            }
            else {
                result.add(val.get(i));
            }
        }
        return result;
    }
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

                return true;
            }
        });

        // TemplateSequenceModel
        params.put("property8", new TemplateSequenceModel() {
            public TemplateModel get(int arg0) throws TemplateModelException {
                return null;
            }

            public int size() throws TemplateModelException {
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

                return true;
            }
        });

        // TemplateSequenceModel
        params.put("property8", new TemplateSequenceModel() {
            public TemplateModel get(int arg0) throws TemplateModelException {
                return null;
            }

            public int size() throws TemplateModelException {
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

    boolean pass = false;
    if (StringUtils.isBlank(url)) {
      // url为空,则认为有权限。
      pass = true;
    } else {
      TemplateSequenceModel perms = getPerms(env);
      if (perms == null) {
        // perms为null,则代表不需要判断权限。
        pass = true;
      } else {
        String perm;
        for (int i = 0, len = perms.size(); i < len; i++) {
          perm = ((TemplateScalarModel) perms.get(i)).getAsString();
          if (url.startsWith(perm)) {
            pass = true;
            break;
          }
        }
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

                return true;
            }
        });

        // TemplateSequenceModel
        params.put("property8", new TemplateSequenceModel() {
            public TemplateModel get(int arg0) throws TemplateModelException {
                return null;
            }

            public int size() throws TemplateModelException {
View Full Code Here

Examples of freemarker.template.TemplateSequenceModel

                return true;
            }
        });

        // TemplateSequenceModel
        params.put("property8", new TemplateSequenceModel() {
            public TemplateModel get(int arg0) throws TemplateModelException {
                return null;
            }

            public int size() throws TemplateModelException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.