Package org.apache.wicket.util.template
Class TextTemplateDecorator
java.lang.Object
org.apache.wicket.util.resource.AbstractResourceStream
org.apache.wicket.util.resource.AbstractStringResourceStream
org.apache.wicket.util.template.TextTemplate
org.apache.wicket.util.template.TextTemplateDecorator
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,IClusterable
,IResourceStream
,IStringResourceStream
,IModifiable
- Direct Known Subclasses:
CssTemplate
,JavaScriptTemplate
Provides the ability to 'decorate' the actual template contents before it is contributed to the
header. For example, to embed it inside a JavaScript tag pair.
- Since:
- 1.2.6
- Author:
- Eelco Hillenius
- See Also:
-
Field Summary
Fields inherited from class org.apache.wicket.util.resource.AbstractStringResourceStream
DEFAULT_CONTENT_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasString()
Returns the decorated contents as aString
.Returns the decorated contents as aString
.void
close()
boolean
abstract String
Retrieves theString
to put after the actual template contents, for example:abstract String
Retrieves theString
to put before the actual template contents, for example:Retrieves theString
resource.int
hashCode()
void
setCharset
(Charset charset) void
setLastModified
(Instant lastModified) void
toString()
Methods inherited from class org.apache.wicket.util.template.TextTemplate
interpolate
Methods inherited from class org.apache.wicket.util.resource.AbstractStringResourceStream
getCharset, length
Methods inherited from class org.apache.wicket.util.resource.AbstractResourceStream
getStyle, getVariation, setStyle, setVariation
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.wicket.util.resource.IResourceStream
getStyle, getVariation, setStyle, setVariation
-
Field Details
-
decorated
The decoratedTextTemplate
.
-
-
Constructor Details
-
TextTemplateDecorator
Constructor.- Parameters:
textTemplate
- aTextTemplate
to decorate
-
-
Method Details
-
asString
Returns the decorated contents as aString
.- Specified by:
asString
in interfaceIStringResourceStream
- Overrides:
asString
in classTextTemplate
- Returns:
- the contents decorated with
getBeforeTemplateContents()
andgetAfterTemplateContents()
- See Also:
-
asString
Returns the decorated contents as aString
.- Overrides:
asString
in classTextTemplate
- Parameters:
variables
- the variables to interpolate- Returns:
- the contents decorated with
getBeforeTemplateContents()
andgetAfterTemplateContents()
. - See Also:
-
getBeforeTemplateContents
Retrieves theString
to put before the actual template contents, for example:<script type="text/javascript">
- Returns:
- the
String
to put before the actual template contents
-
getAfterTemplateContents
Retrieves theString
to put after the actual template contents, for example:</script>
- Returns:
- the
String
to put after the actual template contents
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceIResourceStream
- Overrides:
close
in classAbstractStringResourceStream
- Throws:
IOException
-
equals
-
getContentType
- Specified by:
getContentType
in interfaceIResourceStream
- Overrides:
getContentType
in classAbstractStringResourceStream
-
getInputStream
- Specified by:
getInputStream
in interfaceIResourceStream
- Overrides:
getInputStream
in classAbstractStringResourceStream
- Throws:
ResourceStreamNotFoundException
-
getLocale
- Specified by:
getLocale
in interfaceIResourceStream
- Overrides:
getLocale
in classAbstractResourceStream
-
hashCode
-
lastModifiedTime
- Specified by:
lastModifiedTime
in interfaceIModifiable
- Overrides:
lastModifiedTime
in classAbstractStringResourceStream
-
setCharset
- Specified by:
setCharset
in interfaceIStringResourceStream
- Overrides:
setCharset
in classAbstractStringResourceStream
-
setLastModified
- Overrides:
setLastModified
in classAbstractStringResourceStream
-
setLocale
- Specified by:
setLocale
in interfaceIResourceStream
- Overrides:
setLocale
in classAbstractResourceStream
-
getString
Description copied from class:TextTemplate
Retrieves theString
resource.- Specified by:
getString
in classTextTemplate
- Returns:
- the
String
resource
-
toString
-