DefaultXmlSerializationPolicy

Default implementation of a serialization policy that provides a behaviour that attempts to create an XML format that resembles what would be created manually in line with XML's design.

Constructors

Link copied to clipboard
constructor(original: XmlSerializationPolicy?)
constructor(formatCache: FormatCache, config: DefaultXmlSerializationPolicy.Builder.() -> Unit)

Types

Link copied to clipboard
open class Builder

A configuration builder for the default serialization policy.

Properties

Link copied to clipboard

Should polymorphic information be retrieved using SerializersModule configuration. This replaces

Link copied to clipboard
Link copied to clipboard

Determine whether defaults need to be encoded

Link copied to clipboard
open override val isStrictAttributeNames: Boolean

Process attribute name reading strictly according to the XML standard, or a name handling that is a bit more lenient

Link copied to clipboard
open override val isStrictBoolean: Boolean

Parse boolean data according to the requirements of XML, rather than the (very lenient) toBoolean function from the Kotlin standard library.

Link copied to clipboard
open override val isStrictOtherAttributes: Boolean
Link copied to clipboard

Enable some stricter behaviour

Link copied to clipboard

When a single-value elemement is repeated in the content, will this throw an exception or only retain the final value

Link copied to clipboard

When set, use a type discriminator property

Link copied to clipboard

A function that is called when an unknown child is found. By default an exception is thrown

Link copied to clipboard
open override val verifyElementOrder: Boolean

Verify that element children are in the order required by order annotations (and fail if not correct). Note that attribute order in XML is arbitrary and not meaningful.

Functions

Link copied to clipboard
open fun attributeListDelimiters(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Array<String>

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

Link copied to clipboard

Create a builder for this policy. This function allows subclasses to have their own configuration.

Link copied to clipboard

Create a copy of this configuration with the changes specified through the config parameter.

Link copied to clipboard
open fun defaultOutputKind(serialKind: SerialKind): OutputKind
Link copied to clipboard
open override fun effectiveName(serializerParent: SafeParentInfo, tagParent: SafeParentInfo, outputKind: OutputKind, useName: XmlSerializationPolicy.DeclaredNameInfo): QName
Link copied to clipboard
open override fun effectiveOutputKind(serializerParent: SafeParentInfo, tagParent: SafeParentInfo, canBeAttribute: Boolean): OutputKind
Link copied to clipboard
open override fun elementNamespaceDecls(serializerParent: SafeParentInfo): List<Namespace>

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
open override fun handleUnknownContentRecovering(input: XmlReader, inputKind: InputKind, descriptor: XmlDescriptor, name: QName?, candidates: Collection<Any>): List<XML.ParsedData<*>>
Link copied to clipboard
open override fun ignoredSerialInfo(message: String)
Link copied to clipboard

Default implementation that uses XmlBefore and XmlAfter. It does not use the parent descriptor at all.

Link copied to clipboard
open fun invalidOutputKind(message: String)
Link copied to clipboard
open override fun isListEluded(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Boolean
Link copied to clipboard
open override 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
open override fun isTransparentPolymorphic(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Boolean
Link copied to clipboard
open override 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
open override fun mapValueName(serializerParent: SafeParentInfo, isListEluded: Boolean): XmlSerializationPolicy.DeclaredNameInfo

Determine the name of the values for a given map type

Link copied to clipboard
open override fun onElementRepeated(parentDescriptor: XmlDescriptor, childIndex: Int)
Link copied to clipboard
open override fun overrideSerializerOrNull(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): KSerializer<*>?
Link copied to clipboard
open override fun polymorphicDiscriminatorName(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): QName?
Link copied to clipboard
open override fun preserveSpace(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun shouldEncodeElementDefault(elementDescriptor: XmlDescriptor?): Boolean
Link copied to clipboard
open fun textListDelimiters(serializerParent: SafeParentInfo, tagParent: SafeParentInfo): Array<String>

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