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

org.freshmarker.StringBuilderWriter Maven / Gradle / Ivy

Go to download

A simple, small but powerful template engine based loosely on the FreeMarker syntax. FreshMarker is implemented in Java 21 and supports the `java.time` API and Records.

There is a newer version: 1.6.9
Show newest version
package org.freshmarker;

import java.io.Writer;

public class StringBuilderWriter extends Writer {
    private final StringBuilder builder = new StringBuilder();

    @Override
    public void write(char[] cbuf, int off, int len) {
        builder.append(cbuf, off, len);
    }

    @Override
    public void write(String s) {
        builder.append(s);
    }

    @Override
    public void flush() {
        // intentionally left blank
    }

    @Override
    public void close() {
        // intentionally left blank
    }

    @Override
    public String toString() {
        return builder.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy