* @throws org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriterException
* if the data factory cannot be written.
*/
public void write(final ReportWriterContext reportWriter, final XmlWriter xmlWriter, final DataFactory dataFactory) throws IOException, ReportWriterException
{
final SimplePmdDataFactory pmdDataFactory = (SimplePmdDataFactory) dataFactory;
final AttributeList rootAttrs = new AttributeList();
rootAttrs.addNamespaceDeclaration("data", PmdDataFactoryModule.NAMESPACE);
xmlWriter.writeTag(PmdDataFactoryModule.NAMESPACE, "simple-pmd-datasource", rootAttrs, XmlWriter.OPEN);
final AttributeList configAttrs = new AttributeList();
configAttrs.setAttribute(PmdDataFactoryModule.NAMESPACE, "label-mapping", String.valueOf(pmdDataFactory.isLabelMapping()));
configAttrs.setAttribute(PmdDataFactoryModule.NAMESPACE, "domain", String.valueOf(pmdDataFactory.getDomainId()));
configAttrs.setAttribute(PmdDataFactoryModule.NAMESPACE, "xmi-file", String.valueOf(pmdDataFactory.getXmiFile()));
xmlWriter.writeTag(PmdDataFactoryModule.NAMESPACE, "config", configAttrs, XmlWriterSupport.CLOSE);
xmlWriter.writeCloseTag();
}