StringResource (Velocity 1.7 API)
Keywords: org.apache.velocity.runtime.resource.util.StringResource class

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
Class StringResource

    java.lang.Object
      org.apache.velocity.runtime.resource.util.StringResource

public final class StringResource
extends Object

Wrapper for Strings containing templates, allowing to add additional meta data like timestamps.

Since:
  1.5
Version:
  $Id: StringResource.java 685685 2008-08-13 21:43:27Z nbubna $
Author:
  Eelco Hillenius, Henning P. Schmiedehausen

Constructor Summary
`StringResource(String body, String encoding)` convenience constructor; sets body to 'body' and sets lastModified to now

Method Summary
`String` | `getBody()` Sets the template body.
`String` | `getEncoding()` Returns the encoding of this String resource.
`long` | `getLastModified()` Returns the modification date of the template.
`void` | `setBody(String body)` 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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StringResource

    public StringResource(String body,
                          String encoding)

  convenience constructor; sets body to 'body' and sets lastModified to now

Parameters:
  `body` -

Method Detail

### getBody

    public String 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

    public void setBody(String body)

  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

    public String getEncoding()

  Returns the encoding of this String resource.

  Returns:
    The encoding of this String resource.

### setEncoding

    public void setEncoding(String encoding)

  Sets the encoding of this string resource.

  Parameters:
    `encoding` - The new encoding of this resource.

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.