org.apache.wicket.markup.html.image.resource
Class BlobImageResource

java.lang.Object
  extended by org.apache.wicket.Resource
      extended by org.apache.wicket.markup.html.WebResource
          extended by org.apache.wicket.markup.html.DynamicWebResource
              extended by org.apache.wicket.markup.html.image.resource.DynamicImageResource
                  extended by org.apache.wicket.markup.html.image.resource.BlobImageResource
All Implemented Interfaces:
Serializable, IClusterable, IRequestListener, IResourceListener

public abstract class BlobImageResource
extends DynamicImageResource

An ImageResource subclass for dynamic images that come from database BLOB fields. Subclasses override getBlob() to provide the image data to send back to the user. A given subclass may decide how to produce this data and whether/how to buffer it.

Author:
Eelco Hillenius
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.markup.html.DynamicWebResource
DynamicWebResource.ResourceState
 
Field Summary
 
Fields inherited from interface org.apache.wicket.IResourceListener
INTERFACE
 
Constructor Summary
BlobImageResource()
          Construct.
BlobImageResource(Locale locale)
          Construct.
BlobImageResource(String format)
          Construct.
BlobImageResource(String format, Locale locale)
          Construct.
 
Method Summary
protected abstract  Blob getBlob()
          Gets the BLOB (Binary Large OBject) that holds the raw image data.
protected  byte[] getImageData()
          Get image data for our dynamic image resource.
 
Methods inherited from class org.apache.wicket.markup.html.image.resource.DynamicImageResource
getFormat, getResourceState, setFormat, setLastModifiedTime, toImageData
 
Methods inherited from class org.apache.wicket.markup.html.DynamicWebResource
getLocale, getResourceStream, setHeaders
 
Methods inherited from class org.apache.wicket.markup.html.WebResource
configureResponse, getCacheDuration
 
Methods inherited from class org.apache.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

BlobImageResource

public BlobImageResource(Locale locale)
Construct.

Parameters:
locale -

BlobImageResource

public BlobImageResource(String format,
                         Locale locale)
Construct.

Parameters:
format -
locale -

BlobImageResource

public BlobImageResource(String format)
Construct.

Parameters:
format -

BlobImageResource

public BlobImageResource()
Construct.

Method Detail

getImageData

protected byte[] getImageData()
Description copied from class: DynamicImageResource
Get image data for our dynamic image resource. If the subclass regenerates the data, it should set the lastModifiedTime when it does so. This ensures that image caching works correctly.

Specified by:
getImageData in class DynamicImageResource
Returns:
The image data for this dynamic image
See Also:
DynamicImageResource.getImageData()

getBlob

protected abstract Blob getBlob()
Gets the BLOB (Binary Large OBject) that holds the raw image data.

Returns:
the BLOB


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