Package com.github.jknack.handlebars.io
Class StringTemplateSource
- java.lang.Object
-
- com.github.jknack.handlebars.io.AbstractTemplateSource
-
- com.github.jknack.handlebars.io.StringTemplateSource
-
- All Implemented Interfaces:
TemplateSource
public class StringTemplateSource extends AbstractTemplateSource
String implementation ofTemplateSource
.- Since:
- 0.11.0
-
-
Constructor Summary
Constructors Constructor Description StringTemplateSource(java.lang.String filename, java.lang.String content)
Creates a newStringTemplateSource
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
content(java.nio.charset.Charset charset)
The template content.java.lang.String
filename()
The file's name.long
lastModified()
The last modified date.-
Methods inherited from class com.github.jknack.handlebars.io.AbstractTemplateSource
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
StringTemplateSource
public StringTemplateSource(java.lang.String filename, java.lang.String content)
Creates a newStringTemplateSource
.- Parameters:
filename
- The template's file name. Required.content
- The template's content. Required.
-
-
Method Detail
-
content
public java.lang.String content(java.nio.charset.Charset charset)
Description copied from interface:TemplateSource
The template content.- Parameters:
charset
- Charset to use.- Returns:
- The template content.
-
filename
public java.lang.String filename()
Description copied from interface:TemplateSource
The file's name.- Returns:
- The file's name.
-
lastModified
public long lastModified()
Description copied from interface:TemplateSource
The last modified date.- Returns:
- The last modified date.
-
-