Package net.sf.jasperreports.engine.xml
Class JRXmlBaseWriter
- java.lang.Object
-
- net.sf.jasperreports.engine.xml.JRXmlBaseWriter
-
- Direct Known Subclasses:
JRXmlTemplateWriter,JRXmlWriter
public abstract class JRXmlBaseWriter extends Object
Base XML writer.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_REPORT_VERSIONProperty that specifies the JasperReports version associated with this report.protected Stringversionprotected VersionComparatorversionComparatorprotected JRXmlWriteHelperwriter
-
Constructor Summary
Constructors Constructor Description JRXmlBaseWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanisNewerVersionOrEqual(String oldVersion)protected booleanisOlderVersionThan(String version)protected abstract booleantoWriteConditionalStyles()Decides whether conditional styles are to be written.protected voiduseWriter(JRXmlWriteHelper writer, String version)Sets the XML write helper.voidwriteBox(JRLineBox box)voidwriteBox(JRLineBox box, XmlNamespace namespace)protected voidwriteConditionalStyle(JRConditionalStyle style)Writes a conditional style.protected voidwriteExpression(String name, JRExpression expression, boolean writeClass)voidwriteParagraph(JRParagraph paragraph)voidwriteParagraph(JRParagraph paragraph, XmlNamespace namespace)protected voidwritePen(JRPen pen)protected voidwriteStyle(JRStyle style)Writes a style.voidwriteStyleReferenceAttr(JRStyleContainer styleContainer)voidwriteTabStop(TabStop tabStop)
-
-
-
Field Detail
-
PROPERTY_REPORT_VERSION
public static final String PROPERTY_REPORT_VERSION
Property that specifies the JasperReports version associated with this report. Report elements/attributes newer than this version are neglected by the JRXML writers when a report template is generated. If not set, all elements/attributes will be printed out.- See Also:
JRXmlWriter, Constant Field Values
-
writer
protected JRXmlWriteHelper writer
-
version
protected String version
-
versionComparator
protected VersionComparator versionComparator
-
-
Method Detail
-
useWriter
protected void useWriter(JRXmlWriteHelper writer, String version)
Sets the XML write helper.- Parameters:
writer- the XML write helper
-
writeStyle
protected void writeStyle(JRStyle style) throws IOException
Writes a style.- Parameters:
style- the style to write.- Throws:
IOException
-
writeStyleReferenceAttr
public void writeStyleReferenceAttr(JRStyleContainer styleContainer)
-
toWriteConditionalStyles
protected abstract boolean toWriteConditionalStyles()
Decides whether conditional styles are to be written.- Returns:
- whether conditional styles are to be written
-
writeConditionalStyle
protected void writeConditionalStyle(JRConditionalStyle style) throws IOException
Writes a conditional style.- Parameters:
style- the conditional style- Throws:
IOException
-
writePen
protected void writePen(JRPen pen) throws IOException
- Throws:
IOException
-
writeBox
public void writeBox(JRLineBox box) throws IOException
- Throws:
IOException
-
writeBox
public void writeBox(JRLineBox box, XmlNamespace namespace) throws IOException
- Throws:
IOException
-
writeParagraph
public void writeParagraph(JRParagraph paragraph) throws IOException
- Throws:
IOException
-
writeParagraph
public void writeParagraph(JRParagraph paragraph, XmlNamespace namespace) throws IOException
- Throws:
IOException
-
writeTabStop
public void writeTabStop(TabStop tabStop) throws IOException
- Throws:
IOException
-
isNewerVersionOrEqual
protected boolean isNewerVersionOrEqual(String oldVersion)
-
isOlderVersionThan
protected boolean isOlderVersionThan(String version)
-
writeExpression
protected void writeExpression(String name, JRExpression expression, boolean writeClass) throws IOException
- Throws:
IOException
-
-