Skip to content

Commit b5c8a29

Browse files
committed
First part of #360, add ToXmlGenerator.Feature.WRITE_NULLS_AS_XSI_NIL
1 parent 617201c commit b5c8a29

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/ser/ToXmlGenerator.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,21 @@ public enum Feature implements FormatFeature
5656
* control characters (Ascii codes 0 through 31) as well as additional linefeeds
5757
* and name characters.
5858
*/
59-
WRITE_XML_1_1(false)
59+
WRITE_XML_1_1(false),
60+
61+
/**
62+
* Feature that controls whether serialization of Java {@code null} values adds
63+
* XML attribute of `xsi:nil`, as defined by XML Schema (see
64+
* <a href="https://www.oreilly.com/library/view/xml-in-a/0596007647/re166.html">this article</a>
65+
* for details) or not.
66+
* If enabled, `xsi:nil` attribute will be added to the empty element; if disabled,
67+
* it will not.
68+
*<p>
69+
* Feature is disabled by default for backwards compatibility.
70+
*
71+
* @since 2.10
72+
*/
73+
WRITE_NULLS_AS_XSI_NIL(false)
6074
;
6175

6276
final boolean _defaultState;

0 commit comments

Comments
 (0)