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

org.jbake.template.TemplateEngineAdapter Maven / Gradle / Ivy

Go to download

JBake is a Java based open source static site/blog generator for developers.

There is a newer version: 2.7.0-rc.7
Show newest version
package org.jbake.template;

/**
 * Adapts model extractor output to used template engine.
 * This method typically wraps results of model extractions into data types suited to template engine
 *
 * @author ndx
 */
public interface TemplateEngineAdapter {

    class NoopAdapter implements TemplateEngineAdapter {

        @Override
        public Object adapt(String key, Object extractedValue) {
            return extractedValue;
        }

    }

    /**
     * Adapt value to expected output
     *
     * @param key            Template key
     * @param extractedValue Value to be used in template model
     * @return Value adapted for use in template
     */
    Type adapt(String key, Object extractedValue);

}