Class JRSimpleTemplate

    • Constructor Detail

      • JRSimpleTemplate

        public JRSimpleTemplate()
    • Method Detail

      • 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
      • 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
      • 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:
        getIncludedTemplates()
      • addIncludedTemplate

        public void addIncludedTemplate​(String templateLocation)
        Adds an included template.
        Parameters:
        templateLocation - the template location
        See Also:
        getIncludedTemplates()
      • 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