Package io.jmix.reports.runner
Class ReportInputParameterValidator
java.lang.Object
io.jmix.reports.runner.ReportInputParameterValidator
@Component("report_ReportInputParameterValidator")
public class ReportInputParameterValidator
extends Object
Validates report input parameters before running the report. Used by any code that runs a report on behalf of
an external caller (e.g. UI or REST API) to check parameter values the same way, so a report is not executed with
invalid input.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ReportsGroovyFeatureSupportprotected final GroovyScriptParametersProviderprotected final Messagesprotected final Scripting -
Constructor Summary
ConstructorsConstructorDescriptionReportInputParameterValidator(GroovyScriptParametersProvider groovyScriptParametersProvider, Scripting scripting, ReportsGroovyFeatureSupport groovyFeatureSupport, Messages messages) -
Method Summary
Modifier and TypeMethodDescriptioncreateScriptContext(Map<String, Object> contextParameters) voidcrossValidateParameters(Report report, Map<String, Object> reportParameters) Performs cross field parameters validation before running the report.protected voidrunCrossValidationDelegate(ParametersCrossValidator crossValidator, Map<String, Object> reportParameters) protected voidrunValidationDelegate(ParameterValidator validator, Object value) protected voidrunValidationScript(String groovyScript, Map<String, Object> scriptContext) voidvalidateParameterValue(ReportInputParameter parameter, Object value) Checking validation for an input parameter field before running the report.protected voidwrapValidation(Runnable validator)
-
Field Details
-
groovyScriptParametersProvider
-
scripting
-
groovyFeatureSupport
-
messages
-
-
Constructor Details
-
ReportInputParameterValidator
public ReportInputParameterValidator(GroovyScriptParametersProvider groovyScriptParametersProvider, Scripting scripting, ReportsGroovyFeatureSupport groovyFeatureSupport, Messages messages)
-
-
Method Details
-
validateParameterValue
Checking validation for an input parameter field before running the report.- Parameters:
parameter- data info which describes report's parametervalue- parameter's value
-
crossValidateParameters
Performs cross field parameters validation before running the report.- Parameters:
report- report instancereportParameters- map of parameters values taken from components
-
runValidationScript
-
wrapValidation
-
runCrossValidationDelegate
protected void runCrossValidationDelegate(ParametersCrossValidator crossValidator, Map<String, Object> reportParameters) -
runValidationDelegate
-
createScriptContext
-