XmlSerializationPolicy

Policies allow for customizing the behaviour of the xml serialization

Inheritors

Types

Link copied to clipboard
data class ActualNameInfo(val serialName: String, val annotatedName: QName)
Link copied to clipboard
object Companion
Link copied to clipboard
data class DeclaredNameInfo(val serialName: String, val annotatedName: QName?, val isDefaultNamespace: Boolean)

Class holding the name information for either an attribute or type

Properties

Link copied to clipboard

The default output kind used for objects (including Unit). By default this is as element. Note that objects by default do not have elements.

Link copied to clipboard

The default output kind used for (effective) primitives (inline values are elided). By default this is as attribute.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Serialize float/double data according to the requirements of XML, rather than the toFloat/Float.toString/toDouble/Double.toString function from the Kotlin standard library.

Functions

Link copied to clipboard

Determine the delimiters to use to separate attributes. When writing will always write the first element.

Link copied to clipboard
Link copied to clipboard
abstract fun effectiveName(serializerParent: SafeParentInfo, tagParent: SafeParentInfo, outputKind: OutputKind, useName: XmlSerializationPolicy.DeclaredNameInfo = tagParent.elementUseNameInfo): QName
Link copied to clipboard
abstract fun effectiveOutputKind(serializerParent: SafeParentInfo, tagParent: SafeParentInfo, canBeAttribute: Boolean): OutputKind
Link copied to clipboard

Determine namespace prefixes to make sure are set upon the tag.

Link copied to clipboard
open fun enumEncoding(enumDescriptor: SerialDescriptor, index: Int): String
Link copied to clipboard
open fun handleAttributeOrderConflict(serializerParent: SafeParentInfo, tagParent: SafeParentInfo, outputKind: OutputKind): OutputKind
Link copied to clipboard
abstract fun handleUnknownContentRecovering(input: XmlReader, inputKind: InputKind, descriptor: XmlDescriptor, name: QName?, candidates: Collection<Any>): List<XML.ParsedData<*>>

Allows for recovering from unknown content. The implementation must either throw an exception or consume the content (parse it completely). It can allow recovery by returning a list of data that should be recovered (this can allow further parsing of the data or return final values).

Link copied to clipboard
abstract fun ignoredSerialInfo(message: String)
Link copied to clipboard

Allow modifying the ordering of children.

Link copied to clipboard
open fun invalidOutputKind(message: String)
Link copied to clipboard
open fun isInlineCollapsed(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Boolean

Determines whether inline classes are merged with their content. Note that inline classes may still determine the tag name used for the data even if the actual contents come from the child content. The actual name used is ultimately determined by the policy.

Link copied to clipboard
abstract fun isListEluded(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Boolean
Link copied to clipboard
open fun isMapValueCollapsed(mapParent: SafeParentInfo, valueDescriptor: XmlDescriptor): Boolean

Determine whether the key attribute should be collapsed into the value tag rather than the value being nested in a container for the element.

Link copied to clipboard
abstract fun isTransparentPolymorphic(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Boolean
Link copied to clipboard
open fun mapEntryName(serializerParent: SafeParentInfo, isListEluded: Boolean): QName

Determine the name to use for the map element (only used when a map entry is wrapped)

Link copied to clipboard

Determine the name of map keys for a given map type

Link copied to clipboard

Determine the name of the values for a given map type

Link copied to clipboard
open fun onElementRepeated(parentDescriptor: XmlDescriptor, childIndex: Int)
Link copied to clipboard
open fun overrideSerializerOrNull(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): KSerializer<*>?
Link copied to clipboard
abstract fun polymorphicDiscriminatorName(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): QName?
Link copied to clipboard
Link copied to clipboard
abstract fun serialTypeNameToQName(typeNameInfo: XmlSerializationPolicy.DeclaredNameInfo, parentNamespace: Namespace): QName
Link copied to clipboard
abstract fun serialUseNameToQName(useNameInfo: XmlSerializationPolicy.DeclaredNameInfo, parentNamespace: Namespace): QName
Link copied to clipboard
abstract fun shouldEncodeElementDefault(elementDescriptor: XmlDescriptor?): Boolean
Link copied to clipboard

Determine the delimiters to use to separate primitive/textual list elements when use inside an element. When writing will always write the first element.

Link copied to clipboard