Created
May 4, 2020 18:27
-
-
Save B0yma/c73e1bf5e3efc0dfcac7b49940dbca2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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