public class JRVirtualizationContext
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
JRVirtualizationContext()
Constructs a context.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheRenderer(JRPrintImage image)
Caches an image renderer.
|
void |
cacheTemplate(JRTemplateElement template)
Caches an element template.
|
JRRenderable |
getCachedRenderer(java.lang.String id)
Retrieves a cached image renderer based on an ID.
|
JRTemplateElement |
getCachedTemplate(java.lang.String templateId)
Retrieves a cached template.
|
static JRVirtualizationContext |
getRegistered(JasperPrint print)
Returns the virtualization context registered for a print object.
|
boolean |
hasCachedRenderer(java.lang.String id)
Determines whether a cached image renderer for a specified ID exists.
|
boolean |
hasCachedTemplate(java.lang.String id)
Determines whether a cached
template with a specified ID exists. |
boolean |
isReadOnly()
Determines whether this context has been marked as read-only.
|
static void |
register(JRVirtualizationContext context,
JasperPrint print)
Registers a virtualization context for
JasperPrint object. |
void |
setReadOnly(boolean readOnly)
Sets the read-only flag for this context.
|
public void cacheRenderer(JRPrintImage image)
image
- the image whose renderer should be cachedpublic JRRenderable getCachedRenderer(java.lang.String id)
id
- the IDpublic boolean hasCachedRenderer(java.lang.String id)
id
- the IDtrue
if and only if the context contains a cached renderer with the specified IDpublic boolean hasCachedTemplate(java.lang.String id)
template
with a specified ID exists.id
- the template IDtrue
if and only if the context contains a cached template with the specified IDpublic void cacheTemplate(JRTemplateElement template)
template
- the template to cachepublic JRTemplateElement getCachedTemplate(java.lang.String templateId)
templateId
- the template IDpublic boolean isReadOnly()
setReadOnly(boolean)
public void setReadOnly(boolean readOnly)
When in read-only mode, all the virtualizable objects belonging to this context are assumed final by the virtualizer and any change in a virtualizable object's data would be discarded on virtualization.
readOnly
- the read-only flagpublic static void register(JRVirtualizationContext context, JasperPrint print)
JasperPrint
object.context
- the virtualization contextprint
- the print objectpublic static JRVirtualizationContext getRegistered(JasperPrint print)
When the engine fills a report using a virtualizer, it registers
the virtualization context with the generated JasperPrint
object so that the caller
would be able to retrieve the context based on the returned print object.
print
- a print objectnull
if no context
has been registered© 2001-2010 Jaspersoft Corporation www.jaspersoft.com