Class ComponentsEnvironment

java.lang.Object
net.sf.jasperreports.engine.component.ComponentsEnvironment

public final class ComponentsEnvironment extends Object
A class that provides access to component bundles.

Component bundles are registered as JasperReports extensions of type ComponentsBundle via the central extension framework (see ExtensionsEnvironment).

Author:
Lucian Chirita (lucianc@users.sourceforge.net)
  • Field Details

    • EXCEPTION_MESSAGE_KEY_BUNDLE_NOT_REGISTERED

      public static final String EXCEPTION_MESSAGE_KEY_BUNDLE_NOT_REGISTERED
      See Also:
  • Method Details

    • getInstance

      public static ComponentsEnvironment getInstance(JasperReportsContext jasperReportsContext)
    • getBundles

      public Collection<ComponentsBundle> getBundles()
      Returns the set of all component bundles present in the registry.
      Returns:
      the set of component bundles
    • getCachedBundles

      protected Map<String,ComponentsBundle> getCachedBundles()
    • findBundles

      protected Map<String,ComponentsBundle> findBundles()
    • getBundle

      public ComponentsBundle getBundle(String namespace)
      Returns a component bundle that corresponds to a namespace.
      Parameters:
      namespace - a component bundle namespace
      Returns:
      the corresponding component bundle
      Throws:
      JRRuntimeException - if no bundle corresponding to the namespace is found in the registry
    • getManager

      public ComponentManager getManager(ComponentKey componentKey)
      Returns a component manager that corresponds to a particular component type key.
      Parameters:
      componentKey - the component type key
      Returns:
      the manager for the component type
      Throws:
      JRRuntimeException - if the registry does not contain the specified component type