001package io.cui.tools.formatting.template;
002
003import java.io.Serializable;
004
005/**
006 * The formatter should be able to convert complex type based on {@link FormatterSupport} into text
007 * by using a defined template.
008 * <p>
009 * See {@link io.cui.tools.formatting} for details.
010 *
011 * @param <T> bounded type based on {@link FormatterSupport}
012 *
013 * @author Eugen Fischer
014 */
015public interface TemplateFormatter<T extends FormatterSupport> extends Serializable {
016
017    /**
018     * Execute transformation based on configured template and values for the defined placeholders.
019     * Missing values should get ignored.
020     *
021     * @param reference must not be {@code null}
022     *
023     * @return formatted text
024     * @throws NullPointerException if reference is missing
025     */
026    String format(final T reference);
027
028}