encodeToString

open override fun <T> encodeToString(serializer: SerializationStrategy<T>, value: T): String(source)

Transform the object into an XML string. This requires the object to be serializable by the kotlin serialization library (either it has a built-in serializer or it is kotlinx.serialization.Serializable.

Parameters

value

The object to transform

serializer

The serializer to user


fun <T> encodeToString(serializer: SerializationStrategy<T>, value: T, prefix: String): String(source)

Transform the object into an XML string. This requires the object to be serializable by the kotlin serialization library (either it has a built-in serializer or it is kotlinx.serialization.Serializable.

Parameters

value

The object to transform

serializer

The serializer to user

prefix

The namespace prefix to use


fun <T> encodeToString(serializer: SerializationStrategy<T>, value: T, rootName: QName): String(source)

Transform the object into an XML string. This requires the object to be serializable by the kotlin serialization library (either it has a built-in serializer or it is kotlinx.serialization.Serializable.

Parameters

value

The object to transform

serializer

The serializer to user

rootName

The QName to use for the root tag


inline fun <T : Any> encodeToString(obj: T, prefix: String? = null): String(source)

Transform the object into an XML string. This requires the object to be serializable by the kotlin serialization library (either it has a built-in serializer or it is kotlinx.serialization.Serializable.

Parameters

obj

The object to transform

prefix

The namespace prefix to use


inline fun <T : Any> encodeToString(obj: T, rootName: QName): String(source)

Transform the object into an XML string. This requires the object to be serializable by the kotlin serialization library (either it has a built-in serializer or it is kotlinx.serialization.Serializable.

Parameters

obj

The object to transform

rootName

The QName to use for the root tag