public TemplateCollectionModel keys() throws TemplateModelException { return ((TemplateHashModelEx) rootDataModel).keys(); }
private TemplateHashModelExKeyValuePairIterator(TemplateHashModelEx hash) throws TemplateModelException { this.hash = hash; keyIter = hash.keys().iterator(); }
private TemplateHashModelExEnumeration(TemplateHashModelEx hashEx) throws TemplateModelException { it = hashEx.keys().iterator(); }
public String[] keys() throws TemplateModelException { TemplateHashModelEx h = (TemplateHashModelEx) model; List list = new ArrayList(); TemplateModelIterator i = h.keys().iterator(); while (i.hasNext()) { list.add(((TemplateScalarModel) i.next()).getAsString()); } return (String[]) list.toArray(new String[list.size()]); }
@Override TemplateModel calculateResult(TemplateHashModelEx hashExModel, Environment env) throws TemplateModelException, InvalidReferenceException { TemplateCollectionModel keys = hashExModel.keys(); if (keys == null) throw newNullPropertyException("keys", hashExModel, env); return keys instanceof TemplateSequenceModel ? keys : new CollectionAndSequence(keys); }
private static void addKeys(Set set, SimpleSequence keySeq, TemplateHashModelEx hash) throws TemplateModelException { TemplateModelIterator it = hash.keys().iterator(); while (it.hasNext()) { TemplateScalarModel tsm = (TemplateScalarModel) it.next(); if (set.add(tsm.getAsString())) { // The first occurence of the key decides the index; // this is consisten with stuff like java.util.LinkedHashSet. keySeq.add(tsm); } } }
final TemplateModelIterator i; try { i = getModelEx().keys().iterator(); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e);
TemplateModelIterator keys = hash.keys().iterator(); while (keys.hasNext()) { String key = (String) unwrap(keys.next(), nullModel, permissive);
TemplateModelIterator rootNames = ((TemplateHashModelEx) rootDataModel).keys().iterator(); while (rootNames.hasNext()) { set.add(((TemplateScalarModel) rootNames.next()).getAsString());
/** * Adds all object in the hash as shared variable to the configuration; it's like doing several * {@link #setSharedVariable(String, Object)} calls, one for each hash entry. It doesn't remove the already added * shared variable before doing this. * * <p>Never use <tt>TemplateModel</tt> implementation that is not thread-safe for shared shared variable values, * if the configuration is used by multiple threads! It is the typical situation for Servlet based Web sites. * * <p>This method is <b>not</b> thread safe; use it with the same restrictions as those that modify setting values. * * @param hash a hash model whose objects will be copied to the * configuration with same names as they are given in the hash. * If a shared variable with these names already exist, it will be replaced * with those from the map. * * @see #setSharedVaribles(Map) * @see #setSharedVariable(String,Object) * @see #setSharedVariable(String,TemplateModel) */ public void setAllSharedVariables(TemplateHashModelEx hash) throws TemplateModelException { TemplateModelIterator keys = hash.keys().iterator(); TemplateModelIterator values = hash.values().iterator(); while (keys.hasNext()) { setSharedVariable(((TemplateScalarModel) keys.next()).getAsString(), values.next()); } }
TemplateCollectionModel keys = prefixMap.keys(); for (TemplateModelIterator it = keys.iterator(); it.hasNext();) { String prefix = ((TemplateScalarModel) it.next()).getAsString(); TemplateCollectionModel keys = attributeMap.keys(); for (TemplateModelIterator it = keys.iterator(); it.hasNext();) { String attName = ((TemplateScalarModel) it.next()).getAsString();
if (null != parameters) { List<NameValuePair> nvps = new ArrayList<>(); TemplateModelIterator it = parameters.keys().iterator(); while (it.hasNext()) { String key = TemplateModelUtils.converString(it.next());
if (null != parameters) { List<NameValuePair> nvps = new ArrayList<>(); TemplateModelIterator it = parameters.keys().iterator(); while (it.hasNext()) { String key = TemplateModelUtils.converString(it.next());
TemplateModelIterator keysIter = listedHash.keys().iterator(); hashNotEmpty = keysIter.hasNext(); if (hashNotEmpty) {
private Map getQueryParams(Map params) throws TemplateModelException { TemplateHashModelEx modelEx = (TemplateHashModelEx) params.get("query_params"); if(modelEx == null) return new HashMap(); TemplateCollectionModel keys = modelEx.keys(); TemplateModelIterator keysIt = keys.iterator(); Map queryParams = new HashMap(); while (keysIt.hasNext()) { TemplateModel key = keysIt.next(); queryParams.put(key.toString(), modelEx.get(key.toString()).toString()); } return queryParams; } }
public String[] keys() throws TemplateModelException { TemplateHashModelEx h = (TemplateHashModelEx)model; List list = new ArrayList(); TemplateModelIterator i = h.keys().iterator(); while(i.hasNext()) { list.add(((TemplateScalarModel)i.next()).getAsString()); } return (String[])list.toArray(new String[list.size()]); }
public String[] keys() throws TemplateModelException { TemplateHashModelEx h = (TemplateHashModelEx) model; List list = new ArrayList(); TemplateModelIterator i = h.keys().iterator(); while (i.hasNext()) { list.add(((TemplateScalarModel) i.next()).getAsString()); } return (String[]) list.toArray(new String[list.size()]); }
public String[] keys() throws TemplateModelException { TemplateHashModelEx h = (TemplateHashModelEx) model; List list = new ArrayList(); TemplateModelIterator i = h.keys().iterator(); while (i.hasNext()) { list.add(((TemplateScalarModel) i.next()).getAsString()); } return (String[]) list.toArray(new String[list.size()]); }
private static void addKeys(Set set, SimpleSequence keySeq, TemplateHashModelEx hash) throws TemplateModelException { TemplateModelIterator it = hash.keys().iterator(); while (it.hasNext()) { TemplateScalarModel tsm = (TemplateScalarModel) it.next(); if (set.add(tsm.getAsString())) { // The first occurence of the key decides the index; // this is consisten with stuff like java.util.LinkedHashSet. keySeq.add(tsm); } } }
private static void addKeys(Set set, SimpleSequence keySeq, TemplateHashModelEx hash) throws TemplateModelException { TemplateModelIterator it = hash.keys().iterator(); while (it.hasNext()) { TemplateScalarModel tsm = (TemplateScalarModel)it.next(); if (set.add(tsm.getAsString())) { // The first occurence of the key decides the index; // this is consisten with stuff like java.util.LinkedHashSet. keySeq.add(tsm); } } }