Class JsonReportViewConverterStrategy
- java.lang.Object
-
- de.hybris.platform.auditreport.service.impl.JsonReportViewConverterStrategy
-
- All Implemented Interfaces:
ReportViewConverterStrategy
public class JsonReportViewConverterStrategy extends java.lang.Object implements ReportViewConverterStrategy
This implementation ofReportViewConverterStrategygenerated JSON representation of the given collection ofReportViews.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_FILE_NAME
-
Constructor Summary
Constructors Constructor Description JsonReportViewConverterStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.List<ReportConversionData>convert(java.util.List<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context)Converts the given reports to list of generated binary representation of the reports.java.util.List<ReportConversionData>convert(java.util.stream.Stream<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context)Converts the given reports to list of generated binary representation of the reports.protected byte[]convertToJson(java.util.List<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context)Deprecated, for removal: This API element is subject to removal in a future version.since 1811protected java.io.InputStreamconvertToJson(java.util.stream.Stream<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context)Converts the given reports to list of generated binary representation of the reports.java.lang.StringgetReportName()voidsetReportName(java.lang.String reportName)Sets a name of the report.
-
-
-
Field Detail
-
DEFAULT_FILE_NAME
public static final java.lang.String DEFAULT_FILE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
convert
public java.util.List<ReportConversionData> convert(java.util.List<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context)
Description copied from interface:ReportViewConverterStrategyConverts the given reports to list of generated binary representation of the reports.- Specified by:
convertin interfaceReportViewConverterStrategy- Parameters:
reports- the list with reports to convert.context- a map used to pass in additional data needed by the strategy.- Returns:
- a list of objects representing the generated files.
-
convert
public java.util.List<ReportConversionData> convert(java.util.stream.Stream<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context)
Description copied from interface:ReportViewConverterStrategyConverts the given reports to list of generated binary representation of the reports.- Specified by:
convertin interfaceReportViewConverterStrategy- Parameters:
reports- the list with reports to convert.context- a map used to pass in additional data needed by the strategy.- Returns:
- a list of objects representing the generated files.
-
convertToJson
@Deprecated(since="1811", forRemoval=true) protected byte[] convertToJson(java.util.List<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 1811Converts the given reports to list of generated binary representation of the reports.- Parameters:
reports- the list with reports to convert.context- a map used to pass in additional data needed by the strategy.- Returns:
- an byte[] representing a collection of generated files.
- Throws:
java.io.IOException- if any I/O errors occurred.
-
convertToJson
protected java.io.InputStream convertToJson(java.util.stream.Stream<ReportView> reports, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.IOException
Converts the given reports to list of generated binary representation of the reports.- Parameters:
reports- the list with reports to convert.context- a map used to pass in additional data needed by the strategy.- Returns:
- an byte[] representing a collection of generated files.
- Throws:
java.io.IOException- if any I/O errors occurred.
-
getReportName
public java.lang.String getReportName()
-
setReportName
public void setReportName(java.lang.String reportName)
Sets a name of the report. By default the strategy usesDEFAULT_FILE_NAME.- Parameters:
reportName- the report name.
-
-