com.github.mustachejava.Mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler Show documentation
Show all versions of compiler Show documentation
Implementation of mustache.js for Java
package com.github.mustachejava;
import com.github.mustachejava.util.InternalArrayList;
import com.github.mustachejava.util.Node;
import java.io.Writer;
import java.util.List;
import static com.github.mustachejava.ObjectHandler.makeList;
import static java.util.Collections.addAll;
/**
* The interface to Mustache objects
*/
public interface Mustache extends Code {
/**
* Append text to the mustache output.
*
* @param text the text to append
*/
void append(String text);
/**
* Deep clone of the mustache object.
*
* @return the clone
*/
Object clone();
/**
* Execute the mustache object with a given writer and a single scope context.
*
* @param writer write the output of the executed template here
* @param scope the root object to use
* @return the new writer
*/
default Writer execute(Writer writer, Object scope) {
return execute(writer, makeList(scope));
}
// Support the previous behavior for users
default Writer execute(Writer writer, Object[] scopes) {
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy