Package io.jmix.reports.impl.builder
Class AnnotatedReportBuilderImpl
java.lang.Object
io.jmix.reports.impl.builder.AnnotatedReportBuilderImpl
- All Implemented Interfaces:
AnnotatedReportBuilder
@Component("report_AnnotatedReportBuilder")
public class AnnotatedReportBuilderImpl
extends Object
implements AnnotatedReportBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotatedBuilderUtilsprotected final AnnotatedReportGroupHolderprotected final ClassManagerprotected final Messagesprotected final MessageToolsprotected final Metadataprotected final ParameterClassResolverprotected final Resourcesprotected final AnnotatedReportRoleExtractorprotected final AnnotatedReportScreenExtractor -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedReportBuilderImpl(Metadata metadata, Messages messages, MessageTools messageTools, AnnotatedBuilderUtils annotatedBuilderUtils, AnnotatedReportGroupHolder annotatedReportGroupHolder, Resources resources, AnnotatedReportRoleExtractor roleExtractor, ParameterClassResolver parameterClassResolver, AnnotatedReportScreenExtractor screenExtractor, ClassManager classManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassignDataSetDelegates(Set<BandDefinition> bands, Object definitionInstance) protected voidassignGroup(Report report, ReportDef annotation) protected voidassignInputParameterDelegates(List<ReportInputParameter> inputParameters, Object definitionInstance) protected voidassignReportDelegates(Report report, Object definitionInstance) protected voidassignReportParameters(Report report, ReportDef annotation, Class<?> definitionClass) protected voidassignTemplateDelegates(List<ReportTemplate> templates, Object definitionInstance) protected voidassignValueFormatDelegates(List<ReportValueFormat> formats, Object definitionInstance) protected ReportInputParameterconvertToInputParameter(InputParameterDef annotation, Class<?> definitionClass) protected TemplateTableDescriptionconvertToTableDescription(TemplateTableDef table, Class<?> definitionClass) protected ReportTemplateconvertToTemplate(TemplateDef annotation, Class<?> definitionClass) protected ReportValueFormatconvertToValueFormat(Report report, ValueFormatDef annotation) createReportFromDefinition(Object definitionInstance) Parse, validate given annotated report definition.protected Set<BandDefinition>extractBands(Report report, Object definitionInstance) extractDataSets(Report report, BandDefinition bandDefinition, DataSetDef[] dataSetDefs) protected voidextractEntityDataSetParameters(DataSetDef annotation, Report report, DataSet dataSet, EntityDataSetDef entityAnnotation) protected List<ReportInputParameter>extractInputParameters(Report report, Object definitionInstance) protected voidextractJsonDataSetParameters(Report report, JsonDataSetParameters jsonAnnotation, DataSet dataSet) protected List<ReportTemplate>extractTemplates(Report report, Object definitionInstance) protected List<ReportValueFormat>extractValueFormats(Report report, Object definitionInstance) protected <E,A extends Annotation>
EfindElementInListByUniqueName(Collection<E> elements, String name, Function<E, String> elementNameExtractor, A annotation, String errorMessagePrefix) protected StringgetValueName(String band, String field) protected <T> TobtainDelegateFromDefinition(Object reportDefinition, Method method, Class<T> delegateClass) protected voidvalidateDelegateCommon(Method method) protected voidprotected voidprotected voidvalidateMandatoryTemplateDelegates(List<ReportTemplate> templates) protected <T> voidvalidateUniqueness(Collection<T> objects, Function<T, String> uniqueAttributeGetter, String errorMessage)
-
Field Details
-
metadata
-
messages
-
messageTools
-
annotatedReportGroupHolder
-
resources
-
roleExtractor
-
parameterClassResolver
-
screenExtractor
-
classManager
-
annotatedBuilderUtils
-
-
Constructor Details
-
AnnotatedReportBuilderImpl
public AnnotatedReportBuilderImpl(Metadata metadata, Messages messages, MessageTools messageTools, AnnotatedBuilderUtils annotatedBuilderUtils, AnnotatedReportGroupHolder annotatedReportGroupHolder, Resources resources, AnnotatedReportRoleExtractor roleExtractor, ParameterClassResolver parameterClassResolver, @Autowired(required=false) @Nullable AnnotatedReportScreenExtractor screenExtractor, ClassManager classManager)
-
-
Method Details
-
createReportFromDefinition
Description copied from interface:AnnotatedReportBuilderParse, validate given annotated report definition. Construct and return a model object.- Specified by:
createReportFromDefinitionin interfaceAnnotatedReportBuilder- Parameters:
definitionInstance- instance of class annotated withReportDefand other annotations- Returns:
- constructed Report model object
-
assignReportParameters
-
assignGroup
-
assignReportDelegates
-
validateDelegateCommon
-
extractInputParameters
protected List<ReportInputParameter> extractInputParameters(Report report, Object definitionInstance) -
convertToInputParameter
protected ReportInputParameter convertToInputParameter(InputParameterDef annotation, Class<?> definitionClass) -
assignInputParameterDelegates
protected void assignInputParameterDelegates(List<ReportInputParameter> inputParameters, Object definitionInstance) -
extractTemplates
-
validateMandatoryTemplateDelegates
-
convertToTemplate
-
convertToTableDescription
protected TemplateTableDescription convertToTableDescription(TemplateTableDef table, Class<?> definitionClass) -
assignTemplateDelegates
-
extractBands
-
validateMandatoryDelegates
-
extractDataSets
protected List<DataSet> extractDataSets(Report report, BandDefinition bandDefinition, DataSetDef[] dataSetDefs) -
extractJsonDataSetParameters
protected void extractJsonDataSetParameters(Report report, JsonDataSetParameters jsonAnnotation, DataSet dataSet) -
extractEntityDataSetParameters
protected void extractEntityDataSetParameters(DataSetDef annotation, Report report, DataSet dataSet, EntityDataSetDef entityAnnotation) -
assignDataSetDelegates
-
extractValueFormats
-
convertToValueFormat
-
getValueName
-
assignValueFormatDelegates
protected void assignValueFormatDelegates(List<ReportValueFormat> formats, Object definitionInstance) -
validateMandatoryFormatDelegates
-
findElementInListByUniqueName
protected <E,A extends Annotation> E findElementInListByUniqueName(Collection<E> elements, String name, Function<E, String> elementNameExtractor, A annotation, String errorMessagePrefix) -
obtainDelegateFromDefinition
-
validateUniqueness
protected <T> void validateUniqueness(Collection<T> objects, Function<T, String> uniqueAttributeGetter, String errorMessage)
-