Class JRSimpleTemplate

java.lang.Object
net.sf.jasperreports.engine.JRSimpleTemplate
All Implemented Interfaces:
Serializable, JRChangeEventsSupport, JRTemplate

public class JRSimpleTemplate extends Object implements JRTemplate, Serializable, JRChangeEventsSupport
Default JRTemplate implementation.
Author:
Lucian Chirita (lucianc@users.sourceforge.net)
See Also:
  • Field Details

  • Constructor Details

    • JRSimpleTemplate

      public JRSimpleTemplate()
  • Method Details

    • getEventSupport

      public JRPropertyChangeSupport getEventSupport()
      Description copied from interface: JRChangeEventsSupport
      Returns the property change support object for this instance.
      Specified by:
      getEventSupport in interface JRChangeEventsSupport
      Returns:
      the property change support object for this instance
    • addStyle

      public void addStyle(JRStyle style) throws JRException
      Adds a style to the template.
      Parameters:
      style - the style to add
      Throws:
      JRException - when a style with the same name already exists
    • addStyle

      public void addStyle(int index, JRStyle style) throws JRException
      Adds a style to the template.
      Parameters:
      style - the style to add
      Throws:
      JRException - when a style with the same name already exists
    • checkExistingName

      protected void checkExistingName(String name) throws JRException
      Throws:
      JRException
    • nameMatches

      protected boolean nameMatches(JRStyle style, String name)
    • getStyle

      public JRStyle getStyle(String name)
      Returns an included style by name.
      Parameters:
      name - the name of the style to be returned
      Returns:
      the style having the specified name, or null if not found
    • removeStyle

      public boolean removeStyle(JRStyle style)
      Removes an included style.
      Parameters:
      style - the style to remove
      Returns:
      true if and only if the style has been found and removed
    • removeStyle

      public JRStyle removeStyle(String name)
      Removes an included style.
      Parameters:
      name - the name of the style to be removed
      Returns:
      the removed style, or null if not found
    • getStylesList

      public List<JRStyle> getStylesList()
    • getStyles

      public JRStyle[] getStyles()
      Description copied from interface: JRTemplate
      Returns the styles defined in this template.
      Specified by:
      getStyles in interface JRTemplate
      Returns:
      the template styles
    • addIncludedTemplate

      public void addIncludedTemplate(int index, JRTemplateReference reference)
      Adds an included template.
      Parameters:
      reference - the template reference
      See Also:
    • addIncludedTemplate

      public void addIncludedTemplate(JRTemplateReference reference)
      Adds an included template.
      Parameters:
      reference - the template reference
      See Also:
    • addIncludedTemplate

      public void addIncludedTemplate(String templateLocation)
      Adds an included template.
      Parameters:
      templateLocation - the template location
      See Also:
    • removeIncludedTemplate

      public boolean removeIncludedTemplate(JRTemplateReference reference)
      Removes an included template.
      Parameters:
      reference - the template reference to remove
      Returns:
      true if and only if the included template has been found and removed
    • removeIncludedTemplate

      public JRTemplateReference removeIncludedTemplate(String location)
      Removes an included template.

      The first template reference that matches the location is removed.

      Parameters:
      location - the location of the template to remove
      Returns:
      the removed template reference, or null if not found
    • getIncludedTemplates

      public JRTemplateReference[] getIncludedTemplates()
      Description copied from interface: JRTemplate
      Returns the templates included/referenced by this template.
      Specified by:
      getIncludedTemplates in interface JRTemplate
      Returns:
      the included templates
    • getIncludedTemplatesList

      public List<JRTemplateReference> getIncludedTemplatesList()