@@ -51,6 +51,7 @@ public class FormatDelimited implements Format {
5151 private final String openQuote ;
5252 private final String closeQuote ;
5353 private final String escapeCloseQuote ;
54+ private final String replaceCloseQuote ;
5455 private final String newline ;
5556
5657 @ Override
@@ -275,10 +276,13 @@ public String getCloseQuote() {
275276
276277 /**
277278 * Value with which to prefix any occurrence of the {@link #closeQuote} string in an output string value.
279+ * Do not set both this and replaceCloseQuote, this value will take preference.
278280 * @return the value with which to prefix any occurrence of the {@link #closeQuote} string in an output string value.
279281 */
280282 @ Schema (description = """
281283 If a string value contains the close quote string it will be prefixed by this string.
284+ <P>
285+ Do not set both this and replaceCloseQuote, this value will take preference.
282286 """
283287 , defaultValue = "\" "
284288 , requiredMode = Schema .RequiredMode .NOT_REQUIRED
@@ -287,6 +291,24 @@ public String getCloseQuote() {
287291 public String getEscapeCloseQuote () {
288292 return escapeCloseQuote ;
289293 }
294+
295+ /**
296+ * Value with which to replace any occurrence of the {@link #closeQuote} string in an output string value.
297+ * Do not set both this and escapeCloseQuote, the value of escapeCloseQuote will take preference.
298+ * @return the value with which to replace any occurrence of the {@link #closeQuote} string in an output string value.
299+ */
300+ @ Schema (description = """
301+ If a string value contains the close quote string it will be replaced by this string.
302+ <P>
303+ Do not set both this and escapeCloseQuote, the value of escapeCloseQuote will take preference.
304+ """
305+ , defaultValue = "\" "
306+ , requiredMode = Schema .RequiredMode .NOT_REQUIRED
307+ , maxLength = 10
308+ )
309+ public String getReplaceCloseQuote () {
310+ return replaceCloseQuote ;
311+ }
290312
291313 /**
292314 * Value with which to suffix each row in the output.
@@ -321,7 +343,8 @@ public static class Builder {
321343 private String delimiter = "," ;
322344 private String openQuote = "\" " ;
323345 private String closeQuote = "\" " ;
324- private String escapeCloseQuote = "\" " ;
346+ private String escapeCloseQuote = "" ;
347+ private String replaceCloseQuote = "" ;
325348 private String newline = "\r \n " ;
326349
327350 private Builder () {
@@ -460,6 +483,16 @@ public Builder escapeCloseQuote(final String value) {
460483 return this ;
461484 }
462485
486+ /**
487+ * Set the {@link FormatDelimited#replaceCloseQuote} value in the builder.
488+ * @param value The value for the {@link FormatDelimited#replaceCloseQuote}.
489+ * @return this, so that this builder may be used in a fluent manner.
490+ */
491+ public Builder replaceCloseQuote (final String value ) {
492+ this .replaceCloseQuote = value ;
493+ return this ;
494+ }
495+
463496 /**
464497 * Set the {@link FormatDelimited#newline} value in the builder.
465498 * @param value The value for the {@link FormatDelimited#newline}.
@@ -475,7 +508,7 @@ public Builder newline(final String value) {
475508 * @return a new instance of the FormatDelimited class.
476509 */
477510 public FormatDelimited build () {
478- return new FormatDelimited (type , name , description , extension , filename , mediaType , hidden , bom , headerRow , delimiter , openQuote , closeQuote , escapeCloseQuote , newline );
511+ return new FormatDelimited (type , name , description , extension , filename , mediaType , hidden , bom , headerRow , delimiter , openQuote , closeQuote , escapeCloseQuote , replaceCloseQuote , newline );
479512 }
480513 }
481514
@@ -500,6 +533,7 @@ private FormatDelimited(final FormatType type
500533 , final String openQuote
501534 , final String closeQuote
502535 , final String escapeCloseQuote
536+ , final String replaceCloseQuote
503537 , final String newline
504538 ) {
505539 validateType (FormatType .Delimited , type );
@@ -516,6 +550,7 @@ private FormatDelimited(final FormatType type
516550 this .openQuote = openQuote ;
517551 this .closeQuote = closeQuote ;
518552 this .escapeCloseQuote = escapeCloseQuote ;
553+ this .replaceCloseQuote = replaceCloseQuote ;
519554 this .newline = newline ;
520555 }
521556
0 commit comments