public abstract class TextTemplateDecorator extends TextTemplate
Modifier and Type | Field and Description |
---|---|
protected TextTemplate |
decorated
The decorated
TextTemplate . |
DEFAULT_CONTENT_TYPE
Constructor and Description |
---|
TextTemplateDecorator(TextTemplate textTemplate)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
asString()
Returns the decorated contents as a
String . |
String |
asString(Map<String,?> variables)
Returns the decorated contents as a
String . |
void |
close()
Closes the resource.
|
boolean |
equals(Object obj) |
abstract String |
getAfterTemplateContents()
Retrieves the
String to put after the actual template contents, for example: |
abstract String |
getBeforeTemplateContents()
Retrieves the
String to put before the actual template contents, for example: |
String |
getContentType()
Gets the mime type of this resource
|
InputStream |
getInputStream()
Gets the resource stream.
|
Locale |
getLocale() |
String |
getString()
Retrieves the
String resource. |
int |
hashCode() |
Time |
lastModifiedTime()
Gets the last time this modifiable thing changed.
|
void |
setCharset(Charset charset)
Sets the character set used for reading this resource.
|
void |
setLastModified(Time lastModified) |
void |
setLocale(Locale locale)
This method shouldn't be used from the outside.
|
String |
toString() |
interpolate
getCharset, length
getStyle, getVariation, setStyle, setVariation
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getStyle, getVariation, setStyle, setVariation
protected final TextTemplate decorated
TextTemplate
.public TextTemplateDecorator(TextTemplate textTemplate)
textTemplate
- a TextTemplate
to decoratepublic String asString()
String
.asString
in interface IStringResourceStream
asString
in class TextTemplate
getBeforeTemplateContents()
and
getAfterTemplateContents()
TextTemplate.asString()
public String asString(Map<String,?> variables)
String
.asString
in class TextTemplate
variables
- the variables to interpolategetBeforeTemplateContents()
and
getAfterTemplateContents()
.TextTemplate.asString(java.util.Map)
public abstract String getBeforeTemplateContents()
String
to put before the actual template contents, for example:
<script type="text/javascript">
String
to put before the actual template contentspublic abstract String getAfterTemplateContents()
String
to put after the actual template contents, for example:
</script>
String
to put after the actual template contentspublic void close() throws IOException
IResourceStream
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IResourceStream
close
in class AbstractStringResourceStream
IOException
AbstractStringResourceStream.close()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String getContentType()
IResourceStream
getContentType
in interface IResourceStream
getContentType
in class AbstractStringResourceStream
AbstractStringResourceStream.getContentType()
public InputStream getInputStream() throws ResourceStreamNotFoundException
IResourceStream
getInputStream
in interface IResourceStream
getInputStream
in class AbstractStringResourceStream
ResourceStreamNotFoundException
AbstractStringResourceStream.getInputStream()
public Locale getLocale()
getLocale
in interface IResourceStream
getLocale
in class AbstractResourceStream
AbstractResourceStream.getLocale()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public Time lastModifiedTime()
IModifiable
lastModifiedTime
in interface IModifiable
lastModifiedTime
in class AbstractStringResourceStream
Time
or
null
if that information is not availableAbstractStringResourceStream.lastModifiedTime()
public void setCharset(Charset charset)
AbstractStringResourceStream
setCharset
in interface IStringResourceStream
setCharset
in class AbstractStringResourceStream
charset
- Charset for componentorg.apache.wicket.util.resource.AbstractResourceStream#setCharset(java.nio.charset.Charset)
public void setLastModified(Time lastModified)
setLastModified
in class AbstractStringResourceStream
lastModified
- The lastModified to set.AbstractStringResourceStream.setLastModified(org.apache.wicket.util.time.Time)
public void setLocale(Locale locale)
IResourceStream
setLocale
in interface IResourceStream
setLocale
in class AbstractResourceStream
locale
- The Locale where this stream did resolve to.AbstractResourceStream.setLocale(java.util.Locale)
public String getString()
TextTemplate
String
resource.getString
in class TextTemplate
String
resourceTextTemplate.getString()
public String toString()
toString
in class Object
Object.toString()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.