Examples of ITemplateParser


Examples of org.apache.tapestry.parse.ITemplateParser

        delegate.setFlowDefinitionsManager(flowDefinitionsManager);
    }

    private void trainParser(FlowAwareTemplateSourceDelegate delegate) {
        // we dont want to mock the world, so we just mock this
        ITemplateParser templateParser = createMock(ITemplateParser.class);
        delegate.setParser(templateParser);
        try {
            expect(templateParser.parse(EasyMock.isA(char[].class),
                    EasyMock.isA(ITemplateParserDelegate.class),
                    EasyMock.isA(Resource.class)
            )).andReturn(new TemplateToken[0]);
        } catch (TemplateParseException e) {
            fail();
View Full Code Here

Examples of org.thymeleaf.templateparser.ITemplateParser

        }

       
        final String templateMode = templateResolution.getTemplateMode();
       
        final ITemplateParser templateParser = this.parsersByTemplateMode.get(templateMode);
        if (templateParser == null) {
            throw new TemplateInputException(
                    "Template mode \"" + templateMode + "\" has not been configured");
        }
       
        if (logger.isTraceEnabled()) {
            logger.trace("[THYMELEAF][{}] Starting parsing of template \"{}\"", TemplateEngine.threadIndex(), templateName);
        }
       
       
        final String characterEncoding = templateResolution.getCharacterEncoding();
        Reader reader = null;
        if (!StringUtils.isEmptyOrWhitespace(characterEncoding)) {
            try {
                reader = new InputStreamReader(templateInputStream, characterEncoding);
            } catch (final UnsupportedEncodingException e) {
                throw new TemplateInputException("Exception parsing document", e);
            }
        } else {
            reader = new InputStreamReader(templateInputStream);
        }
       
        final Document document =
                templateParser.parseTemplate(configuration, templateName, reader);
       
        if (logger.isTraceEnabled()) {
            logger.trace("[THYMELEAF][{}] Finished parsing of template \"{}\"", TemplateEngine.threadIndex(), templateName);
        }
View Full Code Here

Examples of org.thymeleaf.templateparser.ITemplateParser

            }
        }
       
        final Configuration configuration = arguments.getConfiguration();
       
        final ITemplateParser templateParser =
                configuration.getTemplateModeHandler(templateMode).getTemplateParser();
     
        final List<Node> fragmentNodes = templateParser.parseFragment(configuration, fragment);
       
        if (this.fragmentCache != null) {
            this.fragmentCache.put(cacheKey, fragmentNodes);
            return cloneFragmentNodes(fragmentNodes);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.