com.vtence.molecule.middlewares.Layout Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of molecule Show documentation
Show all versions of molecule Show documentation
A web micro-framework for Java
The newest version!
package com.vtence.molecule.middlewares;
import com.vtence.molecule.Application;
import com.vtence.molecule.Body;
import com.vtence.molecule.Middleware;
import com.vtence.molecule.Request;
import com.vtence.molecule.Response;
import com.vtence.molecule.decoration.ContentProcessor;
import com.vtence.molecule.decoration.Decorator;
import com.vtence.molecule.decoration.HtmlDocumentProcessor;
import com.vtence.molecule.decoration.HtmlPageSelector;
import com.vtence.molecule.decoration.LayoutTemplate;
import com.vtence.molecule.decoration.Selector;
import com.vtence.molecule.templating.Template;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.concurrent.CompletionException;
import java.util.function.Consumer;
import static com.vtence.molecule.http.HeaderNames.CONTENT_LENGTH;
public class Layout implements Middleware {
private final Selector selector;
private final ContentProcessor processor;
private final Decorator decorator;
public static Layout html(Template