Class JRFillContext


  • public class JRFillContext
    extends Object
    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:
    JRBaseFiller
    • Field Detail

      • EXCEPTION_MESSAGE_KEY_MISSING_MARKUP_PROCESSOR_FACTORY

        public static final String EXCEPTION_MESSAGE_KEY_MISSING_MARKUP_PROCESSOR_FACTORY
        See Also:
        Constant Field Values
    • Constructor Detail

      • JRFillContext

        public JRFillContext​(BaseReportFiller masterFiller)
        Constructs a fill context.
    • Method Detail

      • init

        public void init()
      • getFillEvents

        public FillEvents getFillEvents()
      • registerLoadedRenderer

        public void registerLoadedRenderer​(Object source,
                                           Renderable renderer)
        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 renderer
        renderer - the loaded image renderer
        See Also:
        getLoadedRenderer(Object)
      • registerLoadedSubreport

        public void registerLoadedSubreport​(Object source,
                                            JasperReportSource subreport)
        Registers a subreport loaded from a source.

        The subreport is cached for further use.

        Parameters:
        source - the source that was used to load the subreport
        subreport - the loaded subreport
        See Also:
        getLoadedSubreport(Object)
      • 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()
      • setPrintPage

        public void setPrintPage​(JRPrintPage page)
        Sets the current master print page.
        Parameters:
        page - the master print page
        See Also:
        getPrintPage()
      • setRunningQueryExecuter

        public void setRunningQueryExecuter​(JRQueryExecuter queryExecuter)
        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

        public boolean cancelRunningQuery()
                                   throws JRException
        Cancels the running query.
        Returns:
        true if and only if there is a running query and it has been canceled.
        Throws:
        JRException
      • getVirtualizationContext

        public JRVirtualizationContext getVirtualizationContext()
        Returns the virtualization context.
        Returns:
        the virtualization context
      • lockVirtualizationContext

        public void lockVirtualizationContext()
      • unlockVirtualizationContext

        public void unlockVirtualizationContext()
      • getMasterFormatFactory

        public FormatFactory getMasterFormatFactory()
      • setMasterFormatFactory

        public void setMasterFormatFactory​(FormatFactory masterFormatFactory)
      • getMasterLocale

        public Locale getMasterLocale()
      • setMasterLocale

        public void setMasterLocale​(Locale masterLocale)
      • getMasterTimeZone

        public TimeZone getMasterTimeZone()
      • setMasterTimeZone

        public void setMasterTimeZone​(TimeZone masterTimeZone)
      • registerLoadedTemplate

        public void registerLoadedTemplate​(Object source,
                                           ReportTemplateSource templateSource)
        Registers a template loaded from a source.

        The template is cached for further use.

        Parameters:
        source - the source that was used to load the template
        templateSource - the loaded template
        See Also:
        getLoadedTemplate(Object)
      • deduplicate

        public <T extends Deduplicable> T deduplicate​(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.
        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:
        JRPrintElement.getSourceElementId()
      • generatedFillerId

        protected int generatedFillerId()
      • setReportContext

        public void setReportContext​(ReportContext reportContext)
      • getContextParameterValue

        protected Object getContextParameterValue​(String parameterName)
      • hasDataSnapshot

        public boolean hasDataSnapshot()
      • cacheDone

        public void cacheDone()
      • markCanceled

        public void markCanceled()
      • isCanceled

        public boolean isCanceled()
      • setFillCache

        public void setFillCache​(String key,
                                 Object value)
      • dispose

        public void dispose()
      • isCollectingBookmarks

        public boolean isCollectingBookmarks()
      • registerReportStyles

        public void registerReportStyles​(String reportLocation,
                                         UUID id,
                                         List<JRStyle> styles)
      • toDetectParts

        public boolean toDetectParts()
      • setDetectParts

        public void setDetectParts​(boolean detectParts)