@@ -17,6 +17,7 @@ public class LegacyOverrides {
1717 .withParseWhitespaceControlStrictly (true )
1818 .withAllowAdjacentTextNodes (true )
1919 .withUseTrimmingForNotesAndExpressions (true )
20+ .withKeepNullableLoopValues (true )
2021 .build ();
2122 private final boolean evaluateMapKeys ;
2223 private final boolean iterateOverMapKeys ;
@@ -27,6 +28,7 @@ public class LegacyOverrides {
2728 private final boolean parseWhitespaceControlStrictly ;
2829 private final boolean allowAdjacentTextNodes ;
2930 private final boolean useTrimmingForNotesAndExpressions ;
31+ private final boolean keepNullableLoopValues ;
3032
3133 private LegacyOverrides (Builder builder ) {
3234 evaluateMapKeys = builder .evaluateMapKeys ;
@@ -38,6 +40,7 @@ private LegacyOverrides(Builder builder) {
3840 parseWhitespaceControlStrictly = builder .parseWhitespaceControlStrictly ;
3941 allowAdjacentTextNodes = builder .allowAdjacentTextNodes ;
4042 useTrimmingForNotesAndExpressions = builder .useTrimmingForNotesAndExpressions ;
43+ keepNullableLoopValues = builder .keepNullableLoopValues ;
4144 }
4245
4346 public static Builder newBuilder () {
@@ -80,6 +83,10 @@ public boolean isUseTrimmingForNotesAndExpressions() {
8083 return useTrimmingForNotesAndExpressions ;
8184 }
8285
86+ public boolean isKeepNullableLoopValues () {
87+ return keepNullableLoopValues ;
88+ }
89+
8390 public static class Builder {
8491 private boolean evaluateMapKeys = false ;
8592 private boolean iterateOverMapKeys = false ;
@@ -90,6 +97,7 @@ public static class Builder {
9097 private boolean parseWhitespaceControlStrictly = false ;
9198 private boolean allowAdjacentTextNodes = false ;
9299 private boolean useTrimmingForNotesAndExpressions = false ;
100+ private boolean keepNullableLoopValues = false ;
93101
94102 private Builder () {}
95103
@@ -168,5 +176,10 @@ public Builder withUseTrimmingForNotesAndExpressions(
168176 this .useTrimmingForNotesAndExpressions = useTrimmingForNotesAndExpressions ;
169177 return this ;
170178 }
179+
180+ public Builder withKeepNullableLoopValues (boolean keepNullableLoopValues ) {
181+ this .keepNullableLoopValues = keepNullableLoopValues ;
182+ return this ;
183+ }
171184 }
172185}
0 commit comments