public abstract class TextTemplate extends AbstractStringResourceStream
VariableInterpolator,
Serialized FormDEFAULT_CONTENT_TYPE| Constructor and Description |
|---|
TextTemplate()
Constructor.
|
TextTemplate(String contentType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asString() |
String |
asString(Map<String,?> variables)
Interpolates the
Map of variables with the content and returns the resulting
String without replacing the content. |
abstract String |
getString()
Retrieves the
String resource. |
abstract TextTemplate |
interpolate(Map<String,?> variables)
Interpolates values into this
TextTemplate. |
close, getCharset, getContentType, getInputStream, lastModifiedTime, length, setCharset, setLastModifiedgetLocale, getStyle, getVariation, setLocale, setStyle, setVariationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocale, getStyle, getVariation, setLocale, setStyle, setVariationpublic TextTemplate()
public TextTemplate(String contentType)
contentType - the mime type of this resource, such as "image/jpeg" or "
text/html"public String asString(Map<String,?> variables)
Map of variables with the content and returns the resulting
String without replacing the content. Variables are denoted in this string by
the syntax ${variableName}. The contents will be altered by replacing each
variable of the form ${variableName} with the value returned by
variables.getValue("variableName").variables - the variables to interpolatepublic String asString()
asString in interface IStringResourceStreamasString in class AbstractStringResourceStreamAbstractStringResourceStream.asString()public abstract String getString()
String resource.getString in class AbstractStringResourceStreamString resourcepublic abstract TextTemplate interpolate(Map<String,?> variables)
TextTemplate.variables - variables to interpolate into this TextTemplatethis, for chaining purposesCopyright © 2006–2014 Apache Software Foundation. All rights reserved.