Package org.apache.wicket.util.template
Class TextTemplate
- java.lang.Object
-
- org.apache.wicket.util.resource.AbstractResourceStream
-
- org.apache.wicket.util.resource.AbstractStringResourceStream
-
- org.apache.wicket.util.template.TextTemplate
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,org.apache.wicket.util.io.IClusterable,org.apache.wicket.util.resource.IResourceStream,org.apache.wicket.util.resource.IStringResourceStream,org.apache.wicket.util.watch.IModifiable
- Direct Known Subclasses:
PackageTextTemplate,TextTemplateDecorator
public abstract class TextTemplate extends org.apache.wicket.util.resource.AbstractStringResourceStreamRepresents a text template that can do variable interpolation.- Since:
- 1.2.6
- Author:
- Eelco Hillenius, Jonathan Locke
- See Also:
VariableInterpolator, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TextTemplate()Constructor.TextTemplate(java.lang.String contentType)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringasString()java.lang.StringasString(java.util.Map<java.lang.String,?> variables)Interpolates theMapof variables with the content and returns the resultingStringwithout replacing the content.abstract java.lang.StringgetString()Retrieves theStringresource.abstract TextTemplateinterpolate(java.util.Map<java.lang.String,?> variables)Interpolates values into thisTextTemplate.-
Methods inherited from class org.apache.wicket.util.resource.AbstractStringResourceStream
close, getCharset, getContentType, getInputStream, lastModifiedTime, length, setCharset, setLastModified
-
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
-
-
-
-
Method Detail
-
asString
public java.lang.String asString(java.util.Map<java.lang.String,?> variables)
Interpolates theMapof variables with the content and returns the resultingStringwithout 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 byvariables.getValue("variableName").- Parameters:
variables- the variables to interpolate- Returns:
- the result of the interpolation
-
asString
public java.lang.String asString()
- Specified by:
asStringin interfaceorg.apache.wicket.util.resource.IStringResourceStream- Overrides:
asStringin classorg.apache.wicket.util.resource.AbstractStringResourceStream- See Also:
AbstractStringResourceStream.asString()
-
getString
public abstract java.lang.String getString()
Retrieves theStringresource.- Specified by:
getStringin classorg.apache.wicket.util.resource.AbstractStringResourceStream- Returns:
- the
Stringresource
-
interpolate
public abstract TextTemplate interpolate(java.util.Map<java.lang.String,?> variables)
Interpolates values into thisTextTemplate.- Parameters:
variables- variables to interpolate into thisTextTemplate- Returns:
this, for chaining purposes
-
-