wicket.markup.html
Class DynamicWebResource

java.lang.Object
  extended by wicket.Resource
      extended by wicket.markup.html.WebResource
          extended by wicket.markup.html.DynamicWebResource
All Implemented Interfaces:
java.io.Serializable, IRequestListener, IResourceListener
Direct Known Subclasses:
DynamicImageResource

public abstract class DynamicWebResource
extends WebResource

An WebResource subclass for dynamic resources (resources created programmatically).

Author:
Jonathan Locke, Johan Compagner, Gili Tzabari
See Also:
Serialized Form

Nested Class Summary
static class DynamicWebResource.ResourceState
          The resource state returned by the getResourceState() method.
 
Field Summary
 
Fields inherited from interface wicket.IResourceListener
INTERFACE
 
Constructor Summary
DynamicWebResource()
          Creates a dynamic resource.
DynamicWebResource(java.util.Locale locale)
          Creates a dynamic resource from for the given locale
 
Method Summary
 java.util.Locale getLocale()
          Returns the resource locale.
protected abstract  DynamicWebResource.ResourceState getResourceState()
          Gets the byte array for our dynamic resource.
 IResourceStream getResourceStream()
           
 
Methods inherited from class wicket.markup.html.WebResource
configureResponse, setHeaders
 
Methods inherited from class wicket.Resource
getParameters, invalidate, isCacheable, onResourceRequested, setCacheable, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicWebResource

public DynamicWebResource()
Creates a dynamic resource.


DynamicWebResource

public DynamicWebResource(java.util.Locale locale)
Creates a dynamic resource from for the given locale

Parameters:
locale - The locale of this resource
Method Detail

getLocale

public java.util.Locale getLocale()
Returns the resource locale.

Returns:
The locale of this resource

getResourceStream

public IResourceStream getResourceStream()
Specified by:
getResourceStream in class Resource
Returns:
Gets the resource to attach to the component.

getResourceState

protected abstract DynamicWebResource.ResourceState getResourceState()
Gets the byte array for our dynamic resource. If the subclass regenerates the data, it should set the lastModifiedTime too. This ensures that resource caching works correctly.

Returns:
The byte array for this dynamic resource.


Copyright © 2004-2007 Wicket developers. All Rights Reserved.