Interface StringResourceRepository
-
- All Known Implementing Classes:
StringResourceRepositoryImpl
public interface StringResourceRepositoryA StringResourceRepository functions as a central repository for Velocity templates stored in Strings.- Since:
- 1.5
- Version:
- $Id$
- Author:
- Eelco Hillenius, Henning P. Schmiedehausen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetEncoding()Returns the current encoding of this repository.StringResourcegetStringResource(java.lang.String name)get the string resource that is stored with given keyvoidputStringResource(java.lang.String name, java.lang.String body)add a string resource with given key.voidputStringResource(java.lang.String name, java.lang.String body, java.lang.String encoding)add a string resource with given key.voidremoveStringResource(java.lang.String name)delete a string resource with given key.voidsetEncoding(java.lang.String encoding)Sets the default encoding of the repository.
-
-
-
Method Detail
-
getStringResource
StringResource getStringResource(java.lang.String name)
get the string resource that is stored with given key- Parameters:
name- String name to retrieve from the repository.- Returns:
- A StringResource containing the template.
-
putStringResource
void putStringResource(java.lang.String name, java.lang.String body)add a string resource with given key.- Parameters:
name- The String name to store the template under.body- A String containing a template.
-
putStringResource
void putStringResource(java.lang.String name, java.lang.String body, java.lang.String encoding)add a string resource with given key.- Parameters:
name- The String name to store the template under.body- A String containing a template.encoding- The encoding of this string template- Since:
- 1.6
-
removeStringResource
void removeStringResource(java.lang.String name)
delete a string resource with given key.- Parameters:
name- The string name to remove from the repository.
-
setEncoding
void setEncoding(java.lang.String encoding)
Sets the default encoding of the repository. Encodings can also be stored per template string. The default implementation does this correctly.- Parameters:
encoding- The encoding to use.
-
getEncoding
java.lang.String getEncoding()
Returns the current encoding of this repository.- Returns:
- The current encoding of this repository.
-
-