|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.util.resource.AbstractResourceStream
org.apache.wicket.util.resource.AbstractStringResourceStream
org.apache.wicket.util.template.TextTemplate
public abstract class TextTemplate
Represents a text template that can do variable interpolation.
VariableInterpolator
,
Serialized FormField Summary |
---|
Fields inherited from class org.apache.wicket.util.resource.AbstractStringResourceStream |
---|
DEFAULT_CONTENT_TYPE |
Constructor Summary | |
---|---|
TextTemplate()
Constructor. |
|
TextTemplate(String contentType)
Constructor. |
Method Summary | |
---|---|
String |
asString()
|
String |
asString(Map<String,Object> 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,Object> variables)
Interpolates values into this TextTemplate . |
Methods inherited from class org.apache.wicket.util.resource.AbstractStringResourceStream |
---|
close, getContentType, getInputStream, lastModifiedTime, length, setLastModified |
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream |
---|
getCharset, getLocale, setCharset, setLocale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextTemplate()
public TextTemplate(String contentType)
contentType
- the mime type of this resource, such as "image/jpeg
" or "
text/html
"Method Detail |
---|
public String asString(Map<String,Object> 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 interpolate
public String asString()
asString
in interface IStringResourceStream
asString
in class AbstractResourceStream
AbstractResourceStream.asString()
public abstract String getString()
String
resource.
getString
in class AbstractStringResourceStream
String
resourcepublic abstract TextTemplate interpolate(Map<String,Object> variables)
TextTemplate
.
variables
- variables to interpolate into this TextTemplate
this
, for chaining purposes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |