Class JRXmlTemplateWriter

    • Field Detail

      • JASPERTEMPLATE_NAMESPACE

        public static final XmlNamespace JASPERTEMPLATE_NAMESPACE
    • Constructor Detail

      • JRXmlTemplateWriter

        public JRXmlTemplateWriter​(JRTemplate template,
                                   Writer out,
                                   String encoding)
        Creates an XML template writer.
        Parameters:
        template - the template to write
        out - the output writer
        encoding - the XML encoding to use
      • JRXmlTemplateWriter

        public JRXmlTemplateWriter​(JasperReportsContext jasperReportsContext,
                                   JRTemplate template,
                                   Writer out,
                                   String encoding)
        Creates an XML template writer.
        Parameters:
        jasperReportsContext -
        template - the template to write
        out - the output writer
        encoding - the XML encoding to use
    • Method Detail

      • writeTemplate

        public static String writeTemplate​(JRTemplate template)
        Returns the XML representation of a template.

        Uses the default encoding.

        Parameters:
        template - the template
        Returns:
        the XML representation of the template
      • writeTemplate

        public static String writeTemplate​(JasperReportsContext jasperReportsContext,
                                           JRTemplate template)
        Returns the XML representation of a template.

        Uses the default encoding.

        Parameters:
        jasperReportsContext -
        template - the template
        Returns:
        the XML representation of the template
      • writeTemplate

        public static String writeTemplate​(JRTemplate template,
                                           String encoding)
        Returns the XML representation of a template.
        Parameters:
        template - the template
        encoding - the XML encoding to use
        Returns:
        the XML representation of the template
      • writeTemplate

        public static String writeTemplate​(JasperReportsContext jasperReportsContext,
                                           JRTemplate template,
                                           String encoding)
        Returns the XML representation of a template.
        Parameters:
        jasperReportsContext -
        template - the template
        encoding - the XML encoding to use
        Returns:
        the XML representation of the template
      • writeTemplate

        public static void writeTemplate​(JRTemplate template,
                                         OutputStream out)
        Writes the XML representation of a template to an output stream.

        Uses the default encoding.

        Parameters:
        template - the template
        out - the output stream
      • writeTemplate

        public static void writeTemplate​(JasperReportsContext jasperReportsContext,
                                         JRTemplate template,
                                         OutputStream out)
        Writes the XML representation of a template to an output stream.

        Uses the default encoding.

        Parameters:
        jasperReportsContext -
        template - the template
        out - the output stream
      • writeTemplate

        public static void writeTemplate​(JRTemplate template,
                                         OutputStream out,
                                         String encoding)
        Writes the XML representation of a template to an output stream.
        Parameters:
        template - the template
        out - the output stream
        encoding - the XML encoding to use
      • writeTemplate

        public static void writeTemplate​(JasperReportsContext jasperReportsContext,
                                         JRTemplate template,
                                         OutputStream out,
                                         String encoding)
        Writes the XML representation of a template to an output stream.
        Parameters:
        jasperReportsContext -
        template - the template
        out - the output stream
        encoding - the XML encoding to use
      • writeTemplateToFile

        public static void writeTemplateToFile​(JRTemplate template,
                                               String outputFile)
        Writes the XML representation of a template to a file.

        Uses the default encoding.

        Parameters:
        template - the template
        outputFile - the output file name
      • writeTemplateToFile

        public static void writeTemplateToFile​(JasperReportsContext jasperReportsContext,
                                               JRTemplate template,
                                               String outputFile)
        Writes the XML representation of a template to a file.

        Uses the default encoding.

        Parameters:
        jasperReportsContext -
        template - the template
        outputFile - the output file name
      • writeTemplateToFile

        public static void writeTemplateToFile​(JRTemplate template,
                                               String outputFile,
                                               String encoding)
        Writes the XML representation of a template to a file.
        Parameters:
        template - the template
        outputFile - the output file name
        encoding - the XML encoding to use
      • writeTemplateToFile

        public static void writeTemplateToFile​(JasperReportsContext jasperReportsContext,
                                               JRTemplate template,
                                               String outputFile,
                                               String encoding)
        Writes the XML representation of a template to a file.
        Parameters:
        jasperReportsContext -
        template - the template
        outputFile - the output file name
        encoding - the XML encoding to use
      • write

        public void write()
                   throws IOException
        Writes the template to the output writer.
        Throws:
        IOException
      • toWriteConditionalStyles

        protected boolean toWriteConditionalStyles()
        Description copied from class: JRXmlBaseWriter
        Decides whether conditional styles are to be written.
        Specified by:
        toWriteConditionalStyles in class JRXmlBaseWriter
        Returns:
        whether conditional styles are to be written