public abstract class Data
extends java.lang.Object
This class represents the data of a report.
Instances of this class may be used concurrently (through caches), so the following policy must be followed:
compact()
).IllegalStateException
s.Modifier and Type | Method and Description |
---|---|
void |
addColumnTotal(Column col,
CellValue total)
Adds the specified column total.
|
void |
addRow(DataRow rowToAdd)
Adds the specified row of data.
|
void |
compact()
This class must called after the data has been calculated completely, no further
changes have to be made and the
|
abstract ChartData |
createChartData(int limit)
Creates a suitable
ChartData object for this report data. |
java.util.Iterator<Column> |
getColumns()
Gets an iterator over the columns of the report data.
|
CellValue |
getColumnTotal(Column col)
Gets the total value of the specified column.
|
int |
getReportingVersion()
Gets the interal reporting version the report was created for.
|
DataRow |
getRowAt(int rowIndex)
Gets a row by its index.
|
int |
getRowCnt()
Gets the number of rows.
|
boolean |
hasGroupedColumns()
Determines if the report data has of grouped columns.
|
void |
postProcess(Processor processor)
Use this method to process each data row with the specified
Processor . |
void |
postProcess(Processor[] processors)
Use this method to process each data row with the specified
Processor s. |
void |
sortByColumn(Column sortingColumn,
Sorting.Direction sortingDirection)
Sorts the result data by the specified column.
|
abstract void |
writeDataJSON(JSONWriter writer,
java.util.Locale locale,
java.lang.Integer start,
java.lang.Integer limit)
Writes the result to the specified
JSONWriter . |
abstract void |
writeSortInfoJSON(JSONWriter writer)
Writes the sort information for the report to the specified
JSONWriter . |
abstract void |
writeTypesJSON(JSONWriter writer)
Writes the type definition for each column to the specified
JSONWriter . |
public Data(Report report)
public boolean hasGroupedColumns()
true
if the report contains data from grouped columnspublic void addRow(DataRow rowToAdd)
rowToAdd
- The row to addpublic DataRow getRowAt(int rowIndex)
rowIndex
- The indexpublic int getRowCnt()
public java.util.Iterator<Column> getColumns()
public void addColumnTotal(Column col, CellValue total)
col
- The columntotal
- The total valuepublic CellValue getColumnTotal(Column col)
col
- The (aggregated) column to determine the total value forpublic void compact()
public void postProcess(Processor[] processors)
Processor
s.processors
- The array of processing modules to execute. Note that if one of the
modules declares a row to be deleted, the modules specified at
higher array indices will not be executed on that row.public void sortByColumn(Column sortingColumn, Sorting.Direction sortingDirection)
sortingColumn
- The column to sort bysortingDirection
- The sorting directionpublic void postProcess(Processor processor)
Processor
.processor
- The processing modulepublic int getReportingVersion()
Gets the interal reporting version the report was created for.
This can be used to ensure backwards compatibility with reports that were created for different CQ versions if some default behaviour had to be changed.
public abstract ChartData createChartData(int limit)
ChartData
object for this report data.limit
- Number of data to be returned for the chartpublic abstract void writeTypesJSON(JSONWriter writer) throws JSONException
JSONWriter
.writer
- The writer to stream the data toJSONException
- if writing the type definition has failedpublic abstract void writeSortInfoJSON(JSONWriter writer) throws JSONException
JSONWriter
.writer
- The writer to stream the data toJSONException
- if writing the sort info has failedpublic abstract void writeDataJSON(JSONWriter writer, java.util.Locale locale, java.lang.Integer start, java.lang.Integer limit) throws JSONException
JSONWriter
.writer
- The writer to stream the data tolocale
- The locale to be used for formatting datastart
- The first record to be streamed; null
to stream from the
beginninglimit
- The maximum number of records to be streamed; null
to
stream to the endJSONException
- if writing the result has failed"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"