Package net.sf.jasperreports.engine.fill
Class JRFillContext
java.lang.Object
net.sf.jasperreports.engine.fill.JRFillContext
Context class shared by all the fillers involved in a report (master and subfillers).
The context is created by the master filler and inherited by the subfillers.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataRecordResult(FillDatasetPosition fillPosition, Object recorded) voidbooleanCancels the running query.voidClears the running query executer.<T extends Deduplicable>
Tdeduplicate(T object) Search for a duplicate of a given object in the fill context, and add the object to the context if no duplicate found.voiddispose()protected intintGenerates a fresh fill element Id.protected ObjectgetContextParameterValue(String parameterName) getFillCache(String key) protected FontUtilgetLoadedRenderer(Object source) Gets a cached image renderer.getLoadedSubreport(Object source) Gets a cached subreport.getLoadedTemplate(Object source) Gets a cached template.protected MarkupProcessorgetMarkupProcessor(String markup) Returns the current master print page.protected JRStyledTextUtilReturns the virtualization context.booleanbooleanhasLoadedRenderer(Object source) Checks whether an image renderer given by source has already been loaded and cached.booleanhasLoadedSubreport(Object source) Checks whether a subreport given by source has already been loaded and cached.booleanhasLoadedTemplate(Object source) Checks whether a template given by source has already been loaded and cached.voidinit()booleanbooleanbooleanDecides whether the filling should ignore pagination.booleanDecides whether virtualization is used by the filling process.voidvoidvoidregisterLoadedRenderer(Object source, Renderable renderer) Registers an image renderer loaded from a source.voidregisterLoadedSubreport(Object source, JasperReportSource subreport) Registers a subreport loaded from a source.voidregisterLoadedTemplate(Object source, ReportTemplateSource templateSource) Registers a template loaded from a source.voidregisterReportStyles(String reportLocation, UUID id, List<JRStyle> styles) voidregisterReportStyles(JasperReport jasperReport, UUID id, List<JRStyle> styles) voidsetDetectParts(boolean detectParts) voidsetFillCache(String key, Object value) voidsetMasterFormatFactory(FormatFactory masterFormatFactory) voidsetMasterLocale(Locale masterLocale) voidsetMasterTimeZone(TimeZone masterTimeZone) voidsetPrintPage(JRPrintPage page) Sets the current master print page.voidsetReportContext(ReportContext reportContext) voidsetRunningQueryExecuter(JRQueryExecuter queryExecuter) Sets the running query executer.voidsetUsingVirtualizer(boolean usingVirtualizer) Sets the flag indicating whether a virtualizer is used by the filling process.booleanvoid
-
Field Details
-
EXCEPTION_MESSAGE_KEY_MISSING_MARKUP_PROCESSOR_FACTORY
- See Also:
-
-
Constructor Details
-
JRFillContext
Constructs a fill context.
-
-
Method Details
-
getMasterFiller
-
getStyledTextUtil
-
getFontUtil
-
init
public void init() -
getFillEvents
-
hasLoadedRenderer
Checks whether an image renderer given by source has already been loaded and cached.- Parameters:
source- the source of the image renderer- Returns:
- whether the image renderer has been cached
- See Also:
-
getLoadedRenderer
Gets a cached image renderer.- Parameters:
source- the source renderer of the image- Returns:
- the cached image renderer
- See Also:
-
registerLoadedRenderer
Registers an image renderer loaded from a source.The image renderer is cached for further use.
- Parameters:
source- the source that was used to load the image rendererrenderer- the loaded image renderer- See Also:
-
getRenderersCache
-
hasLoadedSubreport
Checks whether a subreport given by source has already been loaded and cached.- Parameters:
source- the source of the subreport- Returns:
- whether the subreport has been cached
- See Also:
-
getLoadedSubreport
Gets a cached subreport.- Parameters:
source- the source of the subreport- Returns:
- the cached subreport
- See Also:
-
registerLoadedSubreport
Registers a subreport loaded from a source.The subreport is cached for further use.
- Parameters:
source- the source that was used to load the subreportsubreport- the loaded subreport- See Also:
-
setUsingVirtualizer
public void setUsingVirtualizer(boolean usingVirtualizer) Sets the flag indicating whether a virtualizer is used by the filling process.- Parameters:
usingVirtualizer- whether virtualization is used- See Also:
-
isUsingVirtualizer
public boolean isUsingVirtualizer()Decides whether virtualization is used by the filling process.- Returns:
trueif and only if a virtualizer is used- See Also:
-
setPrintPage
Sets the current master print page.- Parameters:
page- the master print page- See Also:
-
getPrintPage
Returns the current master print page.- Returns:
- the current master print page
- See Also:
-
isIgnorePagination
public boolean isIgnorePagination()Decides whether the filling should ignore pagination.- Returns:
- whether the filling should ignore pagination
- See Also:
-
setRunningQueryExecuter
Sets the running query executer.This method is called before firing the query.
- Parameters:
queryExecuter- the running query executer
-
clearRunningQueryExecuter
public void clearRunningQueryExecuter()Clears the running query executer.This method is called after the query has ended.
-
cancelRunningQuery
Cancels the running query.- Returns:
trueif and only if there is a running query and it has been canceled.- Throws:
JRException
-
getVirtualizationContext
Returns the virtualization context.- Returns:
- the virtualization context
-
lockVirtualizationContext
public void lockVirtualizationContext() -
unlockVirtualizationContext
public void unlockVirtualizationContext() -
getMasterFormatFactory
-
setMasterFormatFactory
-
getMasterLocale
-
setMasterLocale
-
getMasterTimeZone
-
setMasterTimeZone
-
hasLoadedTemplate
Checks whether a template given by source has already been loaded and cached.- Parameters:
source- the source of the template- Returns:
- whether the template has been cached
- See Also:
-
getLoadedTemplate
Gets a cached template.- Parameters:
source- the source of the template- Returns:
- the cached template
- See Also:
-
registerLoadedTemplate
Registers a template loaded from a source.The template is cached for further use.
- Parameters:
source- the source that was used to load the templatetemplateSource- the loaded template- See Also:
-
getMarkupProcessor
-
deduplicate
Search for a duplicate of a given object in the fill context, and add the object to the context if no duplicate found.- Parameters:
object- the object to be searched or added- Returns:
- a duplicate of the object if found, or the passed object if not
-
generateFillElementId
public int generateFillElementId()Generates a fresh fill element Id. This method is called once by each fill element, and the returned Id is used for the generated print elements.- Returns:
- a generated Id for a fill element
- See Also:
-
generatedFillerId
protected int generatedFillerId() -
getReportContext
-
setReportContext
-
getContextParameterValue
-
getCacheHandler
-
getDataSnapshot
-
hasDataSnapshot
public boolean hasDataSnapshot() -
getDataRecorder
-
addDataRecordResult
-
cacheDone
public void cacheDone() -
markCanceled
public void markCanceled() -
isCanceled
public boolean isCanceled() -
getFillCache
-
setFillCache
-
dispose
public void dispose() -
isCollectingBookmarks
public boolean isCollectingBookmarks() -
registerReportStyles
-
registerReportStyles
-
toDetectParts
public boolean toDetectParts() -
setDetectParts
public void setDetectParts(boolean detectParts)
-