org.apache.wicket.resource
Class TextTemplateResourceReference

java.lang.Object
  extended by org.apache.wicket.ResourceReference
      extended by org.apache.wicket.resource.TextTemplateResourceReference
All Implemented Interfaces:
Serializable, IClusterable

public class TextTemplateResourceReference
extends ResourceReference
implements IClusterable

A class which adapts a PackagedTextTemplate to a ResourceReference.

Author:
James Carman
See Also:
https://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html}, Serialized Form

Field Summary
 
Fields inherited from class org.apache.wicket.ResourceReference
locale
 
Constructor Summary
TextTemplateResourceReference(Class<?> scope, String fileName, IModel<Map<String,Object>> variablesModel)
          Creates a resource reference to a PackagedTextTemplate.
TextTemplateResourceReference(Class<?> scope, String fileName, String contentType, IModel<Map<String,Object>> variablesModel)
          Creates a resource reference to a PackagedTextTemplate.
TextTemplateResourceReference(Class<?> scope, String fileName, String contentType, String encoding, IModel<Map<String,Object>> variablesModel)
          Creates a resource reference to a PackagedTextTemplate.
 
Method Summary
 Time lastModifiedTime()
          Returns the last modified time of the PackagedTextTemplate itself.
protected  Resource newResource()
          Creates a new resource which returns the interpolated value of the text template.
 
Methods inherited from class org.apache.wicket.ResourceReference
bind, equals, getLocale, getName, getResource, getScope, getSharedResourceKey, getStyle, hashCode, invalidate, isStateless, setLocale, setStateless, setStyle, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextTemplateResourceReference

public TextTemplateResourceReference(Class<?> scope,
                                     String fileName,
                                     IModel<Map<String,Object>> variablesModel)
Creates a resource reference to a PackagedTextTemplate.

Parameters:
scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
fileName - the file name
variablesModel - the template variables as a model

TextTemplateResourceReference

public TextTemplateResourceReference(Class<?> scope,
                                     String fileName,
                                     String contentType,
                                     IModel<Map<String,Object>> variablesModel)
Creates a resource reference to a PackagedTextTemplate.

Parameters:
scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
fileName - the file name
contentType - the mime type of this resource, such as "image/jpeg" or " text/html"
variablesModel - the template variables as a model

TextTemplateResourceReference

public TextTemplateResourceReference(Class<?> scope,
                                     String fileName,
                                     String contentType,
                                     String encoding,
                                     IModel<Map<String,Object>> variablesModel)
Creates a resource reference to a PackagedTextTemplate.

Parameters:
scope - the Class to be used for retrieving the classloader for loading the PackagedTextTemplate
fileName - the file name
contentType - the mime type of this resource, such as "image/jpeg" or " text/html"
encoding - the file's encoding, for example, "UTF-8"
variablesModel - the template variables as a model
Method Detail

newResource

protected Resource newResource()
Creates a new resource which returns the interpolated value of the text template.

Overrides:
newResource in class ResourceReference
Returns:
a new resource which returns the interpolated value of the text template

lastModifiedTime

public Time lastModifiedTime()
Returns the last modified time of the PackagedTextTemplate itself.

Overrides:
lastModifiedTime in class ResourceReference
Returns:
the last modified time of the PackagedTextTemplate itself


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.