net.sf.jasperreports.engine

## Class RenderableUtil

- java.lang.Object
- - net.sf.jasperreports.engine.RenderableUtil

-     public class RenderableUtil
      extends java.lang.Object

  Version:
    $Id: RenderableUtil.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RenderableUtil` | `getInstance(JasperReportsContext jasperReportsContext)`
    `Renderable` | `getOnErrorRenderer(OnErrorTypeEnum onErrorType, JRException e)`
    `Renderable` | `getOnErrorRenderer(OnErrorTypeEnum onErrorType, JRRuntimeException e)`
    `Renderable` | `getOnErrorRendererForDimension(Renderable renderer, OnErrorTypeEnum onErrorType)`
    `Renderable` | `getOnErrorRendererForImageData(Renderable renderer, OnErrorTypeEnum onErrorType)`
    `Renderable` | `getRenderable(byte[] imageData)`
    `Renderable` | `getRenderable(java.io.File file, OnErrorTypeEnum onErrorType)`
    `Renderable` | `getRenderable(java.awt.Image image, ImageTypeEnum imageType, OnErrorTypeEnum onErrorType)` Creates and returns an instance of the JRImageRenderer class after encoding the image object using an image encoder that supports the supplied image type.
    `Renderable` | `getRenderable(java.awt.Image img, OnErrorTypeEnum onErrorType)`
    `Renderable` | `getRenderable(java.io.InputStream is, OnErrorTypeEnum onErrorType)`
    `Renderable` | `getRenderable(java.lang.String imageLocation)`
    `Renderable` | `getRenderable(java.lang.String imageLocation, OnErrorTypeEnum onErrorType)`
    `Renderable` | `getRenderable(java.lang.String imageLocation, OnErrorTypeEnum onErrorType, boolean isLazy)`
    `Renderable` | `getRenderable(java.net.URL url, OnErrorTypeEnum onErrorType)`
    `static Renderable` | `getWrappingRenderable(JRImageMapRenderer deprecatedRenderer)` Deprecated. To be removed.
    `static Renderable` | `getWrappingRenderable(JRRenderable deprecatedRenderer)` Deprecated. To be removed.
    `protected Renderable` | `handleImageError(java.lang.Exception error, OnErrorTypeEnum onErrorType)` public Renderable getOnErrorRendererForImage(Renderable renderer, OnErrorTypeEnum onErrorType) throws JRException { try { renderer.getImage(); return renderer; } catch (JRException e) { return getOnErrorRenderer(onErrorType, e); } }

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static RenderableUtil getInstance(JasperReportsContext jasperReportsContext)

    - #### getRenderable

          public Renderable getRenderable(byte[] imageData)

    - #### getRenderable

          public Renderable getRenderable(java.lang.String imageLocation)
                                   throws JRException

      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.lang.String imageLocation,
                                 OnErrorTypeEnum onErrorType)
                                   throws JRException

      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.lang.String imageLocation,
                                 OnErrorTypeEnum onErrorType,
                                 boolean isLazy)
                                   throws JRException

      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.awt.Image img,
                                 OnErrorTypeEnum onErrorType)
                                   throws JRException

      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.awt.Image image,
                                 ImageTypeEnum imageType,
                                 OnErrorTypeEnum onErrorType)
                                   throws JRException

      Creates and returns an instance of the JRImageRenderer class after encoding the image object using an image encoder that supports the supplied image type.
      Parameters:
        `image` - the java.awt.Image object to wrap into a JRImageRenderer instance
        `imageType` - the type of the image as specified by one of the constants defined in the JRRenderable interface
        `onErrorType` - one of the error type constants defined in the `OnErrorTypeEnum`.
      Returns:
        the image renderer instance
      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.io.InputStream is,
                                 OnErrorTypeEnum onErrorType)
                                   throws JRException

      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.net.URL url,
                                 OnErrorTypeEnum onErrorType)
                                   throws JRException

      Throws:
        `JRException`

    - #### getRenderable

          public Renderable getRenderable(java.io.File file,
                                 OnErrorTypeEnum onErrorType)
                                   throws JRException

      Throws:
        `JRException`

    - #### getOnErrorRendererForDimension

          public Renderable getOnErrorRendererForDimension(Renderable renderer,
                                                  OnErrorTypeEnum onErrorType)
                                                    throws JRException

      Throws:
        `JRException`

    - #### getOnErrorRendererForImageData

          public Renderable getOnErrorRendererForImageData(Renderable renderer,
                                                  OnErrorTypeEnum onErrorType)
                                                    throws JRException

      Throws:
        `JRException`

    - #### handleImageError

          protected Renderable handleImageError(java.lang.Exception error,
                                    OnErrorTypeEnum onErrorType)
                                         throws JRException

      public Renderable getOnErrorRendererForImage(Renderable renderer, OnErrorTypeEnum onErrorType) throws JRException { try { renderer.getImage(); return renderer; } catch (JRException e) { return getOnErrorRenderer(onErrorType, e); } }
      Throws:
        `JRException`

    - #### getOnErrorRenderer

          public Renderable getOnErrorRenderer(OnErrorTypeEnum onErrorType,
                                      JRException e)
                                        throws JRException

      Throws:
        `JRException`

    - #### getOnErrorRenderer

          public Renderable getOnErrorRenderer(OnErrorTypeEnum onErrorType,
                                      JRRuntimeException e)
                                        throws JRRuntimeException

      Throws:
        `JRRuntimeException`

    - #### getWrappingRenderable

          public static Renderable getWrappingRenderable(JRRenderable deprecatedRenderer)

      Deprecated. To be removed.

    - #### getWrappingRenderable

          public static Renderable getWrappingRenderable(JRImageMapRenderer deprecatedRenderer)

      Deprecated. To be removed.

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com