Add rss and text tags to outline when serializing opml

This commit is contained in:
Shinokuni 2019-11-10 21:48:36 +01:00
parent 35d520169f
commit 1f41cb974a
4 changed files with 13 additions and 1 deletions

View File

@ -6,5 +6,8 @@ import org.simpleframework.xml.Root
@Root(name = "body", strict = false)
data class Body(@field:ElementList(inline = true, required = true) var outlines: List<Outline>?) {
/**
* empty constructor required by SimpleXMl
*/
constructor() : this(null)
}

View File

@ -6,5 +6,8 @@ import org.simpleframework.xml.Root
@Root(name = "head", strict = false)
data class Head(@field:Element(required = false) var title: String?) {
/**
* empty constructor required by SimpleXML
*/
constructor() : this(null)
}

View File

@ -11,6 +11,9 @@ data class OPML(@field:Attribute(required = true) var version: String?,
@field:Element(required = true) var head: Head?,
@field:Element(required = true) var body: Body?) {
/**
* empty constructor required by SimpleXML
*/
constructor() : this(null, null, null)
}

View File

@ -12,6 +12,9 @@ data class Outline(@field:Attribute(required = false) var title: String?,
@field:Attribute(required = false) var htmlUrl: String?,
@field:ElementList(inline = true, required = false) var outlines: List<Outline>?) {
/**
* empty constructor required by SimpleXML
*/
constructor() : this(
null,
null,
@ -22,5 +25,5 @@ data class Outline(@field:Attribute(required = false) var title: String?,
constructor(title: String) : this(title, null, null, null, null, null)
constructor(title: String, xmlUrl: String, htmlUrl: String) : this(title, null, null, xmlUrl, htmlUrl, null)
constructor(title: String, xmlUrl: String, htmlUrl: String) : this(title, title, "rss", xmlUrl, htmlUrl, null)
}