Processes the template to which this environment belongs.
()
| 189 | * Processes the template to which this environment belongs. |
| 190 | */ |
| 191 | public void process() throws TemplateException, IOException { |
| 192 | Object savedEnv = threadEnv.get(); |
| 193 | threadEnv.set(this); |
| 194 | try { |
| 195 | // Cached values from a previous execution are possibly outdated. |
| 196 | clearCachedValues(); |
| 197 | try { |
| 198 | doAutoImportsAndIncludes(this); |
| 199 | visit(getTemplate().getRootTreeNode()); |
| 200 | // It's here as we must not flush if there was an exception. |
| 201 | if (getAutoFlush()) { |
| 202 | out.flush(); |
| 203 | } |
| 204 | } finally { |
| 205 | // It's just to allow the GC to free memory... |
| 206 | clearCachedValues(); |
| 207 | } |
| 208 | } finally { |
| 209 | threadEnv.set(savedEnv); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * "Visit" the template element. |
no test coverage detected