}
catch ( Exception e)
{
String msg = "#parse() : arg = " + arg + '.';
rsvc.getLog().error(msg, e);
throw new VelocityException(msg, e);
}
/**
* Add the template name to the macro libraries list
*/
List macroLibraries = context.getMacroLibraries();
/**
* if macroLibraries are not set create a new one
*/
if (macroLibraries == null)
{
macroLibraries = new ArrayList();
}
context.setMacroLibraries(macroLibraries);
macroLibraries.add(arg);
/*
* and render it
*/
try
{
if (!blockinput) {
context.pushCurrentTemplateName(arg);
((SimpleNode) t.getData()).render( context, writer );
}
}
/*
* if it's a MIE, it came from the render.... throw it...
*/
catch( MethodInvocationException e )
{
throw e;
}
/**
* pass through application level runtime exceptions
*/
catch( RuntimeException e )
{
throw e;
}
catch ( Exception e )
{
String msg = "Exception rendering #parse(" + arg + ')';
rsvc.getLog().error(msg, e);
throw new VelocityException(msg, e);
}
finally
{
if (!blockinput)
context.popCurrentTemplateName();