Package net.sf.jasperreports.engine.xml
Class JRXmlTemplateWriter
java.lang.Object
net.sf.jasperreports.engine.xml.JRXmlBaseWriter
net.sf.jasperreports.engine.xml.JRXmlTemplateWriter
Template XML serializer.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault XML output encoding.static final XmlNamespaceFields inherited from class net.sf.jasperreports.engine.xml.JRXmlBaseWriter
PROPERTY_REPORT_VERSION, version, versionComparator, writer -
Constructor Summary
ConstructorsConstructorDescriptionJRXmlTemplateWriter(JasperReportsContext jasperReportsContext, JRTemplate template, Writer out, String encoding) Creates an XML template writer.JRXmlTemplateWriter(JRTemplate template, Writer out, String encoding) Creates an XML template writer. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanDecides whether conditional styles are to be written.voidwrite()Writes the template to the output writer.protected voidwriteIncludedTemplate(JRTemplateReference reference) protected voidprotected voidstatic StringwriteTemplate(JasperReportsContext jasperReportsContext, JRTemplate template) Returns the XML representation of a template.static voidwriteTemplate(JasperReportsContext jasperReportsContext, JRTemplate template, OutputStream out) Writes the XML representation of a template to an output stream.static voidwriteTemplate(JasperReportsContext jasperReportsContext, JRTemplate template, OutputStream out, String encoding) Writes the XML representation of a template to an output stream.protected static voidwriteTemplate(JasperReportsContext jasperReportsContext, JRTemplate template, Writer out, String encoding) static StringwriteTemplate(JasperReportsContext jasperReportsContext, JRTemplate template, String encoding) Returns the XML representation of a template.static StringwriteTemplate(JRTemplate template) Returns the XML representation of a template.static voidwriteTemplate(JRTemplate template, OutputStream out) Writes the XML representation of a template to an output stream.static voidwriteTemplate(JRTemplate template, OutputStream out, String encoding) Writes the XML representation of a template to an output stream.static StringwriteTemplate(JRTemplate template, String encoding) Returns the XML representation of a template.static voidwriteTemplateToFile(JasperReportsContext jasperReportsContext, JRTemplate template, String outputFile) Writes the XML representation of a template to a file.static voidwriteTemplateToFile(JasperReportsContext jasperReportsContext, JRTemplate template, String outputFile, String encoding) Writes the XML representation of a template to a file.static voidwriteTemplateToFile(JRTemplate template, String outputFile) Writes the XML representation of a template to a file.static voidwriteTemplateToFile(JRTemplate template, String outputFile, String encoding) Writes the XML representation of a template to a file.Methods inherited from class net.sf.jasperreports.engine.xml.JRXmlBaseWriter
isNewerVersionOrEqual, isOlderVersionThan, useWriter, writeBox, writeBox, writeConditionalStyle, writeExpression, writeParagraph, writeParagraph, writePen, writeStyle, writeStyleReferenceAttr, writeTabStop
-
Field Details
-
JASPERTEMPLATE_NAMESPACE
-
DEFAULT_ENCODING
Default XML output encoding.- See Also:
-
-
Constructor Details
-
JRXmlTemplateWriter
Creates an XML template writer.- Parameters:
template- the template to writeout- the output writerencoding- 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 writeout- the output writerencoding- the XML encoding to use
-
-
Method Details
-
writeTemplate
Returns the XML representation of a template. Usesthe default encoding.- Parameters:
template- the template- Returns:
- the XML representation of the template
-
writeTemplate
Returns the XML representation of a template. Usesthe default encoding.- Parameters:
jasperReportsContext-template- the template- Returns:
- the XML representation of the template
-
writeTemplate
Returns the XML representation of a template.- Parameters:
template- the templateencoding- 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 templateencoding- the XML encoding to use- Returns:
- the XML representation of the template
-
writeTemplate
Writes the XML representation of a template to an output stream. Usesthe default encoding.- Parameters:
template- the templateout- 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. Usesthe default encoding.- Parameters:
jasperReportsContext-template- the templateout- the output stream
-
writeTemplate
Writes the XML representation of a template to an output stream.- Parameters:
template- the templateout- the output streamencoding- 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 templateout- the output streamencoding- the XML encoding to use
-
writeTemplateToFile
Writes the XML representation of a template to a file. Usesthe default encoding.- Parameters:
template- the templateoutputFile- 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. Usesthe default encoding.- Parameters:
jasperReportsContext-template- the templateoutputFile- the output file name
-
writeTemplateToFile
Writes the XML representation of a template to a file.- Parameters:
template- the templateoutputFile- the output file nameencoding- 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 templateoutputFile- the output file nameencoding- the XML encoding to use
-
writeTemplate
protected static void writeTemplate(JasperReportsContext jasperReportsContext, JRTemplate template, Writer out, String encoding) throws IOException - Throws:
IOException
-
write
Writes the template to the output writer.- Throws:
IOException
-
writeIncludedTemplates
- Throws:
IOException
-
writeIncludedTemplate
- Throws:
IOException
-
writeStyles
- Throws:
IOException
-
toWriteConditionalStyles
protected boolean toWriteConditionalStyles()Description copied from class:JRXmlBaseWriterDecides whether conditional styles are to be written.- Specified by:
toWriteConditionalStylesin classJRXmlBaseWriter- Returns:
- whether conditional styles are to be written
-