XmlCompanion
abstract class XmlCompanion<B : XmlConfig.Builder<out XmlSerializationPolicy?>> : StringFormat(source)
Functions
Link copied to clipboard
Shortcut function that creates a format instance that is compact. Note that this is a shortcut for calling recommended { compact() }, for reconfiguration that should be used.
Link copied to clipboard
inline fun <P : XmlSerializationPolicy> customPolicy(policy: P, serializersModule: SerializersModule = EmptySerializersModule(), configure: XmlConfig.CustomBuilder<P>.() -> Unit): XML
Create a configuration corresponding to a custom xml serialization policy.
Link copied to clipboard
fun <T : Any> decodeFromReader(deserializer: DeserializationStrategy<T>, reader: XmlReader, rootName: QName? = null): T
Parse an object of the type T out of the reader
Link copied to clipboard
fun <T> decodeFromStream(deserializer: DeserializationStrategy<T>, source: Reader, rootName: QName): T
Link copied to clipboard
fun <T> XML.XmlCompanion<*>.decodeFromStream(deserializer: DeserializationStrategy<T>, source: InputStream, rootName: QName): T
fun <T> XML.XmlCompanion<*>.decodeFromStream(deserializer: DeserializationStrategy<T>, source: InputStream, encoding: String, rootName: QName): T
Link copied to clipboard
fun <T> decodeFromString(deserializer: DeserializationStrategy<T>, string: String, rootName: QName?): T
Parse an object of the type T out of the reader
Link copied to clipboard
fun <T> encodeToStream(target: Writer, serializer: SerializationStrategy<T>, value: T, rootName: QName)
Link copied to clipboard
inline fun <T> XML.XmlCompanion<*>.encodeToStream(target: OutputStream, value: T, prefix: String? = null)
fun <T> XML.XmlCompanion<*>.encodeToStream(target: OutputStream, serializer: SerializationStrategy<T>, value: T, rootName: QName)
fun <T> XML.XmlCompanion<*>.encodeToStream(target: OutputStream, serializer: SerializationStrategy<T>, value: T, prefix: String? = null)
fun <T> XML.XmlCompanion<*>.encodeToStream(target: OutputStream, encoding: String, serializer: SerializationStrategy<T>, value: T, rootName: QName)
fun <T> XML.XmlCompanion<*>.encodeToStream(target: OutputStream, encoding: String, serializer: SerializationStrategy<T>, value: T, prefix: String? = null)
Link copied to clipboard
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 Serializable.
Link copied to clipboard
fun <T> encodeToWriter(target: XmlWriter, serializer: SerializationStrategy<T>, value: T, prefix: String? = null)
fun <T> encodeToWriter(target: XmlWriter, serializer: SerializationStrategy<T>, value: T, rootName: QName)
Write the object to the given writer
Link copied to clipboard
