This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Commit c72db28
Improves support for upcasting lenses (#925)
Introduces a dedicated `Lens`-factory fpr upcasting lenses:
`lensForUpcasting`
Its inner code will catch `ClassCastException`s, which can
occur in nested `Mountpoints`, and throw a dedicated `CollectionLensGetException`.
This solution is similar to the handling of false index access or
access by keys for collections, we already have integrated.
This is necessary due to the fact, that fritz2 does not maintain
any sort of `Flow`-hierarchie from the outermost to the innermost
renderings. So the framework cannot control the sequence of collecting
the involved flows, in order to prevent outdated data or - for this case - *types*.
This is a practical compromise, that will work very well for UIs,
as the visual appearance is kind of *dictated* by the properties of the underlying type.
Co-authored-by: christian.hausknecht <christian.hausknecht@oeffentliche.de>1 parent 94ea2ad commit c72db28
File tree
5 files changed
+71
-57
lines changed- core/src
- commonMain/kotlin/dev/fritz2/core
- commonTest/kotlin/dev/fritz2/core
- lenses-annotation-processor/src
- jvmMain/kotlin/dev/fritz2/lens
- jvmTest/kotlin/dev/fritz2/lens
- www/src/pages/docs
5 files changed
+71
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
106 | 132 | | |
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
276 | 271 | | |
277 | 272 | | |
278 | 273 | | |
| |||
Lines changed: 16 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 147 | + | |
151 | 148 | | |
152 | 149 | | |
153 | 150 | | |
| |||
581 | 578 | | |
582 | 579 | | |
583 | 580 | | |
| 581 | + | |
584 | 582 | | |
585 | 583 | | |
586 | 584 | | |
| |||
659 | 657 | | |
660 | 658 | | |
661 | 659 | | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
| 660 | + | |
| 661 | + | |
667 | 662 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
| 663 | + | |
| 664 | + | |
673 | 665 | | |
674 | 666 | | |
675 | 667 | | |
| |||
993 | 985 | | |
994 | 986 | | |
995 | 987 | | |
996 | | - | |
| 988 | + | |
997 | 989 | | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
| 990 | + | |
1003 | 991 | | |
1004 | 992 | | |
1005 | 993 | | |
| |||
1034 | 1022 | | |
1035 | 1023 | | |
1036 | 1024 | | |
1037 | | - | |
| 1025 | + | |
1038 | 1026 | | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
| 1027 | + | |
1044 | 1028 | | |
1045 | 1029 | | |
1046 | 1030 | | |
| |||
1355 | 1339 | | |
1356 | 1340 | | |
1357 | 1341 | | |
| 1342 | + | |
1358 | 1343 | | |
1359 | 1344 | | |
1360 | 1345 | | |
| |||
1376 | 1361 | | |
1377 | 1362 | | |
1378 | 1363 | | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
| 1364 | + | |
| 1365 | + | |
1384 | 1366 | | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
| 1367 | + | |
| 1368 | + | |
1390 | 1369 | | |
1391 | 1370 | | |
1392 | 1371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| |||
639 | 640 | | |
640 | 641 | | |
641 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
642 | 651 | | |
643 | 652 | | |
644 | 653 | | |
| |||
649 | 658 | | |
650 | 659 | | |
651 | 660 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
| 661 | + | |
657 | 662 | | |
658 | 663 | | |
659 | 664 | | |
| |||
0 commit comments