Class JRFillContext

java.lang.Object
net.sf.jasperreports.engine.fill.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:
  • Field Details

    • EXCEPTION_MESSAGE_KEY_MISSING_MARKUP_PROCESSOR_FACTORY

      public static final String EXCEPTION_MESSAGE_KEY_MISSING_MARKUP_PROCESSOR_FACTORY
      See Also:
  • Constructor Details

    • JRFillContext

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

    • getMasterFiller

      public BaseReportFiller getMasterFiller()
    • getStyledTextUtil

      protected JRStyledTextUtil getStyledTextUtil()
    • getFontUtil

      protected FontUtil getFontUtil()
    • init

      public void init()
    • getFillEvents

      public FillEvents getFillEvents()
    • hasLoadedRenderer

      public boolean hasLoadedRenderer(Object source)
      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

      public Renderable getLoadedRenderer(Object source)
      Gets a cached image renderer.
      Parameters:
      source - the source renderer of the image
      Returns:
      the cached image renderer
      See Also:
    • 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:
    • getRenderersCache

      public RenderersCache getRenderersCache()
    • hasLoadedSubreport

      public boolean hasLoadedSubreport(Object source)
      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

      public JasperReportSource getLoadedSubreport(Object source)
      Gets a cached subreport.
      Parameters:
      source - the source of the subreport
      Returns:
      the cached subreport
      See Also:
    • 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:
    • 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:
      true if and only if a virtualizer is used
      See Also:
    • setPrintPage

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

      public JRPrintPage 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

      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)
    • hasLoadedTemplate

      public boolean hasLoadedTemplate(Object source)
      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

      public ReportTemplateSource getLoadedTemplate(Object source)
      Gets a cached template.
      Parameters:
      source - the source of the template
      Returns:
      the cached template
      See Also:
    • 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:
    • getMarkupProcessor

      protected MarkupProcessor getMarkupProcessor(String markup)
    • 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:
    • generatedFillerId

      protected int generatedFillerId()
    • getReportContext

      public ReportContext getReportContext()
    • setReportContext

      public void setReportContext(ReportContext reportContext)
    • getContextParameterValue

      protected Object getContextParameterValue(String parameterName)
    • getCacheHandler

      public DataCacheHandler getCacheHandler()
    • getDataSnapshot

      public DataSnapshot getDataSnapshot()
    • hasDataSnapshot

      public boolean hasDataSnapshot()
    • getDataRecorder

      public DataRecorder getDataRecorder()
    • addDataRecordResult

      public void addDataRecordResult(FillDatasetPosition fillPosition, Object recorded)
    • cacheDone

      public void cacheDone()
    • markCanceled

      public void markCanceled()
    • isCanceled

      public boolean isCanceled()
    • getFillCache

      public Object getFillCache(String key)
    • setFillCache

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

      public void dispose()
    • isCollectingBookmarks

      public boolean isCollectingBookmarks()
    • registerReportStyles

      public void registerReportStyles(JasperReport jasperReport, UUID id, List<JRStyle> styles)
    • registerReportStyles

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

      public boolean toDetectParts()
    • setDetectParts

      public void setDetectParts(boolean detectParts)