All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mati1979.play.soyplugin.compile.TofuCompiler Maven / Gradle / Ivy

There is a newer version: 0.1.18
Show newest version
package com.github.mati1979.play.soyplugin.compile;

import java.util.Optional;
import com.google.template.soy.msgs.SoyMsgBundle;
import com.google.template.soy.tofu.SoyTofu;

import javax.annotation.Nullable;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;

/**
 * The SoyTofu binary compiler that based on
 * set of files creates a compiled object.
 *
 * Created with IntelliJ IDEA.
 * User: mszczap
 * Date: 20.06.13
 * Time: 17:39
 */
public interface TofuCompiler {

    /**
     * Obtains a binary compiled version based on a set of input urls
     *
     *
     * @param files
     * @return
     */
    SoyTofu compile(Collection files) throws IOException;

    /**
     * Obtains a compiled template to JavaScript as a String based on a template url
     * @param template
     * @param soyMsgBundle
     * @return - an optional with a compiled JavaScript or absent in case of an issue
     */
    Optional compileToJsSrc(URL template, @Nullable SoyMsgBundle soyMsgBundle);

    /**
     * Obtains a compiled template to JavaScript as a String based on a collection of template urls

     * @param templates - a collection of template urls
     * @param soyMsgBundle
     * @return - collection containing string with compiled templates.
     */
    Collection compileToJsSrc(Collection templates, @Nullable SoyMsgBundle soyMsgBundle);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy