summaryrefslogtreecommitdiff
path: root/reportbuilder
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 09:13:31 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:02:58 +0200
commitf4cca7347f56663f42c8a8fdf3bca654727fc060 (patch)
treecb5e4a5dff41de390fba642436f574071a1ba57a /reportbuilder
parent9140da5ee8cadeeaeea7bced2a2a5386807ce148 (diff)
Convert Java code in reportbuilder to use Java5 generics
Change-Id: Ia8a0206c6c81f2a4212dc92b80a9d6965ad8bd63
Diffstat (limited to 'reportbuilder')
-rw-r--r--reportbuilder/java/com/sun/star/report/DataSourceFactory.java2
-rw-r--r--reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java15
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java10
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java10
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java52
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java2
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java12
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java1
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java20
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java30
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java10
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java12
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java50
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java14
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java26
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java4
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java7
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java4
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java14
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java7
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java52
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java7
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java28
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java8
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java9
-rw-r--r--reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java4
-rw-r--r--reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java6
-rw-r--r--reportbuilder/java/com/sun/star/report/util/ManifestWriter.java12
46 files changed, 270 insertions, 276 deletions
diff --git a/reportbuilder/java/com/sun/star/report/DataSourceFactory.java b/reportbuilder/java/com/sun/star/report/DataSourceFactory.java
index fc3ba02bade5..8aa0262c8123 100644
--- a/reportbuilder/java/com/sun/star/report/DataSourceFactory.java
+++ b/reportbuilder/java/com/sun/star/report/DataSourceFactory.java
@@ -29,6 +29,6 @@ import java.util.Map;
public interface DataSourceFactory
{
- public DataSource queryData(String name, Map parameter)
+ public DataSource queryData(String name, Map<String,Object> parameters)
throws DataSourceException;
}
diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java
index 949ea10b429f..ce8df3fc2859 100644
--- a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java
+++ b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java
@@ -133,9 +133,8 @@ public class SDBCReportDataFactory implements DataSourceFactory
class ParameterDefinition
{
-
int parameterCount = 0;
- private ArrayList parameterIndex = new ArrayList();
+ private ArrayList<Integer> parameterIndex = new ArrayList<Integer>();
}
private static final Log LOGGER = LogFactory.getLog(SDBCReportDataFactory.class);
public static final String COMMAND_TYPE = "command-type";
@@ -159,8 +158,8 @@ public class SDBCReportDataFactory implements DataSourceFactory
private static final int HANDLE_QUERY = 4;
private static final int HANDLE_TABLE = 5;
private static final int HANDLE_SQL = 6;
- private final Map rowSetProperties = new HashMap();
- private final Map parameterMap = new HashMap();
+ private final Map<RowSetProperties,XRowSet> rowSetProperties = new HashMap<RowSetProperties,XRowSet>();
+ private final Map<RowSetProperties,ParameterDefinition> parameterMap = new HashMap<RowSetProperties,ParameterDefinition>();
private boolean rowSetCreated = false;
public SDBCReportDataFactory(final XComponentContext cmpCtx, final XConnection connection)
@@ -169,7 +168,7 @@ public class SDBCReportDataFactory implements DataSourceFactory
m_cmpCtx = cmpCtx;
}
- public DataSource queryData(final String command, final Map parameters) throws DataSourceException
+ public DataSource queryData(final String command, final Map<String,Object> parameters) throws DataSourceException
{
try
{
@@ -365,13 +364,13 @@ public class SDBCReportDataFactory implements DataSourceFactory
{
object = ((BigDecimal) object).toString();
}
- final Integer pos = (Integer) paramDef.parameterIndex.get(i);
+ final Integer pos = paramDef.parameterIndex.get(i);
para.setObject(pos + 1, object);
}
}
}
- private final Object[] createRowSet(final RowSetProperties rowSetProps, final Map parameters)
+ private final Object[] createRowSet(final RowSetProperties rowSetProps, final Map<String,Object> parameters)
throws Exception
{
final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS);
@@ -440,7 +439,7 @@ public class SDBCReportDataFactory implements DataSourceFactory
}
// get old parameter count
final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS);
- final ArrayList handledColumns = new ArrayList();
+ final ArrayList<String> handledColumns = new ArrayList<String>();
final XParametersSupplier paraSup = (XParametersSupplier) UnoRuntime.queryInterface(XParametersSupplier.class, composer);
if (paraSup != null)
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java
index 1a8f355da9fa..623de3ae996d 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java
@@ -43,13 +43,13 @@ public class PentahoReportEngineMetaData
public static final String OPENDOCUMENT_CHART = "application/vnd.oasis.opendocument.chart";
public final static String CONTENT_TYPE = "content-type";
public static final String DEBUG = "raw/text+xml";
- private final Set mandatoryParameters;
- private final Map parameterTypes;
+ private final Set<String> mandatoryParameters;
+ private final Map<String,Class<?>> parameterTypes;
private final HashNMap enumerationValues;
public PentahoReportEngineMetaData()
{
- mandatoryParameters = new HashSet();
+ mandatoryParameters = new HashSet<String>();
mandatoryParameters.add(ReportEngineParameterNames.CONTENT_TYPE);
mandatoryParameters.add(ReportEngineParameterNames.INPUT_NAME);
mandatoryParameters.add(ReportEngineParameterNames.INPUT_REPOSITORY);
@@ -66,7 +66,7 @@ public class PentahoReportEngineMetaData
mandatoryParameters.add(ReportEngineParameterNames.MAXROWS);
- parameterTypes = new HashMap();
+ parameterTypes = new HashMap<String,Class<?>>();
parameterTypes.put(ReportEngineParameterNames.CONTENT_TYPE, String.class);
parameterTypes.put(ReportEngineParameterNames.INPUT_NAME, String.class);
parameterTypes.put(ReportEngineParameterNames.OUTPUT_NAME, String.class);
@@ -99,7 +99,7 @@ public class PentahoReportEngineMetaData
public Class getParameterType(final String parameter)
{
- return (Class) parameterTypes.get(parameter);
+ return parameterTypes.get(parameter);
}
public boolean isEnumeration(final String parameter)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java
index 3fba4775e75f..327d3349e2ab 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java
@@ -77,7 +77,7 @@ public class PentahoReportJob implements ReportJob
private static final Log LOGGER = LogFactory.getLog(PentahoReportJob.class);
private boolean finished;
- private final List listeners;
+ private final List<JobProgressIndicator> listeners;
private final DataSourceFactory dataSourceFactory;
private final OutputRepository outputRepository;
private final JobProperties jobProperties;
@@ -104,7 +104,7 @@ public class PentahoReportJob implements ReportJob
}
this.definition = definition;
- this.listeners = new ArrayList();
+ this.listeners = new ArrayList<JobProgressIndicator>();
this.jobProperties = definition.getProcessingParameters().copy();
this.dataSourceFactory = (DataSourceFactory) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
@@ -226,7 +226,7 @@ public class PentahoReportJob implements ReportJob
listeners.remove(indicator);
}
- private void collectGroupExpressions(final Node[] nodes, final List expressions, final FormulaParser parser, final Expression reportFunctions[])
+ private void collectGroupExpressions(final Node[] nodes, final List<Object[]> expressions, final FormulaParser parser, final Expression reportFunctions[])
{
for (int i = 0; i < nodes.length; i++)
{
@@ -343,7 +343,7 @@ public class PentahoReportJob implements ReportJob
final Node[] nodes = report.getNodeArray();
final FormulaParser parser = new FormulaParser();
- final ArrayList expressions = new ArrayList();
+ final ArrayList<Object[]> expressions = new ArrayList<Object[]>();
final OfficeReport officeReport = (OfficeReport) ((Section) nodes[0]).getNode(0);
final Section reportBody = (Section) officeReport.getBodySection();
collectGroupExpressions(reportBody.getNodeArray(), expressions, parser, officeReport.getExpressions());
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java
index 6cd57dd59332..ae962b273f7b 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java
@@ -59,7 +59,7 @@ public final class SOFormulaOpCodeMapper extends WeakBase
{
throw new IllegalArgumentException();
}
- final ArrayList token = new ArrayList();
+ final ArrayList<FormulaToken> token = new ArrayList<FormulaToken>();
final Map parserNames = parser.getNames();
for (int i = 0; i < Names.length; i++)
{
@@ -69,7 +69,7 @@ public final class SOFormulaOpCodeMapper extends WeakBase
}
}
- return (com.sun.star.sheet.FormulaToken[]) token.toArray(new FormulaToken[token.size()]);
+ return token.toArray(new FormulaToken[token.size()]);
}
public com.sun.star.sheet.FormulaOpCodeMapEntry[] getAvailableMappings(int Language, int Groups) throws com.sun.star.lang.IllegalArgumentException
@@ -78,10 +78,10 @@ public final class SOFormulaOpCodeMapper extends WeakBase
{
throw new IllegalArgumentException();
}
- final ArrayList token = new ArrayList();
+ final ArrayList<FormulaOpCodeMapEntry> token = new ArrayList<FormulaOpCodeMapEntry>();
if (Groups == FormulaMapGroup.SPECIAL)
{
- return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) parser.getSpecialOpCodes().toArray(new FormulaOpCodeMapEntry[parser.getSpecialOpCodes().size()]);
+ return parser.getSpecialOpCodes().toArray(new FormulaOpCodeMapEntry[parser.getSpecialOpCodes().size()]);
}
else
{
@@ -111,7 +111,7 @@ public final class SOFormulaOpCodeMapper extends WeakBase
}
}
- return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) token.toArray(new FormulaOpCodeMapEntry[token.size()]);
+ return token.toArray(new FormulaOpCodeMapEntry[token.size()]);
}
public String getImplementationName()
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java
index b9747199eed0..de35978d8573 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java
@@ -56,6 +56,8 @@ import org.pentaho.reporting.libraries.formula.parser.TokenMgrError;
public final class SOFormulaParser extends ComponentBase
implements com.sun.star.report.meta.XFormulaParser, XServiceInfo
{
+ /* Need this to get around generics array creation restriction */
+ private static class StringOpcodeMap extends HashMap<Integer,FormulaOpCodeMapEntry> {}
public static final int SEPARATORS = 0;
public static final int ARRAY_SEPARATORS = 1;
@@ -67,17 +69,12 @@ public final class SOFormulaParser extends ComponentBase
private static final String __serviceName = "com.sun.star.report.meta.FormulaParser";
private static final String OPERATORS = "org.pentaho.reporting.libraries.formula.operators.";
// attributes
- final private List m_OpCodeMap = new ArrayList();
+ final private List<FormulaOpCodeMapEntry> m_OpCodeMap = new ArrayList<FormulaOpCodeMapEntry>();
private XFormulaOpCodeMapper formulaOpCodeMapper = null;
- private final Map parserAllOpCodes = new HashMap();
- private final Map parserNames = new HashMap();
- private final Map[] groupOpCodes = new HashMap[5];
- private final List specialOpCodes = new ArrayList();
-
- public List getSpecialOpCodes()
- {
- return specialOpCodes;
- }
+ private final Map<Integer,FormulaOpCodeMapEntry> parserAllOpCodes = new HashMap<Integer,FormulaOpCodeMapEntry>();
+ private final Map<String,FormulaOpCodeMapEntry> parserNames = new HashMap<String,FormulaOpCodeMapEntry>();
+ private final StringOpcodeMap[] groupOpCodes = new StringOpcodeMap[5];
+ private final List<FormulaOpCodeMapEntry> specialOpCodes = new ArrayList<FormulaOpCodeMapEntry>();
private int ownTokenCounter = 1000;
private final FormulaOpCodeMapEntry opCodePush;
private final FormulaParser parser;
@@ -134,7 +131,7 @@ public final class SOFormulaParser extends ComponentBase
{
ex.printStackTrace();
}
- opCodePush = (FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.PUSH);
+ opCodePush = specialOpCodes.get(FormulaMapGroupSpecialOffset.PUSH);
Thread.currentThread().setContextClassLoader(cl);
// use the last parameter of the PropertySetMixin constructor
// for your optional attributes if necessary. See the documentation
@@ -147,7 +144,7 @@ public final class SOFormulaParser extends ComponentBase
// com.sun.star.sheet.XFormulaParser:
public com.sun.star.sheet.FormulaToken[] parseFormula(String aFormula, com.sun.star.table.CellAddress aReferencePos)
{
- final ArrayList tokens = new ArrayList();
+ final ArrayList<FormulaToken> tokens = new ArrayList<FormulaToken>();
if (!"=".equals(aFormula))
{
String formula;
@@ -159,7 +156,7 @@ public final class SOFormulaParser extends ComponentBase
{
formula = aFormula;
}
- final ArrayList images = new ArrayList();
+ final ArrayList<String> images = new ArrayList<String>();
try
{
int brackets = 0;
@@ -180,12 +177,12 @@ public final class SOFormulaParser extends ComponentBase
{
--brackets;
}
- final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(upper);
+ final FormulaOpCodeMapEntry opCode = parserNames.get(upper);
formulaToken = opCode.Token;
}
else if (token.kind == GeneratedFormulaParserConstants.WHITESPACE)
{
- final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.SPACES);
+ final FormulaOpCodeMapEntry opCode = specialOpCodes.get(FormulaMapGroupSpecialOffset.SPACES);
formulaToken = opCode.Token;
}
else
@@ -200,7 +197,7 @@ public final class SOFormulaParser extends ComponentBase
}
if (brackets > 0)
{
- final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(")");
+ final FormulaOpCodeMapEntry opCode = parserNames.get(")");
while (brackets-- != 0)
{
formula = formula.concat(")");
@@ -225,7 +222,7 @@ public final class SOFormulaParser extends ComponentBase
if (found)
{
final FormulaToken dest = new FormulaToken();
- dest.OpCode = ((FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.BAD)).Token.OpCode;
+ dest.OpCode = specialOpCodes.get(FormulaMapGroupSpecialOffset.BAD).Token.OpCode;
dest.Data = new Any(Type.STRING, images.get(i));
tokens.remove(i);
tokens.add(i, dest);
@@ -239,7 +236,7 @@ public final class SOFormulaParser extends ComponentBase
{
}
}
- return (FormulaToken[]) tokens.toArray(new FormulaToken[tokens.size()]);
+ return tokens.toArray(new FormulaToken[tokens.size()]);
}
public String printFormula(com.sun.star.sheet.FormulaToken[] aTokens, com.sun.star.table.CellAddress aReferencePos)
@@ -254,7 +251,7 @@ public final class SOFormulaParser extends ComponentBase
}
else if (parserAllOpCodes.containsKey(formulaToken.OpCode))
{
- final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserAllOpCodes.get(formulaToken.OpCode);
+ final FormulaOpCodeMapEntry opCode = parserAllOpCodes.get(formulaToken.OpCode);
if (opCode.Name.length() > 0)
{
ret.append(opCode.Name);
@@ -307,7 +304,7 @@ public final class SOFormulaParser extends ComponentBase
// com.sun.star.report.meta.XFormulaParser:
public com.sun.star.sheet.FormulaOpCodeMapEntry[] getOpCodeMap()
{
- return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) m_OpCodeMap.toArray(new FormulaOpCodeMapEntry[m_OpCodeMap.size()]);
+ return m_OpCodeMap.toArray(new FormulaOpCodeMapEntry[m_OpCodeMap.size()]);
}
public void setOpCodeMap(com.sun.star.sheet.FormulaOpCodeMapEntry[] the_value)
@@ -364,7 +361,7 @@ public final class SOFormulaParser extends ComponentBase
private void addOpCodes(String[] names, FormulaOpCodeMapEntry[] opCodes, int group, boolean add)
{
- groupOpCodes[group] = new HashMap();
+ groupOpCodes[group] = new StringOpcodeMap();
for (int j = 0; j < names.length; j++)
{
FormulaOpCodeMapEntry opCode = null;
@@ -392,19 +389,19 @@ public final class SOFormulaParser extends ComponentBase
}
}
- public Map getNames()
+ public Map<String,FormulaOpCodeMapEntry> getNames()
{
return parserNames;
}
- public Map getGroup(int group)
+ public Map<Integer,FormulaOpCodeMapEntry> getGroup(int group)
{
return groupOpCodes[group];
}
private String[] getOperators(DefaultFormulaContext defaultContext, final String _kind)
{
- final ArrayList ops = new ArrayList();
+ final ArrayList<String> ops = new ArrayList<String>();
final Configuration configuration = defaultContext.getConfiguration();
final Iterator iter = configuration.findPropertyKeys(_kind);
while (iter.hasNext())
@@ -431,7 +428,12 @@ public final class SOFormulaParser extends ComponentBase
}
ops.add(token.trim());
}
- return (String[]) ops.toArray(new String[ops.size()]);
+ return ops.toArray(new String[ops.size()]);
+ }
+
+ public List<FormulaOpCodeMapEntry> getSpecialOpCodes()
+ {
+ return specialOpCodes;
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java
index 2d4fa9c0011a..e1046334f613 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java
@@ -53,7 +53,7 @@ public class StarReportDataFactory implements ReportDataFactory, Cloneable
{
try
{
- final HashMap map = new HashMap();
+ final HashMap<String, Object> map = new HashMap<String, Object>();
final int count = parameters.getColumnCount();
for (int i = 0; i < count; i++)
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java
index 03ceaa65a5e8..c54564436fb6 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java
@@ -83,12 +83,12 @@ public class ObjectOleLayoutController extends AbstractReportElementLayoutContro
ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.OBJECT_OLE);
ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "href", url);
ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "class-id", element.getClassid());
- final List masterfields = element.getMasterfields();
- final List values = new ArrayList();
+ final List<String> masterfields = element.getMasterfields();
+ final List<Object> values = new ArrayList<Object>();
final DataRow view = getFlowController().getMasterRow().getGlobalView();
- for (final Iterator iter = masterfields.iterator(); iter.hasNext();)
+ for (final Iterator<String> iter = masterfields.iterator(); iter.hasNext();)
{
- final String master = (String) iter.next();
+ final String master = iter.next();
try
{
final DataFlags flags = view.getFlags(master);
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java
index bd64f20ef339..ec780a8c2710 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java
@@ -75,7 +75,7 @@ public class OfficeTableTemplateLayoutController extends SectionLayoutController
super.initialize(section, flowController, parent);
final OfficeReport report = (OfficeReport) node;
- final ArrayList tables = new ArrayList();
+ final ArrayList<Node> tables = new ArrayList<Node>();
if (report.getPageHeader() != null)
{
addFromSection(tables, (Section) report.getPageHeader());
@@ -96,10 +96,10 @@ public class OfficeTableTemplateLayoutController extends SectionLayoutController
addFromSection(tables, (Section) report.getPageFooter());
}
- this.nodes = (Node[]) tables.toArray(new Node[tables.size()]);
+ this.nodes = tables.toArray(new Node[tables.size()]);
}
- private void addPBody(final List tables, final Section section)
+ private void addPBody(final List<Node> tables, final Section section)
{
if (section != null)
{
@@ -114,7 +114,7 @@ public class OfficeTableTemplateLayoutController extends SectionLayoutController
}
}
- private void addFromBody(final List tables, final Section section)
+ private void addFromBody(final List<Node> tables, final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
@@ -135,7 +135,7 @@ public class OfficeTableTemplateLayoutController extends SectionLayoutController
}
}
- private void addFromGroup(final List tables, final Section section)
+ private void addFromGroup(final List<Node> tables, final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
@@ -156,7 +156,7 @@ public class OfficeTableTemplateLayoutController extends SectionLayoutController
}
}
- private void addFromSection(final List tables, final Section section)
+ private void addFromSection(final List<Node> tables, final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java
index 6acd6d9494ab..29c7e239ad28 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java
@@ -40,7 +40,7 @@ public class VariablesCollection
private VariablesCollection parent;
private String namePrefix;
- private List variables;
+ private List<FormattedTextElement> variables;
public VariablesCollection(final String namePrefix)
{
@@ -56,7 +56,7 @@ public class VariablesCollection
this.namePrefix = namePrefix;
this.parent = parent;
- this.variables = new ArrayList();
+ this.variables = new ArrayList<FormattedTextElement>();
}
public VariablesCollection getParent()
@@ -78,7 +78,7 @@ public class VariablesCollection
public FormattedTextElement[] getVariables()
{
- return (FormattedTextElement[]) variables.toArray(new FormattedTextElement[variables.size()]);
+ return variables.toArray(new FormattedTextElement[variables.size()]);
}
public int getVariablesCount()
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
index 37723f832eb7..30385d01acfb 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
@@ -98,6 +98,7 @@ public class InputRepositoryLoader implements ResourceLoader
* @throws org.jfree.resourceloader.ResourceKeyCreationException
* if the key cannot be derived for any reason.
*/
+ @SuppressWarnings("unchecked")
public ResourceKey deriveKey(final ResourceKey parent,
final String path,
final Map factoryKeys)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java
index a3248a09e11a..22cd6ea1511d 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java
@@ -34,11 +34,11 @@ import org.jfree.report.structure.Element;
public class FontFaceDeclsSection extends Element
{
- private final Map fontFaces;
+ private final Map<String,FontFaceElement> fontFaces;
public FontFaceDeclsSection()
{
- fontFaces = new HashMap();
+ fontFaces = new HashMap<String,FontFaceElement>();
setType("font-face-decls");
setNamespace(OfficeNamespaces.OFFICE_NS);
}
@@ -50,12 +50,12 @@ public class FontFaceDeclsSection extends Element
public FontFaceElement getFontFace(final String name)
{
- return (FontFaceElement) fontFaces.get(name);
+ return fontFaces.get(name);
}
public FontFaceElement[] getAllFontFaces()
{
- return (FontFaceElement[]) fontFaces.values().toArray(new FontFaceElement[fontFaces.size()]);
+ return fontFaces.values().toArray(new FontFaceElement[fontFaces.size()]);
}
public boolean containsFont(final String fontName)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java
index eba65f11c712..0379c43cfd6f 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java
@@ -28,31 +28,31 @@ public class ObjectOleElement extends ReportElement
{
private String url;
- private final List masterfields;
- private final List detailfields;
+ private final List<String> masterfields;
+ private final List<String> detailfields;
private String classid;
+ public ObjectOleElement()
+ {
+ masterfields = new ArrayList<String>();
+ detailfields = new ArrayList<String>();
+ }
+
public String getClassid()
{
return classid;
}
- public List getDetailfields()
+ public List<String> getDetailfields()
{
return detailfields;
}
- public List getMasterfields()
+ public List<String> getMasterfields()
{
return masterfields;
}
- public ObjectOleElement()
- {
- masterfields = new ArrayList();
- detailfields = new ArrayList();
- }
-
public String getUrl()
{
return url;
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java
index 1305ed00cdfb..41b045d3c2d1 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java
@@ -39,12 +39,12 @@ import org.jfree.report.structure.Section;
public class OfficeMasterStyles extends Element
{
- private final Map masterPages;
+ private final Map<String,OfficeMasterPage> masterPages;
private final Section otherNodes;
public OfficeMasterStyles()
{
- masterPages = new HashMap();
+ masterPages = new HashMap<String,OfficeMasterPage>();
otherNodes = new Section();
}
@@ -59,12 +59,12 @@ public class OfficeMasterStyles extends Element
public OfficeMasterPage getMasterPage(final String name)
{
- return (OfficeMasterPage) masterPages.get(name);
+ return masterPages.get(name);
}
public OfficeMasterPage[] getAllMasterPages()
{
- return (OfficeMasterPage[]) masterPages.values().toArray(new OfficeMasterPage[masterPages.size()]);
+ return masterPages.values().toArray(new OfficeMasterPage[masterPages.size()]);
}
public Section getOtherNodes()
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java
index 2c6e6adb12f6..9d00b1ef9d2a 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java
@@ -96,22 +96,22 @@ public class OfficeStyles extends Element
return result;
}
}
- private final Map pageStyles;
- private final Map dataStyles;
- private final Map styles;
- private final List otherChildren;
+ private final Map<String,PageLayout> pageStyles;
+ private final Map<String,DataStyle> dataStyles;
+ private final Map<StyleKey,OfficeStyle> styles;
+ private final List<Element> otherChildren;
public OfficeStyles()
{
- this.styles = new HashMap();
- this.dataStyles = new HashMap();
- this.pageStyles = new HashMap();
- this.otherChildren = new ArrayList();
+ this.styles = new HashMap<StyleKey,OfficeStyle>();
+ this.dataStyles = new HashMap<String,DataStyle>();
+ this.pageStyles = new HashMap<String,PageLayout>();
+ this.otherChildren = new ArrayList<Element>();
}
public OfficeStyle getStyle(final String family, final String name)
{
- return (OfficeStyle) styles.get(new StyleKey(family, name));
+ return styles.get(new StyleKey(family, name));
}
public void addStyle(final OfficeStyle style)
@@ -139,7 +139,7 @@ public class OfficeStyles extends Element
public PageLayout getPageStyle(final String name)
{
- return (PageLayout) pageStyles.get(name);
+ return pageStyles.get(name);
}
public void addDataStyle(final DataStyle style)
@@ -149,7 +149,7 @@ public class OfficeStyles extends Element
public DataStyle getDataStyle(final String name)
{
- return (DataStyle) dataStyles.get(name);
+ return dataStyles.get(name);
}
public void addOtherNode(final Element node)
@@ -159,22 +159,22 @@ public class OfficeStyles extends Element
public DataStyle[] getAllDataStyles()
{
- return (DataStyle[]) dataStyles.values().toArray(new DataStyle[dataStyles.size()]);
+ return dataStyles.values().toArray(new DataStyle[dataStyles.size()]);
}
public PageLayout[] getAllPageStyles()
{
- return (PageLayout[]) pageStyles.values().toArray(new PageLayout[pageStyles.size()]);
+ return pageStyles.values().toArray(new PageLayout[pageStyles.size()]);
}
public OfficeStyle[] getAllStyles()
{
- return (OfficeStyle[]) styles.values().toArray(new OfficeStyle[styles.size()]);
+ return styles.values().toArray(new OfficeStyle[styles.size()]);
}
public Element[] getOtherStyles()
{
- return (Element[]) otherChildren.toArray(new Element[otherChildren.size()]);
+ return otherChildren.toArray(new Element[otherChildren.size()]);
}
public boolean containsStyle(final String family, final String name)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java
index 24926845e61a..9f707ebb801f 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java
@@ -36,11 +36,11 @@ import org.jfree.report.structure.Element;
public abstract class ReportElement extends Element
{
- private final List formatConditions;
+ private final List<FormatCondition> formatConditions;
protected ReportElement()
{
- formatConditions = new ArrayList();
+ formatConditions = new ArrayList<FormatCondition>();
}
/**
@@ -91,7 +91,7 @@ public abstract class ReportElement extends Element
public FormatCondition[] getFormatConditions()
{
- return (FormatCondition[]) this.formatConditions.toArray(new FormatCondition[this.formatConditions.size()]);
+ return this.formatConditions.toArray(new FormatCondition[this.formatConditions.size()]);
}
public int getFormatConditionCount()
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java
index 24dc47a2538a..9e08814fea1f 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java
@@ -152,7 +152,7 @@ public class ImageProducer
return hashValue;
}
}
- private final Map imageCache;
+ private final Map<Object,OfficeImage> imageCache;
private final InputRepository inputRepository;
private final OutputRepository outputRepository;
private final ImageService imageService;
@@ -177,7 +177,7 @@ public class ImageProducer
this.inputRepository = inputRepository;
this.outputRepository = outputRepository;
this.imageService = imageService;
- this.imageCache = new HashMap();
+ this.imageCache = new HashMap<Object,OfficeImage>();
}
/**
@@ -262,7 +262,7 @@ public class ImageProducer
private OfficeImage produceFromByteArray(final byte[] data)
{
final ByteDataImageKey imageKey = new ByteDataImageKey(data);
- final OfficeImage o = (OfficeImage) imageCache.get(imageKey);
+ final OfficeImage o = imageCache.get(imageKey);
if (o != null)
{
return o;
@@ -321,7 +321,7 @@ public class ImageProducer
// ignore .. but we had to try this ..
}
- final OfficeImage o = (OfficeImage) imageCache.get(source);
+ final OfficeImage o = imageCache.get(source);
if (o != null)
{
return o;
@@ -399,7 +399,7 @@ public class ImageProducer
{
Logger.getLogger(ImageProducer.class.getName()).log(Level.SEVERE, null, ex);
}
- final OfficeImage o = (OfficeImage) imageCache.get(uri);
+ final OfficeImage o = imageCache.get(uri);
if (o != null)
{
return o;
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java
index 5bf18367fa26..8991c2bbb281 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java
@@ -76,7 +76,7 @@ public class StyleUtilities
throws ReportProcessingException
{
copyStyle(styleFamily, styleName, stylesCollection,
- commonCollection, predefCollection, new HashSet());
+ commonCollection, predefCollection, new HashSet<String>());
}
/**
@@ -100,7 +100,7 @@ public class StyleUtilities
final OfficeStylesCollection stylesCollection,
final OfficeStylesCollection commonCollection,
final OfficeStylesCollection predefCollection,
- final Set inheritanceTracker)
+ final Set<String> inheritanceTracker)
throws ReportProcessingException
{
if (inheritanceTracker.contains(styleName))
@@ -159,7 +159,7 @@ public class StyleUtilities
final OfficeStylesCollection commonCollection,
final OfficeStylesCollection predefCollection,
final String styleFamily,
- final Set inheritanceTracker)
+ final Set<String> inheritanceTracker)
throws ReportProcessingException
{
try
@@ -473,7 +473,7 @@ public class StyleUtilities
{
copyStyleInternal(commonStyle, commonStyles,
commonCollection, commonCollection, predefCollection,
- styleFamily, new HashSet());
+ styleFamily, new HashSet<String>());
}
return autostyle;
}
@@ -518,7 +518,7 @@ public class StyleUtilities
final String propertyName)
{
return queryStyle(predefCollection, styleFamily,
- styleName, sectionName, propertyNamespace, propertyName, new HashSet());
+ styleName, sectionName, propertyNamespace, propertyName, new HashSet<String>());
}
public static OfficeStyle queryStyleByProperties(final OfficeStylesCollection predefCollection,
@@ -573,7 +573,7 @@ public class StyleUtilities
final String sectionName,
final String propertyNamespace,
final String propertyName,
- final Set seenStyles)
+ final Set<String> seenStyles)
{
if (seenStyles.contains(styleName))
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java
index 941d6cb4839f..31217420d621 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java
@@ -182,7 +182,7 @@ public class StylesWriter
{
xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "font-face-decls", XmlWriterSupport.OPEN);
- final TreeMap fontFaces = new TreeMap();
+ final TreeMap<String,FontFaceElement> fontFaces = new TreeMap<String,FontFaceElement>();
for (int sci = 0; sci < osc.length; sci++)
{
final OfficeStylesCollection collection = osc[sci];
@@ -195,10 +195,10 @@ public class StylesWriter
}
}
- final Iterator values = fontFaces.values().iterator();
+ final Iterator<FontFaceElement> values = fontFaces.values().iterator();
while (values.hasNext())
{
- final FontFaceElement element = (FontFaceElement) values.next();
+ final FontFaceElement element = values.next();
writeElement(element);
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
index 2b8c88ba045d..878afc4755ed 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
@@ -91,15 +91,15 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
* for creating this class was to be able to record the boundaries for each incoming table while consuming as few
* objects/memory as possible.
*/
- private static class ColumnBoundary implements Comparable
+ private static class ColumnBoundary implements Comparable<ColumnBoundary>
{
- private final Set tableIndices;
+ private final Set<Integer> tableIndices;
private final long boundary;
private ColumnBoundary(final long boundary)
{
- this.tableIndices = new HashSet();
+ this.tableIndices = new HashSet<Integer>();
this.boundary = boundary;
}
@@ -119,7 +119,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
return tableIndices.contains(index);
}
- public int compareTo(final Object arg0)
+ public int compareTo(final ColumnBoundary arg0)
{
if (arg0.equals(this))
{
@@ -127,7 +127,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
}
if (arg0 instanceof ColumnBoundary)
{
- if (boundary > ((ColumnBoundary) arg0).boundary)
+ if (boundary > arg0.boundary)
{
return 1;
}
@@ -154,7 +154,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[0];
private boolean elementBoundaryCollectionPass;
private boolean oleHandled;
- private final List columnBoundaryList;
+ private final List<ColumnBoundary> columnBoundaryList;
private long currentRowBoundaryMarker;
private ColumnBoundary[] sortedBoundaryArray;
private ColumnBoundary[] boundariesForTableArray;
@@ -163,9 +163,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
private int columnSpanCounter;
private int currentSpan = 0;
private String unitsOfMeasure;
- final private List shapes;
- final private List ole;
- final private List rowHeights;
+ final private List<AttributeMap> shapes;
+ final private List<AttributeMap> ole;
+ final private List<CSSNumericValue> rowHeights;
public SpreadsheetRawReportTarget(final ReportJob reportJob,
final ResourceManager resourceManager,
@@ -178,11 +178,11 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
throws ReportProcessingException
{
super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService, dataSourceFactory);
- columnBoundaryList = new ArrayList();
+ columnBoundaryList = new ArrayList<ColumnBoundary>();
elementBoundaryCollectionPass = true;
- rowHeights = new ArrayList();
- shapes = new ArrayList();
- ole = new ArrayList();
+ rowHeights = new ArrayList<CSSNumericValue>();
+ shapes = new ArrayList<AttributeMap>();
+ ole = new ArrayList<AttributeMap>();
oleHandled = false;
}
@@ -217,8 +217,8 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
final LengthCalculator len = new LengthCalculator();
for (int i = 0; i < rowHeights.size(); i++)
{
- len.add((CSSNumericValue) rowHeights.get(i));
- // val += ((CSSNumericValue)rowHeights.get(i)).getValue();
+ len.add(rowHeights.get(i));
+ // val += (rowHeights.get(i)).getValue();
}
rowHeights.clear();
@@ -513,7 +513,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
final float val = Float.parseFloat(widthStr) * CELL_WIDTH_FACTOR;
addColumnWidthToRowBoundaryMarker((long) val);
ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker());
- final List columnBoundaryList_ = getColumnBoundaryList();
+ final List<ColumnBoundary> columnBoundaryList_ = getColumnBoundaryList();
final int idx = columnBoundaryList_.indexOf(currentRowBoundary);
if (idx == -1)
{
@@ -521,7 +521,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
}
else
{
- currentRowBoundary = (ColumnBoundary) columnBoundaryList_.get(idx);
+ currentRowBoundary = columnBoundaryList_.get(idx);
}
currentRowBoundary.addTableIndex(tableCounter);
}
@@ -569,11 +569,11 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
for (int i = 0; i < shapes.size(); i++)
{
- final AttributeMap attrs = (AttributeMap) shapes.get(i);
+ final AttributeMap attrs = shapes.get(i);
final AttributeList attrList = buildAttributeList(attrs);
attrList.removeAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME);
xmlWriter.writeTag(OfficeNamespaces.DRAWING_NS, OfficeToken.FRAME, attrList, XmlWriterSupport.OPEN);
- startChartProcessing((AttributeMap) ole.get(i));
+ startChartProcessing(ole.get(i));
xmlWriter.writeCloseTag();
}
@@ -854,13 +854,13 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
if (sortedBoundaryArray == null)
{
getColumnBoundaryList().add(new ColumnBoundary(0));
- sortedBoundaryArray = (ColumnBoundary[]) getColumnBoundaryList().toArray(new ColumnBoundary[getColumnBoundaryList().size()]);
+ sortedBoundaryArray = getColumnBoundaryList().toArray(new ColumnBoundary[getColumnBoundaryList().size()]);
Arrays.sort(sortedBoundaryArray);
}
return sortedBoundaryArray;
}
- private List getColumnBoundaryList()
+ private List<ColumnBoundary> getColumnBoundaryList()
{
return columnBoundaryList;
}
@@ -889,17 +889,17 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
{
if (boundariesForTableArray == null)
{
- final List boundariesForTable = new ArrayList();
- final List boundaryList = getColumnBoundaryList();
+ final List<ColumnBoundary> boundariesForTable = new ArrayList<ColumnBoundary>();
+ final List<ColumnBoundary> boundaryList = getColumnBoundaryList();
for (int i = 0; i < boundaryList.size(); i++)
{
- final ColumnBoundary b = (ColumnBoundary) boundaryList.get(i);
+ final ColumnBoundary b = boundaryList.get(i);
if (b.isContainedByTable(table))
{
boundariesForTable.add(b);
}
}
- boundariesForTableArray = (ColumnBoundary[]) boundariesForTable.toArray(new ColumnBoundary[boundariesForTable.size()]);
+ boundariesForTableArray = boundariesForTable.toArray(new ColumnBoundary[boundariesForTable.size()]);
Arrays.sort(boundariesForTableArray);
}
return boundariesForTableArray;
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java
index e9c997dd9504..af9dc9d2519b 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java
@@ -186,16 +186,16 @@ public class MasterPageFactory
private static final String DEFAULT_PAGE_NAME = "Default";
private final OfficeMasterStyles predefinedStyles;
private final AttributeNameGenerator masterPageNameGenerator;
- private final Map masterPages;
+ private final Map<MasterPageFactoryKey,OfficeMasterPage> masterPages;
private final AttributeNameGenerator pageLayoutNameGenerator;
- private final Map pageLayouts;
+ private final Map<PageLayoutKey,String> pageLayouts;
public MasterPageFactory(final OfficeMasterStyles predefinedStyles)
{
this.predefinedStyles = predefinedStyles;
- this.masterPages = new HashMap();
+ this.masterPages = new HashMap<MasterPageFactoryKey,OfficeMasterPage>();
this.masterPageNameGenerator = new AttributeNameGenerator();
- this.pageLayouts = new HashMap();
+ this.pageLayouts = new HashMap<PageLayoutKey,String>();
this.pageLayoutNameGenerator = new AttributeNameGenerator();
}
@@ -205,7 +205,7 @@ public class MasterPageFactory
{
final MasterPageFactoryKey key =
new MasterPageFactoryKey(template, pageHeader, pageFooter);
- return (OfficeMasterPage) masterPages.get(key);
+ return masterPages.get(key);
}
public boolean containsMasterPage(final String template,
@@ -223,7 +223,7 @@ public class MasterPageFactory
{
final MasterPageFactoryKey key =
new MasterPageFactoryKey(template, pageHeader, pageFooter);
- final OfficeMasterPage cached = (OfficeMasterPage) masterPages.get(key);
+ final OfficeMasterPage cached = masterPages.get(key);
if (cached != null)
{
return cached;
@@ -336,7 +336,7 @@ public class MasterPageFactory
final PageLayoutKey key =
new PageLayoutKey(pageStyleTemplate, headerHeight, footerHeight);
- final String pageLayoutName = (String) pageLayouts.get(key);
+ final String pageLayoutName = pageLayouts.get(key);
if (pageLayoutName != null)
{
// there's already a suitable version included.
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
index d802da95d256..9cfa3dccceae 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
@@ -629,9 +629,9 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget
if (styleName == null)
{
final boolean keep = (keepTogetherState == PageContext.KEEP_TOGETHER_GROUP || expectedTableRowCount > 0) && isParentKeepTogether();
- final ArrayList propertyNameSpaces = new ArrayList();
- final ArrayList propertyNames = new ArrayList();
- final ArrayList propertyValues = new ArrayList();
+ final ArrayList<String> propertyNameSpaces = new ArrayList<String>();
+ final ArrayList<String> propertyNames = new ArrayList<String>();
+ final ArrayList<String> propertyValues = new ArrayList<String>();
propertyNameSpaces.add(OfficeNamespaces.FO_NS);
propertyNameSpaces.add(OfficeNamespaces.FO_NS);
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java
index b29a8283da89..eb967b8b99cb 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java
@@ -36,25 +36,25 @@ public class VariablesDeclarations
{
private final AttributeNameGenerator nameGenerator;
- private final Map variables;
+ private final Map<String, HashMap<String,String> > variables;
public VariablesDeclarations()
{
- variables = new HashMap();
+ variables = new HashMap<String, HashMap<String,String> >();
nameGenerator = new AttributeNameGenerator();
}
public String produceVariable(final String name,
final String type)
{
- HashMap holder = (HashMap) variables.get(name);
+ HashMap<String,String> holder = variables.get(name);
if (holder == null)
{
- holder = new HashMap();
+ holder = new HashMap<String,String>();
variables.put(name, holder);
}
- final String mapping = (String) holder.get(type);
+ final String mapping = holder.get(type);
if (mapping != null)
{
return mapping;
@@ -75,21 +75,21 @@ public class VariablesDeclarations
return result;
}
- public Map getDefinedMappings()
+ public Map<String,String> getDefinedMappings()
{
- final HashMap mappings = new HashMap();
- final Iterator vars = variables.values().iterator();
+ final HashMap<String,String> mappings = new HashMap<String,String>();
+ final Iterator<HashMap<String,String>> vars = variables.values().iterator();
while (vars.hasNext())
{
- final HashMap types = (HashMap) vars.next();
- final Iterator varsByType = types.entrySet().iterator();
+ final HashMap<String,String> types = vars.next();
+ final Iterator<Map.Entry<String,String>> varsByType = types.entrySet().iterator();
while (varsByType.hasNext())
{
- final Map.Entry entry = (Map.Entry) varsByType.next();
- final String type = (String) entry.getKey();
+ final Map.Entry<String,String> entry = varsByType.next();
+ final String type = entry.getKey();
if (type != null)
{
- final String varName = (String) entry.getValue();
+ final String varName = entry.getValue();
mappings.put(varName, type);
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java
index 7a6daab1843c..287eaca2dfc3 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java
@@ -107,9 +107,9 @@ public class OfficeParserUtil
return props.getProperty("style-family." + styleFamily);
}
- public Map getNamespaces()
+ public Map<String,String> getNamespaces()
{
- final Map map = new HashMap();
+ final Map<String,String> map = new HashMap<String,String>();
final Iterator keys = props.findPropertyKeys(NAMESPACES_PREFIX);
while (keys.hasNext())
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java
index 2afa4395d5bd..c739e10bf420 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java
@@ -45,13 +45,13 @@ public class ChartReadHandler extends ElementReadHandler
{
private final Section element;
- private final List children;
+ private final List<ElementReadHandler> children;
private final ReportReadHandler reportHandler;
public ChartReadHandler(ReportReadHandler reportHandler)
{
this.reportHandler = reportHandler;
- children = new ArrayList();
+ children = new ArrayList<ElementReadHandler>();
element = new Section();
}
@@ -92,9 +92,8 @@ public class ChartReadHandler extends ElementReadHandler
*/
protected void doneParsing() throws SAXException
{
- for (Object aChildren : children)
+ for (ElementReadHandler handler : children)
{
- final ElementReadHandler handler = (ElementReadHandler) aChildren;
element.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java
index 165a1f59f25b..40aee6391296 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java
@@ -37,14 +37,14 @@ public class DataStyleReadHandler extends ElementReadHandler
{
private final DataStyle dataStyle;
- private final List children;
+ private final List<Object> children;
private final boolean hasCData;
public DataStyleReadHandler(final boolean hasCData)
{
this.hasCData = hasCData;
this.dataStyle = new DataStyle();
- this.children = new ArrayList();
+ this.children = new ArrayList<Object>();
}
/**
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java
index d7d655d40cfe..fec6fa6b484a 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java
@@ -45,12 +45,12 @@ public class FontFaceDeclsReadHandler extends ElementReadHandler
{
private final FontFaceDeclsSection fontFaceDecls;
- private final List fontFaceReadHandlers;
+ private final List<FontFaceReadHandler> fontFaceReadHandlers;
public FontFaceDeclsReadHandler(final FontFaceDeclsSection fontFaceDecls)
{
this.fontFaceDecls = fontFaceDecls;
- this.fontFaceReadHandlers = new ArrayList();
+ this.fontFaceReadHandlers = new ArrayList<FontFaceReadHandler>();
}
public FontFaceDeclsSection getFontFaceDecls()
@@ -96,7 +96,7 @@ public class FontFaceDeclsReadHandler extends ElementReadHandler
{
for (int i = 0; i < fontFaceReadHandlers.size(); i++)
{
- final FontFaceReadHandler handler = (FontFaceReadHandler) fontFaceReadHandlers.get(i);
+ final FontFaceReadHandler handler = fontFaceReadHandlers.get(i);
fontFaceDecls.addFontFace((FontFaceElement) handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java
index 4fa217dd633a..1306b5567c74 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java
@@ -44,14 +44,14 @@ public class MasterStylesReadHandler extends ElementReadHandler
{
private final OfficeMasterStyles masterStyles;
- private final List otherHandlers;
- private final List masterPageHandlers;
+ private final List<ElementReadHandler> otherHandlers;
+ private final List<MasterPageReadHandler> masterPageHandlers;
public MasterStylesReadHandler(final OfficeMasterStyles masterStyles)
{
this.masterStyles = masterStyles;
- this.masterPageHandlers = new ArrayList();
- this.otherHandlers = new ArrayList();
+ this.masterPageHandlers = new ArrayList<MasterPageReadHandler>();
+ this.otherHandlers = new ArrayList<ElementReadHandler>();
}
public OfficeMasterStyles getMasterStyles()
@@ -96,15 +96,13 @@ public class MasterStylesReadHandler extends ElementReadHandler
{
for (int i = 0; i < otherHandlers.size(); i++)
{
- final ElementReadHandler handler =
- (ElementReadHandler) otherHandlers.get(i);
+ final ElementReadHandler handler = otherHandlers.get(i);
masterStyles.getOtherNodes().addNode(handler.getElement());
}
for (int i = 0; i < masterPageHandlers.size(); i++)
{
- final MasterPageReadHandler handler =
- (MasterPageReadHandler) masterPageHandlers.get(i);
+ final MasterPageReadHandler handler = masterPageHandlers.get(i);
masterStyles.addMasterPage(handler.getMasterPage());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java
index 3a5ec73bcc11..61ce6bb16649 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java
@@ -46,7 +46,7 @@ public class GroupReadHandler extends ElementReadHandler
private RootTableReadHandler detailSection;
private final OfficeGroup group;
private final OfficeGroupInstanceSection groupInstanceSection;
- private final List functionHandlers;
+ private final List<FunctionReadHandler> functionHandlers;
private final ReportReadHandler rh;
public GroupReadHandler(final ReportReadHandler _rh)
@@ -57,7 +57,7 @@ public class GroupReadHandler extends ElementReadHandler
groupInstanceSection.setNamespace(JFreeReportInfo.REPORT_NAMESPACE);
groupInstanceSection.setType("group-instance");
group.addNode(groupInstanceSection);
- functionHandlers = new ArrayList();
+ functionHandlers = new ArrayList<FunctionReadHandler>();
}
/**
@@ -136,8 +136,7 @@ public class GroupReadHandler extends ElementReadHandler
{
for (int i = 0; i < functionHandlers.size(); i++)
{
- final FunctionReadHandler handler =
- (FunctionReadHandler) functionHandlers.get(i);
+ final FunctionReadHandler handler = functionHandlers.get(i);
groupInstanceSection.addExpression(handler.getExpression());
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java
index eaf3bcd8259b..5e7821a13a0a 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java
@@ -43,30 +43,20 @@ public class ReportReadHandler extends ElementReadHandler
private RootTableReadHandler reportHeader;
private RootTableReadHandler reportFooter;
private RootTableReadHandler detail;
-
- public void setDetail(final RootTableReadHandler detail)
- {
- this.detail = detail;
- }
-
- public final RootTableReadHandler getDetail()
- {
- return detail;
- }
private GroupReadHandler groups;
private final OfficeReport rootSection;
- private final List functionHandlers;
- private final List preBodyHandlers;
- private final List postBodyHandlers;
+ private final List<FunctionReadHandler> functionHandlers;
+ private final List<ElementReadHandler> preBodyHandlers;
+ private final List<ElementReadHandler> postBodyHandlers;
private boolean pre = true;
public ReportReadHandler()
{
rootSection = new OfficeReport();
rootSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "simple-report-structure", Boolean.TRUE);
- functionHandlers = new ArrayList();
- preBodyHandlers = new ArrayList();
- postBodyHandlers = new ArrayList();
+ functionHandlers = new ArrayList<FunctionReadHandler>();
+ preBodyHandlers = new ArrayList<ElementReadHandler>();
+ postBodyHandlers = new ArrayList<ElementReadHandler>();
}
/**
@@ -85,22 +75,24 @@ public class ReportReadHandler extends ElementReadHandler
final XmlReadHandler erh;
if (OfficeNamespaces.CHART_NS.equals(uri))
{
- erh = new ChartReadHandler(this);
+ ChartReadHandler crh = new ChartReadHandler(this);
if (pre)
{
- preBodyHandlers.add(erh);
+ preBodyHandlers.add(crh);
}
else
{
- postBodyHandlers.add(erh);
+ postBodyHandlers.add(crh);
}
+ erh = crh;
}
else if (OfficeNamespaces.OOREPORT_NS.equals(uri))
{
if ("function".equals(tagName))
{
- erh = new FunctionReadHandler();
- functionHandlers.add(erh);
+ FunctionReadHandler frh = new FunctionReadHandler();
+ functionHandlers.add(frh);
+ erh = frh;
}
else if ("page-header".equals(tagName))
{
@@ -199,8 +191,7 @@ public class ReportReadHandler extends ElementReadHandler
for (int i = 0; i < functionHandlers.size(); i++)
{
- final FunctionReadHandler handler =
- (FunctionReadHandler) functionHandlers.get(i);
+ final FunctionReadHandler handler = functionHandlers.get(i);
rootSection.addExpression(handler.getExpression());
}
}
@@ -210,7 +201,7 @@ public class ReportReadHandler extends ElementReadHandler
return rootSection;
}
- private final Section createSection(final String name, final List handler)
+ private final Section createSection(final String name, final List<ElementReadHandler> handler)
{
if (!handler.isEmpty())
{
@@ -220,11 +211,22 @@ public class ReportReadHandler extends ElementReadHandler
for (int i = 0; i < handler.size(); i++)
{
- final ElementReadHandler erh = (ElementReadHandler) handler.get(i);
+ final ElementReadHandler erh = handler.get(i);
section.addNode(erh.getElement());
}
return section;
}
return null;
}
+
+ public void setDetail(final RootTableReadHandler detail)
+ {
+ this.detail = detail;
+ }
+
+ public final RootTableReadHandler getDetail()
+ {
+ return detail;
+ }
+
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java
index 30be569e8b1d..e923621bb5cc 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java
@@ -41,12 +41,12 @@ public class MasterPageReadHandler extends ElementReadHandler
{
private final OfficeMasterPage masterPage;
- private final List otherHandlers;
+ private final List<ElementReadHandler> otherHandlers;
public MasterPageReadHandler()
{
masterPage = new OfficeMasterPage();
- this.otherHandlers = new ArrayList();
+ this.otherHandlers = new ArrayList<ElementReadHandler>();
}
public OfficeMasterPage getMasterPage()
@@ -84,8 +84,7 @@ public class MasterPageReadHandler extends ElementReadHandler
{
for (int i = 0; i < otherHandlers.size(); i++)
{
- final ElementReadHandler handler =
- (ElementReadHandler) otherHandlers.get(i);
+ final ElementReadHandler handler = otherHandlers.get(i);
masterPage.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java
index 078b4a1dd9ff..cbfcc112f8ea 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java
@@ -39,12 +39,12 @@ public class OfficeStyleReadHandler extends ElementReadHandler
{
private final OfficeStyle officeStyle;
- private final List children;
+ private final List<ElementReadHandler> children;
public OfficeStyleReadHandler()
{
this.officeStyle = new OfficeStyle();
- this.children = new ArrayList();
+ this.children = new ArrayList<ElementReadHandler>();
}
/**
@@ -79,7 +79,7 @@ public class OfficeStyleReadHandler extends ElementReadHandler
{
for (int i = 0; i < children.size(); i++)
{
- final ElementReadHandler handler = (ElementReadHandler) children.get(i);
+ final ElementReadHandler handler = children.get(i);
officeStyle.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java
index be7a4242bbad..37a3e8cccc1b 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java
@@ -36,19 +36,19 @@ import org.xml.sax.SAXException;
public class OfficeStylesReadHandler extends ElementReadHandler
{
- private final List textStyleChildren;
- private final List dataStyleChildren;
- private final List otherStyleChildren;
- private final List pageLayoutChildren;
+ private final List<OfficeStyleReadHandler> textStyleChildren;
+ private final List<DataStyleReadHandler> dataStyleChildren;
+ private final List<SectionReadHandler> otherStyleChildren;
+ private final List<PageLayoutReadHandler> pageLayoutChildren;
private final OfficeStyles officeStyles;
public OfficeStylesReadHandler(final OfficeStyles officeStyles)
{
this.officeStyles = officeStyles;
- this.pageLayoutChildren = new ArrayList();
- this.dataStyleChildren = new ArrayList();
- this.textStyleChildren = new ArrayList();
- this.otherStyleChildren = new ArrayList();
+ this.pageLayoutChildren = new ArrayList<PageLayoutReadHandler>();
+ this.dataStyleChildren = new ArrayList<DataStyleReadHandler>();
+ this.textStyleChildren = new ArrayList<OfficeStyleReadHandler>();
+ this.otherStyleChildren = new ArrayList<SectionReadHandler>();
}
/**
@@ -100,29 +100,25 @@ public class OfficeStylesReadHandler extends ElementReadHandler
{
for (int i = 0; i < textStyleChildren.size(); i++)
{
- final OfficeStyleReadHandler handler =
- (OfficeStyleReadHandler) textStyleChildren.get(i);
+ final OfficeStyleReadHandler handler = textStyleChildren.get(i);
officeStyles.addStyle(handler.getOfficeStyle());
}
for (int i = 0; i < pageLayoutChildren.size(); i++)
{
- final PageLayoutReadHandler handler =
- (PageLayoutReadHandler) pageLayoutChildren.get(i);
+ final PageLayoutReadHandler handler = pageLayoutChildren.get(i);
officeStyles.addPageStyle(handler.getPageLayout());
}
for (int i = 0; i < dataStyleChildren.size(); i++)
{
- final DataStyleReadHandler handler =
- (DataStyleReadHandler) dataStyleChildren.get(i);
+ final DataStyleReadHandler handler = dataStyleChildren.get(i);
officeStyles.addDataStyle(handler.getDataStyle());
}
for (int i = 0; i < otherStyleChildren.size(); i++)
{
- final SectionReadHandler handler =
- (SectionReadHandler) otherStyleChildren.get(i);
+ final SectionReadHandler handler = otherStyleChildren.get(i);
officeStyles.addOtherNode((Element) handler.getNode());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java
index 787ced08851d..495e39e3c8e5 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java
@@ -41,12 +41,12 @@ public class PageLayoutReadHandler extends ElementReadHandler
{
private final PageLayout pageLayout;
- private final List children;
+ private final List<ElementReadHandler> children;
public PageLayoutReadHandler()
{
this.pageLayout = new PageLayout();
- this.children = new ArrayList();
+ this.children = new ArrayList<ElementReadHandler>();
}
/**
@@ -78,7 +78,7 @@ public class PageLayoutReadHandler extends ElementReadHandler
{
for (int i = 0; i < children.size(); i++)
{
- final ElementReadHandler handler = (ElementReadHandler) children.get(i);
+ final ElementReadHandler handler = children.get(i);
pageLayout.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java
index b8dc439c79ef..2961068908af 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java
@@ -40,12 +40,12 @@ public class StyleDefinitionReadHandler extends ElementReadHandler
{
private final Section rawSection;
- private final List children;
+ private final List<ElementReadHandler> children;
public StyleDefinitionReadHandler()
{
this.rawSection = new Section();
- this.children = new ArrayList();
+ this.children = new ArrayList<ElementReadHandler>();
}
/**
@@ -78,7 +78,7 @@ public class StyleDefinitionReadHandler extends ElementReadHandler
{
for (int i = 0; i < children.size(); i++)
{
- final ElementReadHandler handler = (ElementReadHandler) children.get(i);
+ final ElementReadHandler handler = children.get(i);
rawSection.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java
index 97991f9c7193..e2c292bdf38d 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java
@@ -31,12 +31,12 @@ public abstract class OneOfConstantsMapper implements StyleMapper
{
private final StyleKey styleKey;
- private final Map mappings;
+ private final Map<String, CSSValue> mappings;
protected OneOfConstantsMapper(final StyleKey styleKey)
{
this.styleKey = styleKey;
- this.mappings = new HashMap();
+ this.mappings = new HashMap<String, CSSValue>();
}
public void addMapping(final String value, final CSSValue target)
@@ -63,6 +63,6 @@ public abstract class OneOfConstantsMapper implements StyleMapper
protected CSSValue lookupMapping(final String attrValue)
{
- return (CSSValue) mappings.get(attrValue);
+ return mappings.get(attrValue);
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java
index 182075d8cc62..577cfeaf6730 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java
@@ -41,12 +41,12 @@ import org.xml.sax.SAXException;
public class TableColumnsReadHandler extends ElementReadHandler
{
- private final List columns;
+ private final List<TableColumnReadHandler> columns;
private final Section tableColumns;
public TableColumnsReadHandler()
{
- columns = new ArrayList();
+ columns = new ArrayList<TableColumnReadHandler>();
tableColumns = new Section();
}
@@ -82,7 +82,7 @@ public class TableColumnsReadHandler extends ElementReadHandler
{
for (int i = 0; i < columns.size(); i++)
{
- final TableColumnReadHandler handler = (TableColumnReadHandler) columns.get(i);
+ final TableColumnReadHandler handler = columns.get(i);
tableColumns.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java
index 1addcf51bbd2..154a8f55b70c 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java
@@ -43,12 +43,12 @@ import org.xml.sax.SAXException;
public class TableReadHandler extends ElementReadHandler
{
- private final List children;
+ private final List<ElementReadHandler> children;
private final Section table;
public TableReadHandler()
{
- children = new ArrayList();
+ children = new ArrayList<ElementReadHandler>();
table = new OfficeTableSection();
}
@@ -124,7 +124,7 @@ public class TableReadHandler extends ElementReadHandler
{
for (int i = 0; i < children.size(); i++)
{
- final ElementReadHandler handler = (ElementReadHandler) children.get(i);
+ final ElementReadHandler handler = children.get(i);
table.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java
index d189f2248d0e..aad6a08ab8e3 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java
@@ -41,12 +41,12 @@ import org.xml.sax.SAXException;
public class TableRowReadHandler extends ElementReadHandler
{
- private final List tableCells;
+ private final List<ElementReadHandler> tableCells;
private final Section tableRow;
public TableRowReadHandler()
{
- tableCells = new ArrayList();
+ tableCells = new ArrayList<ElementReadHandler>();
tableRow = new Section();
}
@@ -63,7 +63,7 @@ public class TableRowReadHandler extends ElementReadHandler
final Attributes atts)
throws SAXException
{
- final XmlReadHandler rh;
+ final ElementReadHandler rh;
if (OfficeNamespaces.TABLE_NS.equals(uri))
{
if (OfficeToken.TABLE_CELL.equals(tagName))
@@ -99,7 +99,7 @@ public class TableRowReadHandler extends ElementReadHandler
{
for (int i = 0; i < tableCells.size(); i++)
{
- final ElementReadHandler handler = (ElementReadHandler) tableCells.get(i);
+ final ElementReadHandler handler = tableCells.get(i);
tableRow.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java
index 22fd7ac2a1fd..92ef31a0b560 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java
@@ -40,12 +40,12 @@ import org.xml.sax.SAXException;
public class TableRowsReadHandler extends ElementReadHandler
{
- private final List rows;
+ private final List<TableRowReadHandler> rows;
private final Section tableRows;
public TableRowsReadHandler()
{
- rows = new ArrayList();
+ rows = new ArrayList<TableRowReadHandler>();
tableRows = new Section();
}
@@ -81,7 +81,7 @@ public class TableRowsReadHandler extends ElementReadHandler
{
for (int i = 0; i < rows.size(); i++)
{
- final TableRowReadHandler handler = (TableRowReadHandler) rows.get(i);
+ final TableRowReadHandler handler = rows.get(i);
tableRows.addNode(handler.getElement());
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java
index 3db34cca2813..15dbc4eed444 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java
@@ -49,13 +49,13 @@ public class NoCDATATextContentReadHandler extends ElementReadHandler
{
private Section section;
- private List children;
+ private List<Object> children;
private boolean copyType;
public NoCDATATextContentReadHandler(final Section section,
final boolean copyType)
{
- this.children = new ArrayList();
+ this.children = new ArrayList<Object>();
this.section = section;
this.copyType = copyType;
}
@@ -149,7 +149,7 @@ public class NoCDATATextContentReadHandler extends ElementReadHandler
}
}
- public List getChildren()
+ public List<Object> getChildren()
{
return children;
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java
index 2728fe0c4bf3..3edca3ca52ae 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java
@@ -42,11 +42,11 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceManager;
public class StyleMapper
{
- private final Map backend;
+ private final Map<StyleMapperKey,StyleMappingRule> backend;
public StyleMapper()
{
- this.backend = new HashMap();
+ this.backend = new HashMap<StyleMapperKey,StyleMappingRule>();
}
public void addMapping(final StyleMappingRule rule)
@@ -60,7 +60,7 @@ public class StyleMapper
final String attributeName)
{
final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementTagName, attributeNamespace, attributeName);
- final StyleMappingRule rule = (StyleMappingRule) backend.get(key);
+ final StyleMappingRule rule = backend.get(key);
return rule != null && rule.isListOfValues();
}
@@ -70,7 +70,7 @@ public class StyleMapper
final String attributeName)
{
final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementTagName, attributeNamespace, attributeName);
- final StyleMappingRule rule = (StyleMappingRule) backend.get(key);
+ final StyleMappingRule rule = backend.get(key);
if (rule == null)
{
return null;
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java
index c8afc16cf015..40a685a08842 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java
@@ -37,11 +37,11 @@ public class StyleMappingDocumentReadHandler extends AbstractXmlReadHandler
{
private final StyleMapper styleMapper;
- private final List mappings;
+ private final List<StyleMappingReadHandler> mappings;
public StyleMappingDocumentReadHandler()
{
- this.mappings = new ArrayList();
+ this.mappings = new ArrayList<StyleMappingReadHandler>();
this.styleMapper = new StyleMapper();
}
@@ -78,8 +78,7 @@ public class StyleMappingDocumentReadHandler extends AbstractXmlReadHandler
{
for (int i = 0; i < mappings.size(); i++)
{
- final StyleMappingReadHandler handler =
- (StyleMappingReadHandler) mappings.get(i);
+ final StyleMappingReadHandler handler = mappings.get(i);
styleMapper.addMapping(handler.getRule());
}
}
@@ -90,7 +89,7 @@ public class StyleMappingDocumentReadHandler extends AbstractXmlReadHandler
*
* @return the object.
*/
- public Object getObject()
+ public StyleMapper getObject()
throws SAXException
{
return styleMapper;
diff --git a/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java b/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java
index 7a828eb38147..0775c79dd33d 100644
--- a/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java
+++ b/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java
@@ -29,7 +29,7 @@ public class DefaultJobProperties implements JobProperties
{
private final ReportEngineMetaData metaData;
- private final Map properties;
+ private final Map<String,Object> properties;
public DefaultJobProperties(final ReportEngineMetaData metaData)
{
@@ -37,7 +37,7 @@ public class DefaultJobProperties implements JobProperties
{
throw new NullPointerException();
}
- this.properties = new HashMap();
+ this.properties = new HashMap<String,Object>();
this.metaData = metaData;
}
diff --git a/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java b/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java
index 8bc75c7ad54a..61e71b33db0c 100644
--- a/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java
+++ b/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java
@@ -26,11 +26,11 @@ import java.util.Map;
public class DefaultParameterMap implements ParameterMap
{
- private final Map backend;
+ private final Map<String,Object> backend;
public DefaultParameterMap()
{
- backend = new HashMap();
+ backend = new HashMap<String,Object>();
}
public void clear()
@@ -80,7 +80,7 @@ public class DefaultParameterMap implements ParameterMap
public String[] keys()
{
- return (String[]) this.backend.keySet().toArray(new String[backend.size()]);
+ return this.backend.keySet().toArray(new String[backend.size()]);
}
/**
diff --git a/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java b/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java
index c2c8511330b5..1a36f6b4097c 100644
--- a/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java
+++ b/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java
@@ -46,11 +46,11 @@ public class ManifestWriter
public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output.";
- private final Map entries;
+ private final Map<String,String> entries;
public ManifestWriter()
{
- entries = new HashMap();
+ entries = new HashMap<String,String>();
}
public void addEntry(final String fullPath, final String mimeType)
@@ -98,13 +98,13 @@ public class ManifestWriter
rootAttributes.addNamespaceDeclaration("manifest", MANIFEST_NS);
xmlWriter.writeTag(MANIFEST_NS, "manifest", rootAttributes, XmlWriterSupport.OPEN);
- final Iterator iterator = entries.entrySet().iterator();
+ final Iterator<Map.Entry<String,String>> iterator = entries.entrySet().iterator();
while (iterator.hasNext())
{
- final Map.Entry entry = (Map.Entry) iterator.next();
+ final Map.Entry<String,String> entry = iterator.next();
final AttributeList entryAttrs = new AttributeList();
- entryAttrs.setAttribute(MANIFEST_NS, "media-type", (String) entry.getValue());
- entryAttrs.setAttribute(MANIFEST_NS, "full-path", (String) entry.getKey());
+ entryAttrs.setAttribute(MANIFEST_NS, "media-type", entry.getValue());
+ entryAttrs.setAttribute(MANIFEST_NS, "full-path", entry.getKey());
xmlWriter.writeTag(MANIFEST_NS, "file-entry", entryAttrs, XmlWriterSupport.CLOSE);
}