public class Theme extends java.lang.Object implements ContentSource, ChunkFactory
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_THEMES_FOLDER |
| Constructor and Description |
|---|
Theme() |
Theme(ContentSource templates) |
Theme(java.lang.String themeLayerNames) |
Theme(java.lang.String themesFolder,
java.lang.String themeLayerNames) |
Theme(java.lang.String themesFolder,
java.lang.String themeLayerNames,
java.lang.String ext) |
Theme(ThemeConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLayer(ContentSource templates) |
void |
addProtocol(ContentSource src) |
java.lang.String |
fetch(java.lang.String itemName) |
java.util.Map<java.lang.String,ChunkFilter> |
getFilters() |
java.lang.String |
getLocale() |
java.lang.String |
getProtocol() |
Snippet |
getSnippet(java.lang.String itemName) |
Snippet |
getSnippet(java.lang.String templateName,
java.lang.String ext) |
Chunk |
makeChunk()
Creates a Chunk with no starter template and sets its tag boundary
markers to match the other templates in this set.
|
Chunk |
makeChunk(java.lang.String templateName)
Creates a Chunk with a starting template.
|
Chunk |
makeChunk(java.lang.String templateName,
java.lang.String extension)
Creates a Chunk with a starting template.
|
boolean |
provides(java.lang.String itemName) |
void |
registerFilter(ChunkFilter filter) |
void |
setAbortOnMissingTemplate(boolean hardFail) |
void |
setClasspathThemesFolder(java.lang.String classpathThemesFolder) |
void |
setDefaultFileExtension(java.lang.String ext) |
void |
setDirtyInterval(int minutes) |
void |
setEncoding(java.lang.String encoding)
What encoding do this theme's template files use?
If not UTF-8, make sure to set this explicitly.
|
void |
setErrorHandling(boolean renderErrs,
java.io.PrintStream errLog) |
void |
setJarContext(java.lang.Class<?> classInSameJar)
If your templates are packaged into a jar with your application code,
then you should use this method to tell chunk where your templates are.
|
void |
setJarContext(java.lang.Object ctx) |
void |
setLocale(java.lang.String localeCode) |
void |
setTemplateFolder(java.lang.String pathToTemplates) |
public static final java.lang.String DEFAULT_THEMES_FOLDER
public Theme()
public Theme(ThemeConfig config)
public Theme(ContentSource templates)
public Theme(java.lang.String themeLayerNames)
public Theme(java.lang.String themesFolder,
java.lang.String themeLayerNames)
public Theme(java.lang.String themesFolder,
java.lang.String themeLayerNames,
java.lang.String ext)
public void setClasspathThemesFolder(java.lang.String classpathThemesFolder)
public void setTemplateFolder(java.lang.String pathToTemplates)
public void setDefaultFileExtension(java.lang.String ext)
public void setLocale(java.lang.String localeCode)
public java.lang.String getLocale()
public void setEncoding(java.lang.String encoding)
public void addLayer(ContentSource templates)
public void setDirtyInterval(int minutes)
public Snippet getSnippet(java.lang.String templateName, java.lang.String ext)
public Snippet getSnippet(java.lang.String itemName)
getSnippet in interface ContentSourcepublic boolean provides(java.lang.String itemName)
provides in interface ContentSourcepublic java.lang.String fetch(java.lang.String itemName)
fetch in interface ContentSourcepublic java.lang.String getProtocol()
getProtocol in interface ContentSourcepublic Chunk makeChunk()
makeChunk in interface ChunkFactorypublic Chunk makeChunk(java.lang.String templateName)
makeChunk in interface ChunkFactorytemplateName - the location of the template definition.public Chunk makeChunk(java.lang.String templateName, java.lang.String extension)
makeChunk in interface ChunkFactorytemplateName - the location of the template definition.extension - the nonstandard extension which forms the template filename.public void addProtocol(ContentSource src)
public void setJarContext(java.lang.Class<?> classInSameJar)
classInSameJar - public void setJarContext(java.lang.Object ctx)
public java.util.Map<java.lang.String,ChunkFilter> getFilters()
getFilters in interface ChunkFactorypublic void registerFilter(ChunkFilter filter)
public void setErrorHandling(boolean renderErrs,
java.io.PrintStream errLog)
public void setAbortOnMissingTemplate(boolean hardFail)
Copyright © 2019. All Rights Reserved.