NextApp Echo3
v3.0.b4

nextapp.echo.app
Class ResourceImageReference

java.lang.Object
  extended by nextapp.echo.app.StreamImageReference
      extended by nextapp.echo.app.ResourceImageReference
All Implemented Interfaces:
java.io.Serializable, ImageReference, RenderIdSupport

public class ResourceImageReference
extends StreamImageReference

A representation of an image that will be retrieved as a resource from the CLASSPATH.

See Also:
Serialized Form

Constructor Summary
ResourceImageReference(java.lang.String resource)
          Creates a ResourceImageReference.
ResourceImageReference(java.lang.String resource, Extent width, Extent height)
          Creates a ResourceImageReference.
ResourceImageReference(java.lang.String resource, java.lang.String contentType)
          Creates a ResourceImageReference.
ResourceImageReference(java.lang.String resource, java.lang.String contentType, Extent width, Extent height)
          Creates a ResourceImageReference.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getContentType()
          Returns the valid RFC 1521 image content type (e.g., image/png, image/jpeg, image/gif, etc) of the image.
 Extent getHeight()
          Returns the height of the image, or null if the size is unknown.
 java.lang.String getRenderId()
          Returns an identifier that is unique within the ApplicationInstance with which the implementor will be used.
 java.lang.String getResource()
          Returns the name of the resource.
 Extent getWidth()
          Returns the width of the image, or null if the size is unknown.
 int hashCode()
           
 void render(java.io.OutputStream out)
          Renders the image data in its native format to the given output stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceImageReference

public ResourceImageReference(java.lang.String resource)
Creates a ResourceImageReference. The content type will be automatically determined.

Parameters:
resource - the resource name containing the binary image data

ResourceImageReference

public ResourceImageReference(java.lang.String resource,
                              java.lang.String contentType)
Creates a ResourceImageReference.

Parameters:
resource - the resource name containing the binary image data (all resource names will be treated as absolute, it is unnecessary to prepend a leading slash to the resource name)
contentType - the content type of the image (or null to automatically determine the content type based on the resource extension)

ResourceImageReference

public ResourceImageReference(java.lang.String resource,
                              Extent width,
                              Extent height)
Creates a ResourceImageReference. The content type will be automatically determined.

Parameters:
resource - the resource name containing the binary image data (all resource names will be treated as absolute, it is unnecessary to prepend a leading slash to the resource name)
width - the width of the image
height - the height of the image

ResourceImageReference

public ResourceImageReference(java.lang.String resource,
                              java.lang.String contentType,
                              Extent width,
                              Extent height)
Creates a ResourceImageReference.

Parameters:
resource - the resource name containing the binary image data (all resource names will be treated as absolute, it is unnecessary to prepend a leading slash to the resource name)
contentType - the content type of the image (or null to automatically determine the content type based on the resource extension)
width - the width of the image
height - the height of the image
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getContentType

public java.lang.String getContentType()
Description copied from class: StreamImageReference
Returns the valid RFC 1521 image content type (e.g., image/png, image/jpeg, image/gif, etc) of the image.

Specified by:
getContentType in class StreamImageReference
Returns:
the content type of the image
See Also:
StreamImageReference.getContentType()

getHeight

public Extent getHeight()
Description copied from interface: ImageReference
Returns the height of the image, or null if the size is unknown.

Specified by:
getHeight in interface ImageReference
Overrides:
getHeight in class StreamImageReference
Returns:
the height of the image
See Also:
ImageReference.getHeight()

getRenderId

public java.lang.String getRenderId()
Description copied from interface: RenderIdSupport
Returns an identifier that is unique within the ApplicationInstance with which the implementor will be used.

See Also:
RenderIdSupport.getRenderId()

getResource

public java.lang.String getResource()
Returns the name of the resource.

Returns:
the name of the resource

getWidth

public Extent getWidth()
Description copied from interface: ImageReference
Returns the width of the image, or null if the size is unknown.

Specified by:
getWidth in interface ImageReference
Overrides:
getWidth in class StreamImageReference
Returns:
the width of the image
See Also:
ImageReference.getWidth()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

render

public void render(java.io.OutputStream out)
            throws java.io.IOException
Description copied from class: StreamImageReference
Renders the image data in its native format to the given output stream.

Specified by:
render in class StreamImageReference
Parameters:
out - the output stream to write the image
Throws:
java.io.IOException
See Also:
StreamImageReference.render(java.io.OutputStream)

NextApp Echo3
v3.0.b4