Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
abstract class FormatCache
Link copied to clipboard
Link copied to clipboard

This class is still here to stop breaking functionality.

Link copied to clipboard
typealias NonRecoveryUnknownChildHandler = (input: XmlReader, inputKind: InputKind, name: QName?, candidates: Collection<Any>) -> Unit
Link copied to clipboard
Link copied to clipboard
data class PolyInfo(val tagName: QName, val index: Int, val descriptor: XmlDescriptor)

Helper class that collates information used in matching tags with types.

Link copied to clipboard
Link copied to clipboard
fun interface UnknownChildHandler
Link copied to clipboard
class UnknownXmlFieldException(val extLocationInfo: XmlReader.LocationInfo?, xmlName: String, candidates: Collection<Any> = emptyList()) : XmlSerialException
Link copied to clipboard
annotation class WillBePrivate
Link copied to clipboard
class XML(val config: XmlConfig, serializersModule: SerializersModule = EmptySerializersModule()) : StringFormat

Class that provides access to XML parsing and serialization for the Kotlin Serialization system. In most cases the companion functions would be used. Creating an object explicitly however allows for the serialization to be configured.

Link copied to clipboard
annotation class XmlAfter(val value: String)

Require this property to be serialized after other (sibling) properties. The names are the serialNames of the properties being serialized (not XML names).

Link copied to clipboard
annotation class XmlBefore(val value: String)

Require this property to be serialized before other (sibling) properties. The names are the serialNames of the properties being serialized (not XML names). Together XmlBefore and XmlAfter define a partial order over the properties.

Link copied to clipboard
annotation class XmlCData(val value: Boolean = true)

Mark the property for serialization as CData, rather than text (where appropriate). It also means that the value is not written as attribute.

Link copied to clipboard
annotation class XmlChildrenName(val value: String, val namespace: String = UNSET_ANNOTATION_VALUE, val prefix: String = UNSET_ANNOTATION_VALUE)

Specify additional information about child values. This is only used for primitives, not for classes that have their own independent name

Link copied to clipboard
class XmlConfig

Configuration for the xml parser.

Link copied to clipboard
annotation class XmlDefault(val value: String)

Allow a property to be omitted with a default serialized string

Link copied to clipboard
annotation class XmlElement(val value: Boolean = true)

Force a property that could be an attribute to be an element

Link copied to clipboard
annotation class XmlId

Annotation to mark the value as an ID attribute. This implies that the element is an attribute.

Link copied to clipboard
annotation class XmlIgnoreWhitespace(val value: Boolean = true)

Determine whether whitespace should be ignored or preserved for the tag.

Link copied to clipboard

Annotation allowing to specify namespaces specifications to be generated upon the element. As multiple annotations are not supported by the plugin this uses a single string. The string separates the namespaces using a semicolon (;). Each declaration is of the form (prefix)=(namespace). To specify the default namespace it is valid to omit the equals sign.

Link copied to clipboard
annotation class XmlOtherAttributes

This annotation allows handling wildcard attributes. The key is preferred to be a QName, alternatively it must convert to String (this could be "prefix:localName"). The value must be a String type. Note that if the key runtime type is a QName the value is directly used as attribute name without using the key serializer.

Link copied to clipboard
class XmlParsingException(val extLocationInfo: XmlReader.LocationInfo?, message: String, cause: Exception? = null) : XmlSerialException
Link copied to clipboard
annotation class XmlPolyChildren(val value: Array<String>)

Indicate the valid poly children for this element

Link copied to clipboard
open class XmlSerialException(message: String, val extLocationInfo: XmlReader.LocationInfo?, cause: Throwable? = null) : SerializationException
Link copied to clipboard
Link copied to clipboard
annotation class XmlSerialName(val value: String = UNSET_ANNOTATION_VALUE, val namespace: String = UNSET_ANNOTATION_VALUE, val prefix: String = UNSET_ANNOTATION_VALUE)

Specify more detailed name information than can be provided by kotlinx.serialization.SerialName.

Link copied to clipboard
annotation class XmlValue(val value: Boolean = true)

Force a property to be content of the tag. This is both for text content, but if the type is a list of tag-like types (Node, Element, CompactFragment it will also allow mixed content) of tags not supported by the base type.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun XmlSerialName.toQName(serialName: String, parentNamespace: Namespace?): QName
Link copied to clipboard