final Section section) throws BundleWriterException
{
final int count = section.getElementCount();
for (int i = 0; i < count; i++)
{
final ReportElement element = section.getElement(i);
if (element instanceof Section)
{
processSection(documentBundle, report, (Section) element);
}
if (element instanceof RootLevelBand)
{
final RootLevelBand rl = (RootLevelBand) element;
final SubReport[] reports = rl.getSubReports();
for (int j = 0; j < reports.length; j++)
{
final SubReport subReport = reports[j];
processSection(documentBundle, report, subReport);
}
}
// Process the attributes if they are a resource key
final ElementMetaData metaData = element.getMetaData();
final AttributeMetaData[] attributeDescriptions = metaData.getAttributeDescriptions();
for (int j = 0; j < attributeDescriptions.length; j++)
{
final AttributeMetaData attributeDescription = attributeDescriptions[j];
if ("Resource".equals(attributeDescription.getValueRole()) == false)
{
continue;
}
final Object attribute = element.getAttribute(attributeDescription.getNameSpace(), attributeDescription.getName());
if (attribute instanceof ResourceKey == false)
{
continue;
}
final ResourceKey resourceKey = (ResourceKey) attribute;
final ResourceKey replacementKey = processResourceKeyAttribute(documentBundle, report, resourceKey);
if (replacementKey != null)
{
element.setAttribute(attributeDescription.getNameSpace(), attributeDescription.getName(), replacementKey);
}
}
}
}