Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ScalaXB to write fixed attributes without constructor parameters #5

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions 3.3/nitf-3.3.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ case class Nitf(head: Option[com.gu.nitf.model.Head] = None,
body: com.gu.nitf.model.Body,
id: Option[String] = None,
uno: Option[String] = None,
version: String,
changeDate: String,
changeTime: String,
baselang: Option[String] = None,
classValue: Option[Seq[String]] = None)

Expand Down
9 changes: 3 additions & 6 deletions 3.3/xmlprotocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -394,21 +394,18 @@ trait XMLProtocol extends scalaxb.XMLStandardTypes {
scalaxb.fromXML[com.gu.nitf.model.Body](p2, scalaxb.ElemName(node) :: stack),
(node \ "@id").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
(node \ "@uno").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
scalaxb.fromXML[String](scala.xml.Text("-//IPTC//DTD NITF 3.3//EN"), scalaxb.ElemName(node) :: stack),
scalaxb.fromXML[String](scala.xml.Text("March 4, 2005"), scalaxb.ElemName(node) :: stack),
scalaxb.fromXML[String](scala.xml.Text("19:30"), scalaxb.ElemName(node) :: stack),
(node \ "@baselang").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
(node \ "@class").headOption map { scalaxb.fromXML[Seq[String]](_, scalaxb.ElemName(node) :: stack) }) })

override def writesAttribute(__obj: com.gu.nitf.model.Nitf, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
var attr: scala.xml.MetaData = scala.xml.Null
__obj.id foreach { x => attr = scala.xml.Attribute(null, "id", x.toString, attr) }
__obj.uno foreach { x => attr = scala.xml.Attribute(null, "uno", x.toString, attr) }
attr = scala.xml.Attribute(null, "version", __obj.version.toString, attr)
attr = scala.xml.Attribute(null, "change.date", __obj.changeDate.toString, attr)
attr = scala.xml.Attribute(null, "change.time", __obj.changeTime.toString, attr)
__obj.baselang foreach { x => attr = scala.xml.Attribute(null, "baselang", x.toString, attr) }
__obj.classValue foreach { x => attr = scala.xml.Attribute(null, "class", x.toString, attr) }
attr = scala.xml.Attribute(null, "version", "-//IPTC//DTD NITF 3.3//EN".toString, attr)
attr = scala.xml.Attribute(null, "change.date", "March 4, 2005".toString, attr)
attr = scala.xml.Attribute(null, "change.time", "19:30".toString, attr)
attr
}

Expand Down
3 changes: 0 additions & 3 deletions 3.4/nitf-3.4.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ case class Nitf(head: Option[com.gu.nitf.model.Head] = None,
body: com.gu.nitf.model.Body,
id: Option[String] = None,
uno: Option[String] = None,
version: String,
changeDate: String,
changeTime: String,
baselang: Option[String] = None,
classValue: Option[Seq[String]] = None)

Expand Down
9 changes: 3 additions & 6 deletions 3.4/xmlprotocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -394,21 +394,18 @@ trait XMLProtocol extends scalaxb.XMLStandardTypes {
scalaxb.fromXML[com.gu.nitf.model.Body](p2, scalaxb.ElemName(node) :: stack),
(node \ "@id").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
(node \ "@uno").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
scalaxb.fromXML[String](scala.xml.Text("-//IPTC//DTD NITF 3.4//EN"), scalaxb.ElemName(node) :: stack),
scalaxb.fromXML[String](scala.xml.Text("October 18, 2006"), scalaxb.ElemName(node) :: stack),
scalaxb.fromXML[String](scala.xml.Text("19:30"), scalaxb.ElemName(node) :: stack),
(node \ "@baselang").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
(node \ "@class").headOption map { scalaxb.fromXML[Seq[String]](_, scalaxb.ElemName(node) :: stack) }) })

override def writesAttribute(__obj: com.gu.nitf.model.Nitf, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
var attr: scala.xml.MetaData = scala.xml.Null
__obj.id foreach { x => attr = scala.xml.Attribute(null, "id", x.toString, attr) }
__obj.uno foreach { x => attr = scala.xml.Attribute(null, "uno", x.toString, attr) }
attr = scala.xml.Attribute(null, "version", __obj.version.toString, attr)
attr = scala.xml.Attribute(null, "change.date", __obj.changeDate.toString, attr)
attr = scala.xml.Attribute(null, "change.time", __obj.changeTime.toString, attr)
__obj.baselang foreach { x => attr = scala.xml.Attribute(null, "baselang", x.toString, attr) }
__obj.classValue foreach { x => attr = scala.xml.Attribute(null, "class", x.toString, attr) }
attr = scala.xml.Attribute(null, "version", "-//IPTC//DTD NITF 3.4//EN".toString, attr)
attr = scala.xml.Attribute(null, "change.date", "October 18, 2006".toString, attr)
attr = scala.xml.Attribute(null, "change.time", "19:30".toString, attr)
attr
}

Expand Down
3 changes: 0 additions & 3 deletions 3.5/nitf-3.5.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ case class Nitf(head: Option[com.gu.nitf.model.Head] = None,
body: com.gu.nitf.model.Body,
id: Option[String] = None,
uno: Option[String] = None,
version: String,
changeDate: String,
changeTime: String,
baselang: Option[String] = None,
classValue: Option[Seq[String]] = None)

Expand Down
9 changes: 3 additions & 6 deletions 3.5/xmlprotocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -394,21 +394,18 @@ trait XMLProtocol extends scalaxb.XMLStandardTypes {
scalaxb.fromXML[com.gu.nitf.model.Body](p2, scalaxb.ElemName(node) :: stack),
(node \ "@id").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
(node \ "@uno").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
scalaxb.fromXML[String](scala.xml.Text("-//IPTC//DTD NITF 3.5//EN"), scalaxb.ElemName(node) :: stack),
scalaxb.fromXML[String](scala.xml.Text("September 11, 2009"), scalaxb.ElemName(node) :: stack),
scalaxb.fromXML[String](scala.xml.Text("12:26"), scalaxb.ElemName(node) :: stack),
(node \ "@baselang").headOption map { scalaxb.fromXML[String](_, scalaxb.ElemName(node) :: stack) },
(node \ "@class").headOption map { scalaxb.fromXML[Seq[String]](_, scalaxb.ElemName(node) :: stack) }) })

override def writesAttribute(__obj: com.gu.nitf.model.Nitf, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
var attr: scala.xml.MetaData = scala.xml.Null
__obj.id foreach { x => attr = scala.xml.Attribute(null, "id", x.toString, attr) }
__obj.uno foreach { x => attr = scala.xml.Attribute(null, "uno", x.toString, attr) }
attr = scala.xml.Attribute(null, "version", __obj.version.toString, attr)
attr = scala.xml.Attribute(null, "change.date", __obj.changeDate.toString, attr)
attr = scala.xml.Attribute(null, "change.time", __obj.changeTime.toString, attr)
__obj.baselang foreach { x => attr = scala.xml.Attribute(null, "baselang", x.toString, attr) }
__obj.classValue foreach { x => attr = scala.xml.Attribute(null, "class", x.toString, attr) }
attr = scala.xml.Attribute(null, "version", "-//IPTC//DTD NITF 3.5//EN".toString, attr)
attr = scala.xml.Attribute(null, "change.date", "September 11, 2009".toString, attr)
attr = scala.xml.Attribute(null, "change.time", "12:26".toString, attr)
attr
}

Expand Down
Loading