File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
main/java/tools/jackson/dataformat/xml
test/java/tools/jackson/dataformat/xml Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ Version: 3.x (for earlier see VERSION-2.x)
55=== Releases ===
66------------------------------------------------------------------------
77
8+ 3.1.0 (not yet released)
9+
10+ #780: Add `isEnabled()` methods for format-specific features to mappers
11+
8123.0.1 (21-Oct-2025)
913
1014No changes since 3.0.0
Original file line number Diff line number Diff line change @@ -458,6 +458,21 @@ public XmlFactory tokenStreamFactory() {
458458 return (XmlFactory ) _streamFactory ;
459459 }
460460
461+ /*
462+ /**********************************************************************
463+ /* Format-specific
464+ /**********************************************************************
465+ */
466+
467+ public boolean isEnabled (XmlReadFeature f ) {
468+ return _deserializationConfig .hasFormatFeature (f );
469+ }
470+
471+ public boolean isEnabled (XmlWriteFeature f ) {
472+ return _serializationConfig .hasFormatFeature (f );
473+ }
474+
475+
461476 /*
462477 /**********************************************************************
463478 /* XML-specific access
Original file line number Diff line number Diff line change 66import tools .jackson .databind .ObjectWriter ;
77
88import static org .junit .jupiter .api .Assertions .assertNotSame ;
9+ import static org .junit .jupiter .api .Assertions .assertTrue ;
910
1011public class FeatureDefaultsTest extends XmlTestUtil
1112{
@@ -24,4 +25,13 @@ public void testSerDefaults() throws Exception
2425 ObjectWriter w = MAPPER .writer ();
2526 assertNotSame (w , w .with (XmlWriteFeature .WRITE_XML_1_1 ));
2627 }
28+
29+ // [dataformat-xml#780]
30+ @ Test
31+ void testFeaturesViaMapper () {
32+ XmlMapper mapper = XmlMapper .shared ();
33+ assertTrue (mapper .isEnabled (XmlReadFeature .AUTO_DETECT_XSI_TYPE ));
34+ assertTrue (mapper .isEnabled (XmlWriteFeature .AUTO_DETECT_XSI_TYPE ));
35+
36+ }
2737}
You can’t perform that action at this time.
0 commit comments