Class StringResourceRepositoryImpl
java.lang.Object
org.apache.velocity.runtime.resource.util.StringResourceRepositoryImpl
- All Implemented Interfaces:
StringResourceRepository
Default implementation of StringResourceRepository.
Uses a HashMap for storage
- Since:
- 1.5
- Version:
- $Id$
- Author:
- Eelco Hillenius, Henning P. Schmiedehausen
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current encoding of this repository.getStringResource
(String name) get the string resource that is stored with given keyvoid
putStringResource
(String name, String body) add a string resource with given key.void
putStringResource
(String name, String body, String encoding) add a string resource with given key.void
removeStringResource
(String name) delete a string resource with given key.void
setEncoding
(String encoding) Sets the default encoding of the repository.
-
Field Details
-
resources
mem store
-
-
Constructor Details
-
StringResourceRepositoryImpl
public StringResourceRepositoryImpl()
-
-
Method Details
-
getStringResource
Description copied from interface:StringResourceRepository
get the string resource that is stored with given key- Specified by:
getStringResource
in interfaceStringResourceRepository
- Parameters:
name
- String name to retrieve from the repository.- Returns:
- A StringResource containing the template.
- See Also:
-
putStringResource
Description copied from interface:StringResourceRepository
add a string resource with given key.- Specified by:
putStringResource
in interfaceStringResourceRepository
- Parameters:
name
- The String name to store the template under.body
- A String containing a template.- See Also:
-
putStringResource
Description copied from interface:StringResourceRepository
add a string resource with given key.- Specified by:
putStringResource
in interfaceStringResourceRepository
- 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
- See Also:
-
removeStringResource
Description copied from interface:StringResourceRepository
delete a string resource with given key.- Specified by:
removeStringResource
in interfaceStringResourceRepository
- Parameters:
name
- The string name to remove from the repository.- See Also:
-
getEncoding
Description copied from interface:StringResourceRepository
Returns the current encoding of this repository.- Specified by:
getEncoding
in interfaceStringResourceRepository
- Returns:
- The current encoding of this repository.
- See Also:
-
setEncoding
Description copied from interface:StringResourceRepository
Sets the default encoding of the repository. Encodings can also be stored per template string. The default implementation does this correctly.- Specified by:
setEncoding
in interfaceStringResourceRepository
- Parameters:
encoding
- The encoding to use.- See Also:
-