return parseTemplate(in, DefaultEncoding, expressionLanguage);
}
public TemplateDocument parseTemplate(InputStream in, String encoding, ExpressionLanguage expressionLanguage) throws TemplateLoadingException
{
TemplateTokenizer tokenizer = null;
try
{
tokenizer = new TemplateTokenizer(new InputStreamReader(in, encoding));
TemplateParser parser = new TemplateParser(tokenizer, this, expressionLanguage);
return parser.parse();
}
catch (IOException e)
{
throw new TemplateLoadingException(e);
}
catch (TemplateParsingException e)
{
throw new TemplateLoadingException(e);
}
finally
{
if (tokenizer != null)
{
try
{
tokenizer.close();
}
catch (IOException e)
{
e.printStackTrace();
}