Skip to content

Instantly share code, notes, and snippets.

@ngerakines
Created March 12, 2014 20:40
Show Gist options
  • Save ngerakines/9515809 to your computer and use it in GitHub Desktop.
Save ngerakines/9515809 to your computer and use it in GitHub Desktop.
public abstract class AbstractTemplate {
protected abstract String getTemplateFile();
public String run() {
return "rendered template from " + getTemplateFile();
}
}
public class PartialTemplate extends AbstractTemplate {
protected String getTemplateFile() {
return "partial template file";
}
}
public class Template extends AbstractTemplate {
protected String getTemplateFile() {
return "full template file";
}
}
public class Rendererer {
public static void main() {
assert(new Template().render(), "rendered template from full template file");
assert(new PartialTemplate().render(), "rendered template from partial template file");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment