org.wings.externalizer
Class ImageIconExternalizer

java.lang.Object
  extended by org.wings.externalizer.ImageIconExternalizer
All Implemented Interfaces:
Externalizer<ImageIcon>

public class ImageIconExternalizer
extends Object
implements Externalizer<ImageIcon>

Author:
Armin Haaf, Michael Reinsch

Field Summary
static ImageIconExternalizer SHARED_GIF_INSTANCE
           
static ImageIconExternalizer SHARED_JPG_INSTANCE
           
static ImageIconExternalizer SHARED_PNG_INSTANCE
           
 
Constructor Summary
ImageIconExternalizer()
           
ImageIconExternalizer(String format)
           
 
Method Summary
 String getExtension(ImageIcon obj)
          Returns the file extension of the given object.
 Collection<HttpHeader> getHeaders(ImageIcon obj)
          Get additional http-headers.
 String getId(ImageIcon obj)
          Suggest an id.
 int getLength(ImageIcon obj)
          Returns the externalized length of this Object.
 String getMimeType(ImageIcon obj)
          returns the mime type of the given object.
 Class[] getSupportedClasses()
          Returns the supported classes.
 String[] getSupportedMimeTypes()
          Returns the supported mime types.
 boolean isFinal(ImageIcon obj)
          Returns true if the object is final, false if transient.
 void write(Object obj, Device out)
          Writes the given object into the given Device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHARED_GIF_INSTANCE

public static final ImageIconExternalizer SHARED_GIF_INSTANCE

SHARED_PNG_INSTANCE

public static final ImageIconExternalizer SHARED_PNG_INSTANCE

SHARED_JPG_INSTANCE

public static final ImageIconExternalizer SHARED_JPG_INSTANCE
Constructor Detail

ImageIconExternalizer

public ImageIconExternalizer()

ImageIconExternalizer

public ImageIconExternalizer(String format)
Method Detail

getSupportedClasses

public Class[] getSupportedClasses()
Description copied from interface: Externalizer
Returns the supported classes. The ExternalizeManager chooses the Externalizer (if not specified as parameter) by objects class.

Specified by:
getSupportedClasses in interface Externalizer<ImageIcon>

getSupportedMimeTypes

public String[] getSupportedMimeTypes()
Description copied from interface: Externalizer
Returns the supported mime types. The ExternalizeManager chooses the Externalizer by mime type (if specified as parameter)

Specified by:
getSupportedMimeTypes in interface Externalizer<ImageIcon>

getHeaders

public Collection<HttpHeader> getHeaders(ImageIcon obj)
Description copied from interface: Externalizer
Get additional http-headers. Returns null, if there are no additional headers to be set.

Specified by:
getHeaders in interface Externalizer<ImageIcon>
Parameters:
obj - get headers for this object
Returns:
Set of Map.Entry (key-value pairs) or null if none should be added.

getId

public String getId(ImageIcon obj)
Description copied from interface: Externalizer
Suggest an id. If a resource has a reasonable unique id, then it will be used as the externalized id.

Specified by:
getId in interface Externalizer<ImageIcon>

getExtension

public String getExtension(ImageIcon obj)
Description copied from interface: Externalizer
Returns the file extension of the given object. Some (old) browsers use this information instead of the mime type. This is especially necessary if delivering anything different than HTML.

Specified by:
getExtension in interface Externalizer<ImageIcon>

getMimeType

public String getMimeType(ImageIcon obj)
Description copied from interface: Externalizer
returns the mime type of the given object.

Specified by:
getMimeType in interface Externalizer<ImageIcon>

getLength

public int getLength(ImageIcon obj)
Description copied from interface: Externalizer
Returns the externalized length of this Object. This value is set as content length in the HttpServletResponse. If it return -1 no content length is set.

Specified by:
getLength in interface Externalizer<ImageIcon>

isFinal

public boolean isFinal(ImageIcon obj)
Description copied from interface: Externalizer
Returns true if the object is final, false if transient. It is used to control the caching in the browser.

Specified by:
isFinal in interface Externalizer<ImageIcon>

write

public void write(Object obj,
                  Device out)
           throws IOException
Description copied from interface: Externalizer
Writes the given object into the given Device.

Specified by:
write in interface Externalizer<ImageIcon>
Throws:
ResourceNotFoundException - if the underlying resource is not available.
IOException


wingS Swings ;-)