@Override Collection keySet() { try { return ((Environment) configurable).getKnownVariableNames(); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } }
@Override Collection keySet() { try { return ((Environment) configurable).getKnownVariableNames(); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } }
Collection keySet() { try { return ((Environment)configurable).getKnownVariableNames(); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } }
@Override Collection keySet() { try { return ((Environment) configurable).getKnownVariableNames(); } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } }
private SimpleHash getHash(Environment env) throws TemplateModelException { Set names = env.getKnownVariableNames(); SimpleHash simpleHash = new SimpleHash(); for(Object name: names){ simpleHash.put(name.toString(),env.getVariable(name.toString())); } return simpleHash; }
private SimpleHash getHash(Environment env) throws TemplateModelException { Set names = env.getKnownVariableNames(); SimpleHash simpleHash = new SimpleHash(); for(Object name: names){ simpleHash.put(name.toString(),env.getVariable(name.toString())); } return simpleHash; } }
/** * Returns a map of all variables in scope. * @return map of all variables in scope. */ protected Map getAllVariables(){ try{ Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator(); Map vars = new HashMap(); while (names.hasNext()) { Object name =names.next(); vars.put(name, get(name.toString())); } return vars; }catch(Exception e){ throw new ViewException(e); } }
public static Map<String, Object> createEnvironmentMap(Environment env) { Map<String, Object> templateRoot = new HashMap<>(); Set<String> varNames = null; try { varNames = UtilGenerics.checkSet(env.getKnownVariableNames()); } catch (TemplateModelException e1) { Debug.logError(e1, "Error getting FreeMarker variable names, will not put pass current context on to sub-content", module); } if (varNames != null) { for (String varName: varNames) { templateRoot.put(varName, FreeMarkerWorker.getWrappedObject(varName, env)); } } return templateRoot; }