org.freshmarker.StringBuilderWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of freshmarker Show documentation
Show all versions of freshmarker Show documentation
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.
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