StringResourceRepository (Velocity 1.7 API)
Keywords: org.apache.velocity.runtime.resource.util.StringResourceRepository interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.velocity.runtime.resource.util
Interface StringResourceRepository

All Known Implementing Classes:
  StringResourceRepositoryImpl

public interface StringResourceRepository

A StringResourceRepository functions as a central repository for Velocity templates stored in Strings.

Since:
  1.5
Version:
  $Id: StringResourceRepository.java 685724 2008-08-13 23:12:12Z nbubna $
Author:
  Eelco Hillenius, Henning P. Schmiedehausen

Method Summary
`String` | `getEncoding()` Returns the current encoding of this repository.
`StringResource` | `getStringResource(String name)` get the string resource that is stored with given key
`void` | `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.

Method Detail

### getStringResource

    public StringResource getStringResource(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

    public void putStringResource(String name,
                                  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

    public void putStringResource(String name,
                                  String body,
                                  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

    public void removeStringResource(String name)

  delete a string resource with given key.

  Parameters:
    `name` - The string name to remove from the repository.

### setEncoding

    public void setEncoding(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

    public String getEncoding()

  Returns the current encoding of this repository.

  Returns:
    The current encoding of this repository.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.