final int methodSeparatorIdx = query.indexOf('#');
if ((methodSeparatorIdx + 1) >= query.length())
{
// If we have a method separator, then it cant be at the end of the text.
throw new ReportDataFactoryException("Malformed query: " + query); //$NON-NLS-1$
}
if (methodSeparatorIdx == -1)
{
// we have no method. So this query must be a reference to a tablemodel
// instance.
final int parameterStartIdx = query.indexOf('(');
final String[] parameterNames;
final String constructorName;
if (parameterStartIdx == -1)
{
parameterNames = StaticDataFactory.EMPTY_PARAMS;
constructorName = query;
}
else
{
parameterNames = createParameterList(query, parameterStartIdx);
constructorName = query.substring(0, parameterStartIdx);
}
try
{
final Constructor c = findDirectConstructor(constructorName, parameterNames.length);
final Object[] params = new Object[parameterNames.length];
for (int i = 0; i < parameterNames.length; i++)
{
final String name = parameterNames[i];
params[i] = parameters.get(name);
}
return (TableModel) c.newInstance(params);
}
catch (Exception e)
{
throw new ReportDataFactoryException
("Unable to instantiate class for non static call.", e); //$NON-NLS-1$
}
}
return createComplexTableModel