@@ -35,9 +35,9 @@ default Map<String, Object> createRootColumn(String rootId, List<String> childId
3535
3636 Map <String , Object > rootComponent = new HashMap <>();
3737 Map <String , Object > columnProps = new HashMap <>();
38- columnProps . put ( "children" , new HashMap <String , Object >() {{
39- put ("explicitList" , childIds );
40- }} );
38+ Map < String , Object > childrenMap = new HashMap <>();
39+ childrenMap . put ("explicitList" , childIds );
40+ columnProps . put ( "children" , childrenMap );
4141 rootComponent .put ("Column" , columnProps );
4242 root .put ("component" , rootComponent );
4343
@@ -67,9 +67,9 @@ default Map<String, Object> createTextComponent(String id, String text, String u
6767
6868 Map <String , Object > textComponent = new HashMap <>();
6969 Map <String , Object > textProps = new HashMap <>();
70- textProps . put ( "text" , new HashMap <String , Object >() {{
71- put ("literalString" , text );
72- }} );
70+ Map < String , Object > textMap = new HashMap <>();
71+ textMap . put ("literalString" , text );
72+ textProps . put ( "text" , textMap );
7373
7474 if (usageHint != null && !usageHint .isEmpty ()) {
7575 textProps .put ("usageHint" , usageHint );
@@ -184,14 +184,14 @@ default Map<String, Object> createTextFieldComponent(String id, String label, St
184184 Map <String , Object > textFieldProps = new HashMap <>();
185185
186186 // Label is required for TextField
187- textFieldProps . put ( "label" , new HashMap <String , Object >() {{
188- put ("literalString" , label );
189- }} );
187+ Map < String , Object > labelMap = new HashMap <>();
188+ labelMap . put ("literalString" , label );
189+ textFieldProps . put ( "label" , labelMap );
190190
191191 // Bind text to data model path (A2UI v0.8 uses 'text' property for TextField)
192- textFieldProps . put ( "text" , new HashMap <String , Object >() {{
193- put ("path" , dataPath );
194- }} );
192+ Map < String , Object > textMap = new HashMap <>();
193+ textMap . put ("path" , dataPath );
194+ textFieldProps . put ( "text" , textMap );
195195
196196 textFieldComponent .put ("TextField" , textFieldProps );
197197 component .put ("component" , textFieldComponent );
@@ -228,9 +228,9 @@ default Map<String, Object> createButtonComponent(String id, String buttonText,
228228 for (Map .Entry <String , String > binding : contextBindings .entrySet ()) {
229229 Map <String , Object > contextItem = new HashMap <>();
230230 contextItem .put ("key" , binding .getKey ());
231- contextItem . put ( "value" , new HashMap <String , Object >() {{
232- put ("path" , binding .getValue ());
233- }} );
231+ Map < String , Object > valueMap = new HashMap <>();
232+ valueMap . put ("path" , binding .getValue ());
233+ contextItem . put ( "value" , valueMap );
234234 context .add (contextItem );
235235 }
236236 action .put ("context" , context );
@@ -332,9 +332,9 @@ default Map<String, Object> createImageComponent(String id, String url, String f
332332 Map <String , Object > imageComponent = new HashMap <>();
333333 Map <String , Object > imageProps = new HashMap <>();
334334
335- imageProps . put ( "url" , new HashMap <String , Object >() {{
336- put ("literalString" , url );
337- }} );
335+ Map < String , Object > urlMap = new HashMap <>();
336+ urlMap . put ("literalString" , url );
337+ imageProps . put ( "url" , urlMap );
338338
339339 if (fit != null ) {
340340 imageProps .put ("fit" , fit );
@@ -359,13 +359,13 @@ default Map<String, Object> createCheckBoxComponent(String id, String label, Str
359359 Map <String , Object > checkBoxComponent = new HashMap <>();
360360 Map <String , Object > checkBoxProps = new HashMap <>();
361361
362- checkBoxProps . put ( "label" , new HashMap <String , Object >() {{
363- put ("literalString" , label );
364- }} );
362+ Map < String , Object > labelMap = new HashMap <>();
363+ labelMap . put ("literalString" , label );
364+ checkBoxProps . put ( "label" , labelMap );
365365
366- checkBoxProps . put ( "value" , new HashMap <String , Object >() {{
367- put ("path" , dataPath );
368- }} );
366+ Map < String , Object > valueMap = new HashMap <>();
367+ valueMap . put ("path" , dataPath );
368+ checkBoxProps . put ( "value" , valueMap );
369369
370370 checkBoxComponent .put ("CheckBox" , checkBoxProps );
371371 component .put ("component" , checkBoxComponent );
@@ -384,13 +384,13 @@ default Map<String, Object> createSliderComponent(String id, String label, Strin
384384 Map <String , Object > sliderComponent = new HashMap <>();
385385 Map <String , Object > sliderProps = new HashMap <>();
386386
387- sliderProps . put ( "label" , new HashMap <String , Object >() {{
388- put ("literalString" , label );
389- }} );
387+ Map < String , Object > labelMap = new HashMap <>();
388+ labelMap . put ("literalString" , label );
389+ sliderProps . put ( "label" , labelMap );
390390
391- sliderProps . put ( "value" , new HashMap <String , Object >() {{
392- put ("path" , dataPath );
393- }} );
391+ Map < String , Object > valueMap = new HashMap <>();
392+ valueMap . put ("path" , dataPath );
393+ sliderProps . put ( "value" , valueMap );
394394
395395 if (minValue != null ) {
396396 sliderProps .put ("minValue" , minValue );
@@ -434,9 +434,9 @@ default Map<String, Object> createRowComponent(String id, List<String> childIds,
434434 Map <String , Object > rowComponent = new HashMap <>();
435435 Map <String , Object > rowProps = new HashMap <>();
436436
437- rowProps . put ( "children" , new HashMap <String , Object >() {{
438- put ("explicitList" , childIds );
439- }} );
437+ Map < String , Object > childrenMap = new HashMap <>();
438+ childrenMap . put ("explicitList" , childIds );
439+ rowProps . put ( "children" , childrenMap );
440440
441441 if (alignment != null ) {
442442 rowProps .put ("alignment" , alignment );
@@ -496,10 +496,10 @@ default Map<String, Object> createListComponent(String id, String dataPath, Stri
496496 Map <String , Object > listComponent = new HashMap <>();
497497 Map <String , Object > listProps = new HashMap <>();
498498
499- listProps . put ( "children" , new HashMap <String , Object >() {{
500- put ("path" , dataPath );
501- put ("componentId" , templateComponentId );
502- }} );
499+ Map < String , Object > childrenMap = new HashMap <>();
500+ childrenMap . put ("path" , dataPath );
501+ childrenMap . put ("componentId" , templateComponentId );
502+ listProps . put ( "children" , childrenMap );
503503
504504 listComponent .put ("List" , listProps );
505505 component .put ("component" , listComponent );
@@ -519,9 +519,9 @@ default Map<String, Object> createLoadingComponent(String id, String message) {
519519 Map <String , Object > columnProps = new HashMap <>();
520520
521521 List <String > childIds = Arrays .asList ("loading_icon" , "loading_text" );
522- columnProps . put ( "children" , new HashMap <String , Object >() {{
523- put ("explicitList" , childIds );
524- }} );
522+ Map < String , Object > childrenMap = new HashMap <>();
523+ childrenMap . put ("explicitList" , childIds );
524+ columnProps . put ( "children" , childrenMap );
525525 columnProps .put ("alignment" , "center" );
526526 columnProps .put ("distribution" , "center" );
527527
@@ -580,18 +580,18 @@ default Map<String, Object> createChoicePickerComponent(String id, String label,
580580 Map <String , Object > choiceComponent = new HashMap <>();
581581 Map <String , Object > choiceProps = new HashMap <>();
582582
583- choiceProps . put ( "label" , new HashMap <String , Object >() {{
584- put ("literalString" , label );
585- }} );
583+ Map < String , Object > labelMap = new HashMap <>();
584+ labelMap . put ("literalString" , label );
585+ choiceProps . put ( "label" , labelMap );
586586
587587 List <Map <String , Object >> optionList = new ArrayList <>();
588588 for (Map <String , String > option : options ) {
589- optionList . add ( new HashMap <String , Object >() {{
590- put ("value" , option .get ("value" ));
591- put ( "label" , new HashMap <String , Object >() {{
592- put ("literalString" , option .get ("label" ));
593- }} );
594- }} );
589+ Map <String , Object > optionMap = new HashMap <>();
590+ optionMap . put ("value" , option .get ("value" ));
591+ Map < String , Object > optionLabelMap = new HashMap <>();
592+ optionLabelMap . put ("literalString" , option .get ("label" ));
593+ optionMap . put ( "label" , optionLabelMap );
594+ optionList . add ( optionMap );
595595 }
596596 choiceProps .put ("options" , optionList );
597597
@@ -615,9 +615,9 @@ default Map<String, Object> createVideoComponent(String id, String url, String u
615615 Map <String , Object > videoComponent = new HashMap <>();
616616 Map <String , Object > videoProps = new HashMap <>();
617617
618- videoProps . put ( "url" , new HashMap <String , Object >() {{
619- put ("literalString" , url );
620- }} );
618+ Map < String , Object > urlMap = new HashMap <>();
619+ urlMap . put ("literalString" , url );
620+ videoProps . put ( "url" , urlMap );
621621
622622 if (usageHint != null ) {
623623 videoProps .put ("usageHint" , usageHint );
@@ -639,14 +639,14 @@ default Map<String, Object> createAudioPlayerComponent(String id, String url, St
639639 Map <String , Object > audioComponent = new HashMap <>();
640640 Map <String , Object > audioProps = new HashMap <>();
641641
642- audioProps . put ( "url" , new HashMap <String , Object >() {{
643- put ("literalString" , url );
644- }} );
642+ Map < String , Object > urlMap = new HashMap <>();
643+ urlMap . put ("literalString" , url );
644+ audioProps . put ( "url" , urlMap );
645645
646646 if (description != null ) {
647- audioProps . put ( "description" , new HashMap <String , Object >() {{
648- put ("literalString" , description );
649- }} );
647+ Map < String , Object > descriptionMap = new HashMap <>();
648+ descriptionMap . put ("literalString" , description );
649+ audioProps . put ( "description" , descriptionMap );
650650 }
651651
652652 audioComponent .put ("AudioPlayer" , audioProps );
@@ -667,12 +667,12 @@ default Map<String, Object> createTabsComponent(String id, List<Map<String, Obje
667667
668668 List <Map <String , Object >> items = new ArrayList <>();
669669 for (Map <String , Object > tab : tabItems ) {
670- items . add ( new HashMap <String , Object >() {{
671- put ( "title" , new HashMap <String , Object >() {{
672- put ("literalString" , tab .get ("title" ));
673- }} );
674- put ("child" , tab .get ("child" ));
675- }} );
670+ Map <String , Object > itemMap = new HashMap <>();
671+ Map < String , Object > titleMap = new HashMap <>();
672+ titleMap . put ("literalString" , tab .get ("title" ));
673+ itemMap . put ( "title" , titleMap );
674+ itemMap . put ("child" , tab .get ("child" ));
675+ items . add ( itemMap );
676676 }
677677 tabsProps .put ("tabItems" , items );
678678
@@ -712,14 +712,14 @@ default Map<String, Object> createDateTimeInputComponent(String id, String label
712712 Map <String , Object > dateTimeComponent = new HashMap <>();
713713 Map <String , Object > dateTimeProps = new HashMap <>();
714714
715- dateTimeProps . put ( "label" , new HashMap <String , Object >() {{
716- put ("literalString" , label );
717- }} );
715+ Map < String , Object > labelMap = new HashMap <>();
716+ labelMap . put ("literalString" , label );
717+ dateTimeProps . put ( "label" , labelMap );
718718
719719 if (dataPath != null ) {
720- dateTimeProps . put ( "value" , new HashMap <String , Object >() {{
721- put ("path" , dataPath );
722- }} );
720+ Map < String , Object > valueMap = new HashMap <>();
721+ valueMap . put ("path" , dataPath );
722+ dateTimeProps . put ( "value" , valueMap );
723723 }
724724
725725 if (enableDate != null ) {
0 commit comments