@@ -56,6 +56,15 @@ public enum Priority {
56
56
*/
57
57
protected JsonInclude .Include _nonNillableInclusion ;
58
58
59
+ /**
60
+ * Value to pass to
61
+ * {@link JaxbAnnotationIntrospector#setNameUsedForXmlValue}
62
+ * if defined and non-null.
63
+ *
64
+ * @since 2.12
65
+ */
66
+ protected String _nameUsedForXmlValue ;
67
+
59
68
/*
60
69
/**********************************************************
61
70
/* Life cycle
@@ -90,6 +99,9 @@ public void setupModule(SetupContext context)
90
99
if (_nonNillableInclusion != null ) {
91
100
intr .setNonNillableInclusion (_nonNillableInclusion );
92
101
}
102
+ if (_nameUsedForXmlValue != null ) {
103
+ intr .setNameUsedForXmlValue (_nameUsedForXmlValue );
104
+ }
93
105
}
94
106
switch (_priority ) {
95
107
case PRIMARY :
@@ -128,6 +140,7 @@ public JaxbAnnotationModule setPriority(Priority p) {
128
140
public JaxbAnnotationModule setNonNillableInclusion (JsonInclude .Include incl ) {
129
141
_nonNillableInclusion = incl ;
130
142
if (_introspector != null ) {
143
+ // 13-Nov-2020, tatu: should we pass null "incl"?
131
144
_introspector .setNonNillableInclusion (incl );
132
145
}
133
146
return this ;
@@ -139,4 +152,19 @@ public JaxbAnnotationModule setNonNillableInclusion(JsonInclude.Include incl) {
139
152
public JsonInclude .Include getNonNillableInclusion () {
140
153
return _nonNillableInclusion ;
141
154
}
155
+
156
+ /**
157
+ * @since 2.12
158
+ */
159
+ public JaxbAnnotationModule setNameUsedForXmlValue (String name ) {
160
+ _nameUsedForXmlValue = name ;
161
+ if ((name != null ) && (_introspector != null )) {
162
+ _introspector .setNameUsedForXmlValue (name );
163
+ }
164
+ return this ;
165
+ }
166
+
167
+ public String getNameUsedForXmlValue () {
168
+ return _nameUsedForXmlValue ;
169
+ }
142
170
}
0 commit comments