Skip to content

Instantly share code, notes, and snippets.

@B0yma
Created May 4, 2020 18:27
Show Gist options
  • Save B0yma/c73e1bf5e3efc0dfcac7b49940dbca2e to your computer and use it in GitHub Desktop.
Save B0yma/c73e1bf5e3efc0dfcac7b49940dbca2e to your computer and use it in GitHub Desktop.
@Root(name="Node")
class Node (
@field:Element(name = "title", required = false)
var title: String? = null
)
val n = Node("sad")
val serializer: Serializer = Persister()
val writer = StringWriter()
try {
serializer.write(n, writer)
println(writer.toString())
} catch (e: Exception) {
println("error:$e")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment