public final class TemplateAsText extends Object
| Modifier and Type | Method and Description |
|---|---|
static TemplateAsText |
fromClassPath(String resourcePath)
Load text with placeholders from classpath.
|
static TemplateAsText |
fromClassPath(String resourcePath,
boolean throwExceptionForNotResolved)
Load text with placeholders from classpath and set flag for throwExceptionForNotResolved.
|
static TemplateAsText |
fromFile(String filePath)
Load text with placeholders from file from certain file path.
|
static TemplateAsText |
fromFile(String filePath,
boolean throwExceptionForNotResolved)
Load text with placeholders from file from certain file path and set flag for throwExceptionForNotResolved.
|
static TemplateAsText |
fromText(String templateText)
Load text with placeholders from simple String object.
|
static TemplateAsText |
fromText(String templateText,
boolean throwExceptionForNotResolved)
* Load text with placeholders from simple String object and set flag for throwExceptionForNotResolved.
|
String |
getCurrentTemplateText()
Returns value for already resolved placeholders.
|
void |
overrideVariable(String varName,
String value)
Override some placeholder.
|
public static TemplateAsText fromClassPath(String resourcePath)
resourcePath - name of resourcepublic static TemplateAsText fromClassPath(String resourcePath, boolean throwExceptionForNotResolved)
resourcePath - name of resourcethrowExceptionForNotResolved - it setup that will be throw exception
when will not resolved all placeholder during invoke getCurrentTemplateText()public static TemplateAsText fromFile(String filePath)
filePath - path for filepublic static TemplateAsText fromFile(String filePath, boolean throwExceptionForNotResolved)
filePath - path for filethrowExceptionForNotResolved - it setup that will be throw exception
when will not resolved all placeholder during invoke getCurrentTemplateText()public static TemplateAsText fromText(String templateText)
templateText - text with placeholderspublic static TemplateAsText fromText(String templateText, boolean throwExceptionForNotResolved)
templateText - text with placeholdersthrowExceptionForNotResolved - it setup that will be throw exception
when will not resolved all placeholder during invoke getCurrentTemplateText()public void overrideVariable(String varName, String value)
varName - value of placeholder namevalue - value for setup.public String getCurrentTemplateText()
Copyright © 2019. All rights reserved.