List<ReportDto> reportDtoList = new ArrayList<ReportDto>(); Pattern p = Pattern.compile("=\\s'[0-9]+"); for (Report report : reportList) { List<ReportDetailsDto> ReportDetailsDtoList = new ArrayList<ReportDetailsDto>(); ReportDto reportDto = new ReportDto(); reportDto.setReportId(report.getReportId()); reportDto.setReportName(report.getName()); String whereClause = report.getWhereClause(); Matcher m = p.matcher(whereClause); if (m.find()) { String foundThis = m.group().substring(3); // do something with foundThis } else { // didn't find a number or = } }
@SuppressWarnings("unchecked") private Class<? extends AttributeStatisticVisitorWithResults> createClassForReport(Report report) throws ClassNotFoundException { return (Class<? extends AttributeStatisticVisitorWithResults>) Class.forName(report.getClassName()); }
/** * <p>getAggregateParameters</p> * * @return a {@link java.util.LinkedHashMap} object. */ public Map<String, String> getAggregateParameters() { LinkedHashMap<String, String> agg = new LinkedHashMap<String, String>(getReport().getParameters()); agg.putAll(getParameters()); return agg; } /**
LOG.debug("skipping report '{}' in package '{}' because the report is not enabled", report.getName(), pkg.getName()); continue; clazz = createClassForReport(report); } catch (ClassNotFoundException e) { throw new DataAccessResourceFailureException("Could not find class '" + report.getClassName() + "'; nested exception: " + e, e); Assert.isAssignable(AttributeStatisticVisitorWithResults.class, clazz, "the class specified by class-name in the '" + report.getName() + "' report does not implement the interface " + AttributeStatisticVisitorWithResults.class.getName() + "; ");
Report r = new Report(); r.setName(report.getName()); r.setClassName(report.getClassName()); for (Parameter parameter : getParametersForReport(report)) { r.addParameter(parameter.getKey(), parameter.getValue());
private Report loadReport(String name) { for (Report report : m_reports) { if (name.equals(report.getName())) { return report; } } throw new ObjectRetrievalFailureException("There is no report definition named '" + name + "'", name); }
/** * <p>getName</p> * * @return a {@link java.lang.String} object. */ public String getName() { return getReport().getReport().getName(); } /**