Class StringResource
java.lang.Object
org.apache.velocity.runtime.resource.util.StringResource
Wrapper for Strings containing templates, allowing to add additional meta
data like timestamps.
- Since:
- 1.5
- Version:
- $Id$
- Author:
- Eelco Hillenius, Henning P. Schmiedehausen
-
Constructor Summary
ConstructorDescriptionStringResource
(String body, String encoding) convenience constructor; sets body to 'body' and sets lastModified to now -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Sets the template body.Returns the encoding of this String resource.long
Returns the modification date of the template.void
Sets a new value for the template body.void
setEncoding
(String encoding) Sets the encoding of this string resource.void
setLastModified
(long lastModified) Changes the last modified parameter.
-
Constructor Details
-
StringResource
convenience constructor; sets body to 'body' and sets lastModified to now- Parameters:
body
-encoding
-
-
-
Method Details
-
getBody
Sets the template body.- Returns:
- String containing the template body.
-
getLastModified
public long getLastModified()Returns the modification date of the template.- Returns:
- Modification date in milliseconds.
-
setBody
Sets a new value for the template body.- Parameters:
body
- New body value
-
setLastModified
public void setLastModified(long lastModified) Changes the last modified parameter.- Parameters:
lastModified
- The modification time in millis.
-
getEncoding
Returns the encoding of this String resource.- Returns:
- The encoding of this String resource.
-
setEncoding
Sets the encoding of this string resource.- Parameters:
encoding
- The new encoding of this resource.
-