private Template parseTemplate(Resource resource, String name, Locale locale, String encoding, Object args) throws IOException, ParseException {
        if (resource == null) {
            resource = loadResource(name, locale, encoding);
        }
        long start = logger != null && logger.isDebugEnabled() ? System.currentTimeMillis() : 0;
        String source = resource.getSource();
        try {
            if (templateFilter != null) {
                source = templateFilter.filter(resource.getName(), source);
            }
            Node root = templateParser.parse(source, 0);
            Map<String, Class<?>> parameterTypes = useRenderVariableType && args != null ? new DelegateMap<String, Class<?>>(new TypeMap(convertMap(args))) : null;
            Template template = translator.translate(resource, root, parameterTypes);
            if (logger != null && logger.isDebugEnabled()) {
                logger.debug("Parsed the template " + name + ", eslapsed: " + (System.currentTimeMillis() - start) + "ms.");
            }
            return template;
        } catch (ParseException e) {
            throw AbstractTemplate.toLocatedParseException(e, resource);
        }
    }
private Template parseTemplate ( Resource resource , String name , Locale locale , String encoding , Object args ) throws IOException , ParseException { if ( resource == null ) { resource = loadResource ( name , locale , encoding ) ; } long start = logger != null && logger . isDebugEnabled ( ) ? System . currentTimeMillis ( ) : 0 ; String source = resource . getSource ( ) ; try { if ( templateFilter != null ) { source = templateFilter . filter ( resource . getName ( ) , source ) ; } Node root = templateParser . parse ( source , 0 ) ; Map < String , Class < ? > > parameterTypes = useRenderVariableType && args != null ? new DelegateMap < String , Class < ? > > ( new TypeMap ( convertMap ( args ) ) ) : null ; Template template = translator . translate ( resource , root , parameterTypes ) ; if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Parsed the template " + name + ", eslapsed: " + ( System . currentTimeMillis ( ) - start ) + "ms." ) ; } return template ; } catch ( ParseException e ) { throw AbstractTemplate . toLocatedParseException ( e , resource ) ; } }
Parse the template. (No cache)