Class RendererUtil
- java.lang.Object
-
- net.sf.jasperreports.renderers.util.RendererUtil
-
public class RendererUtil extends Object
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_IMAGE_ERROR
static String
EXCEPTION_MESSAGE_KEY_RENDERABLE_MUST_IMPLEMENT_INTERFACE
static Renderable
NO_IMAGE_RENDERER
static String
SVG_FILE_EXTENSION
static String
SVG_MIME_TYPE
protected static String
SVG_ROOT_ELEMENT
protected static String
SVG_ROOT_ELEMENT_QNAME_SUFFIX
-
Method Summary
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_IMAGE_ERROR
public static final String EXCEPTION_MESSAGE_KEY_IMAGE_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_RENDERABLE_MUST_IMPLEMENT_INTERFACE
public static final String EXCEPTION_MESSAGE_KEY_RENDERABLE_MUST_IMPLEMENT_INTERFACE
- See Also:
- Constant Field Values
-
NO_IMAGE_RENDERER
public static final Renderable NO_IMAGE_RENDERER
-
SVG_MIME_TYPE
public static final String SVG_MIME_TYPE
- See Also:
- Constant Field Values
-
SVG_FILE_EXTENSION
public static final String SVG_FILE_EXTENSION
- See Also:
- Constant Field Values
-
SVG_ROOT_ELEMENT
protected static final String SVG_ROOT_ELEMENT
- See Also:
- Constant Field Values
-
SVG_ROOT_ELEMENT_QNAME_SUFFIX
protected static final String SVG_ROOT_ELEMENT_QNAME_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static RendererUtil getInstance(JasperReportsContext jasperReportsContext)
-
getInstance
public static RendererUtil getInstance(RepositoryContext context)
-
isSvgData
public boolean isSvgData(byte[] data)
-
getSvgInfo
public SvgDataSniffer.SvgInfo getSvgInfo(byte[] data)
-
isSvgRootElement
protected boolean isSvgRootElement(String rootElementName)
-
isSvgData
public boolean isSvgData(DataRenderable dataRenderable) throws JRException
- Throws:
JRException
-
getSvgDataSniffer
public SvgDataSniffer getSvgDataSniffer()
-
getNonLazyRenderable
public Renderable getNonLazyRenderable(String resourceLocation, OnErrorTypeEnum onErrorType) throws JRException
- Throws:
JRException
-
getRenderable
public Renderable getRenderable(Image img, OnErrorTypeEnum onErrorType) throws JRException
- Throws:
JRException
-
getRenderable
public Renderable getRenderable(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 instanceimageType
- the type of the image as specified by one of the constants defined in the ImageTypeEnumonErrorType
- one of the error type constants defined in theOnErrorTypeEnum
.- Returns:
- the image renderer instance
- Throws:
JRException
-
getRenderable
public Renderable getRenderable(byte[] data)
-
getRenderable
public Renderable getRenderable(InputStream is, OnErrorTypeEnum onErrorType) throws JRException
- Throws:
JRException
-
getRenderable
public Renderable getRenderable(URL url, OnErrorTypeEnum onErrorType) throws JRException
- Throws:
JRException
-
getRenderable
public Renderable getRenderable(File file, OnErrorTypeEnum onErrorType) throws JRException
- Throws:
JRException
-
handleImageError
public Renderable handleImageError(Exception error, OnErrorTypeEnum onErrorType) throws JRException
- 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
-
isLazy
public static boolean isLazy(Renderable renderer)
-
getResourceLocation
public static String getResourceLocation(Renderable renderer)
-
getDataRenderable
public DataRenderable getDataRenderable(Renderable renderer, Dimension dimension, Color backcolor) throws JRException
- Throws:
JRException
-
getImageDataRenderable
public DataRenderable getImageDataRenderable(RenderersCache renderersCache, Renderable renderer, Dimension dimension, Color backcolor) throws JRException
- Throws:
JRException
-
-