org.apache.wicket.resource
Class TextTemplateResourceReference

java.lang.Object
  extended by org.apache.wicket.request.resource.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 PackageTextTemplate to a ResourceReference.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.ResourceReference
ResourceReference.Key, ResourceReference.UrlAttributes
 
Constructor Summary
TextTemplateResourceReference(Class<?> scope, String fileName, IModel<Map<String,Object>> variablesModel)
          Creates a resource reference to a PackageTextTemplate.
TextTemplateResourceReference(Class<?> scope, String fileName, String contentType, IModel<Map<String,Object>> variablesModel)
          Creates a resource reference to a PackageTextTemplate.
TextTemplateResourceReference(Class<?> scope, String fileName, String contentType, String encoding, IModel<Map<String,Object>> variablesModel)
          Creates a resource reference to a PackageTextTemplate.
TextTemplateResourceReference(Class<?> scope, String fileName, String contentType, String encoding, IModel<Map<String,Object>> variablesModel, Locale locale, String style, String variation)
          Construct.
 
Method Summary
 IResource getResource()
          Creates a new resource which returns the interpolated value of the text template.
 
Methods inherited from class org.apache.wicket.request.resource.ResourceReference
canBeRegistered, equals, getDependencies, getExtension, getKey, getLocale, getName, getScope, getStyle, getUrlAttributes, getVariation, hashCode, 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 PackageTextTemplate.

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 PackageTextTemplate.

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 PackageTextTemplate.

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

TextTemplateResourceReference

public TextTemplateResourceReference(Class<?> scope,
                                     String fileName,
                                     String contentType,
                                     String encoding,
                                     IModel<Map<String,Object>> variablesModel,
                                     Locale locale,
                                     String style,
                                     String variation)
Construct.

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
locale - Preferred locale for the resource
style - Preferred style for the resource
variation - Preferred variation for the resource
Method Detail

getResource

public IResource getResource()
Creates a new resource which returns the interpolated value of the text template.

Specified by:
getResource in class ResourceReference
Returns:
a new resource which returns the interpolated value of the text template


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.