Package freemarker.template

Examples of freemarker.template.SimpleCollection$SimpleTemplateModelIterator


        return new SimpleCollection(getKeys().iterator());
    }
   
    public TemplateCollectionModel values() {
        final Iterator iter = getKeys().iterator();
        return new SimpleCollection(
            new Iterator() {
                public boolean hasNext() {
                    return iter.hasNext();
                }
                public Object next() {
View Full Code Here


      List<TSType> dataList = TSTypegroup.allTypes
          .get(name.toLowerCase());
      if (dataList == null) {
        dataList = new ArrayList<TSType>();
      }
      env.setGlobalVariable(var, new SimpleCollection(dataList));
    } else {
      // table表查询
      StringBuilder sql = new StringBuilder("");
      sql.append("select distinct ").append(name)
          .append(" as typecode, ");
      if (text == null || text.trim().length() <= 0) {
        sql.append(name).append(" as typename ");
      } else {
        sql.append(text).append(" as typename ");
      }
      sql.append(" from ").append(tablename);
      sql.append(" order by ").append(name);
      List<Map<String, Object>> dataList = systemService.findForJdbc(sql
          .toString());
      env.setGlobalVariable(var, new SimpleCollection(dataList));
    }
    body.render(env.getOut());
  }
View Full Code Here

                Set<String> result = new HashSet<String>();
                for (ODocument document : query) {
                    String[] tags = DBUtil.toStringArray(document.field("tags"));
                    Collections.addAll(result, tags);
                }
                return new SimpleCollection(result);
            }
            String[] documentTypes = DocumentTypes.getDocumentTypes();
            for (String docType : documentTypes) {
                if ((docType+"s").equals(key)) {
                    return new SimpleSequence(DocumentList.wrap(DBUtil.query(db, "select * from "+docType+" order by date desc").iterator()));
View Full Code Here

            return keySet().size();
        }

        public TemplateCollectionModel keys()
        {
            return new SimpleCollection(keySet());
        }
View Full Code Here

           
            for(Iterator it = keys.iterator(); it.hasNext();)
            {
                list.add(get((String)it.next()));
            }
            return new SimpleCollection(list);
        }
View Full Code Here

    public TemplateModel remove(String key) {
        return parameters.remove(key);
    }

    public TemplateCollectionModel keys() {
        return new SimpleCollection(parameters.keySet());
    }
View Full Code Here

    public int size() {
        return parameters.size();
    }

    public TemplateCollectionModel values()  {
        return new SimpleCollection(parameters.values());
    }
View Full Code Here

        for(int i = 0; i < size; ++i) {
            if(paramValues.get(i) != null) {
                nonNullValueKeys.add(new SimpleScalar(paramNames.get(i)));
            }
        }
        return new SimpleCollection(nonNullValueKeys);
    }
View Full Code Here

            TemplateModel value = paramValues.get(i);
            if(value != null) {
                nonNullValues.add(value);
            }
        }
        return new SimpleCollection(nonNullValues);
    }
View Full Code Here

TOP

Related Classes of freemarker.template.SimpleCollection$SimpleTemplateModelIterator

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.