-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhael Sokolov
committed
Apr 12, 2022
1 parent
078a6be
commit dacb1e3
Showing
4 changed files
with
42 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...otlin/ru/sokomishalov/jackson/dataformat/soap/AlwaysUseNamespacesXmlSerializerProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package ru.sokomishalov.jackson.dataformat.soap | ||
|
||
import com.fasterxml.jackson.databind.SerializationConfig | ||
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider | ||
import com.fasterxml.jackson.databind.ser.SerializerFactory | ||
import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator | ||
import com.fasterxml.jackson.dataformat.xml.ser.XmlSerializerProvider | ||
import com.fasterxml.jackson.dataformat.xml.util.XmlRootNameLookup | ||
import javax.xml.XMLConstants.NULL_NS_URI | ||
import javax.xml.namespace.QName | ||
|
||
internal class AlwaysUseNamespacesXmlSerializerProvider : XmlSerializerProvider { | ||
|
||
internal constructor() : super(XmlRootNameLookup()) | ||
internal constructor(src: XmlSerializerProvider, config: SerializationConfig?, f: SerializerFactory?) : super(src, config, f) | ||
|
||
override fun createInstance(config: SerializationConfig?, jsf: SerializerFactory?): DefaultSerializerProvider { | ||
return AlwaysUseNamespacesXmlSerializerProvider(this, config, jsf) | ||
} | ||
|
||
override fun _initWithRootName(xgen: ToXmlGenerator, rootName: QName?) { | ||
super._initWithRootName(xgen, rootName) | ||
xgen.staxWriter.setDefaultNamespace(NULL_NS_URI) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters