diff options
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/templates/Template.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/templates/Template.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/templates/Template.java b/container-search/src/main/java/com/yahoo/prelude/templates/Template.java new file mode 100644 index 00000000000..7052671a584 --- /dev/null +++ b/container-search/src/main/java/com/yahoo/prelude/templates/Template.java @@ -0,0 +1,33 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.prelude.templates; + +import java.io.Writer; + + +/** + * A template turns a template string and some state into + * an instantiated string. Add support for a particular + * template mechanism by subclassing this. + * + * @author bratseth + */ +public abstract class Template<T extends Writer> { + + /** + * Renders this template + * + * @param context the context to evaluate in + * @param writer the writer to render to + */ + public abstract void render(Context context,T writer) + throws java.io.IOException; + + + /** + * Get template name + * + * @return template name + */ + public abstract String getName(); + +} |