Package play.template2

Examples of play.template2.GTTemplateLocationReal


     * @return The executable template
     */
    public static Template load(VirtualFile file) {
        // Use default engine

        GTTemplateLocationReal templateLocation = null;
        try {
            templateLocation = new GTTemplateLocationReal(file.relativePath(), file.getRealFile().toURI().toURL());
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }

        // get it to check and compile it
View Full Code Here


     * @param source The template source
     * @return A Template
     */
    public static Template load(String key, String source) {

        GTTemplateLocationWithEmbeddedSource tl = new GTTemplateLocationWithEmbeddedSource(key, source);

        // get it or compile it
        GTJavaBase gtJavaBase = getGTTemplateInstance(tl);

        return new GTTemplate(tl, gtJavaBase);
View Full Code Here

     * @return A Template
     */
    public static Template load(String key, String source, boolean reload) {
        // reload is also ignored in the old template implementation...

        GTTemplateLocationWithEmbeddedSource tl = new GTTemplateLocationWithEmbeddedSource(key, source);

        // remove it first
        templateRepo.removeTemplate(tl);

        // get it or compile it
View Full Code Here

     * @param source The template source
     * @return A Template
     */
    public static Template loadString(final String source) {

        GTTemplateLocationWithEmbeddedSource templateLocation = new GTTemplateLocationWithEmbeddedSource(source);

        GTTemplateRepo.TemplateInfo ti = templateRepo.compileTemplate(templateLocation);

        GTJavaBase gtJavaBase = ti.templateInstanceFactory.create(templateRepo);

View Full Code Here

            folderToDumpClassesIn = new File(Play.applicationPath, "tmp/gttemplates");
        }

        GTJavaCompileToClass.typeResolver = new GTTypeResolver1xImpl();

        templateRepo = new GTTemplateRepo(
                Play.classloader,
                Play.mode == Play.Mode.DEV,
                new PreCompilerFactory(),
                Play.usePrecompiled,
                folderToDumpClassesIn);
View Full Code Here

                        throw (PlayException) e;
                    }
                    throw new UnexpectedException(e);
                }
            } catch (Exception e) {
                throw new GTRuntimeExceptionForwarder(e);
            }
        }
View Full Code Here

            m.invoke(null, args, body, out, executableTemplate, fromLine);
        } catch (InvocationTargetException e) {
            if ( e.getCause() instanceof TemplateExecutionException) {
                // Must be transformed into GTTemplateRuntimeException
                throw new GTTemplateRuntimeException(e.getCause().getMessage());
            } else {
                throw new RuntimeException(e);
            }
        } catch (Exception e) {
            throw new RuntimeException("Error when executing legacy fastTag " + legacyFastTagClassName+"."+legacyFastTagMethodName, e);
View Full Code Here

TOP

Related Classes of play.template2.GTTemplateLocationReal

Copyright © 2018 www.massapicom. 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.