Skip to content

Commit 362494a

Browse files
committed
Minor change to configuring "default name for @XmlValue" handling just added
1 parent 0d8fb31 commit 362494a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

jaxb/src/main/java/com/fasterxml/jackson/module/jaxb/JaxbAnnotationModule.java

+3-8
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public enum Priority {
5959
/**
6060
* Value to pass to
6161
* {@link JaxbAnnotationIntrospector#setNameUsedForXmlValue}
62-
* if defined and non-null.
62+
* if introspector constructed by the module.
6363
*
6464
* @since 2.12
6565
*/
66-
protected String _nameUsedForXmlValue;
66+
protected String _nameUsedForXmlValue = JaxbAnnotationIntrospector.DEFAULT_NAME_FOR_XML_VALUE;
6767

6868
/*
6969
/**********************************************************
@@ -99,9 +99,7 @@ public void setupModule(SetupContext context)
9999
if (_nonNillableInclusion != null) {
100100
intr.setNonNillableInclusion(_nonNillableInclusion);
101101
}
102-
if (_nameUsedForXmlValue != null) {
103-
intr.setNameUsedForXmlValue(_nameUsedForXmlValue);
104-
}
102+
intr.setNameUsedForXmlValue(_nameUsedForXmlValue);
105103
}
106104
switch (_priority) {
107105
case PRIMARY:
@@ -158,9 +156,6 @@ public JsonInclude.Include getNonNillableInclusion() {
158156
*/
159157
public JaxbAnnotationModule setNameUsedForXmlValue(String name) {
160158
_nameUsedForXmlValue = name;
161-
if ((name != null) && (_introspector != null)) {
162-
_introspector.setNameUsedForXmlValue(name);
163-
}
164159
return this;
165160
}
166161

0 commit comments

Comments
 (0)