Created
May 11, 2017 17:00
-
-
Save dgouyette/672107d2f2c0554210417e08805177af to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import jto.validation._ | |
import jto.validation.From | |
import jto.validation.xml.Rules._ | |
import scala.xml.Node | |
val rule: Rule[Node, Option[String]] = From[Node] { __ => (__ \ "MyPath" ).read[Option[String]] } | |
case class Foo( | |
v1: Option[String],v2: Option[String], | |
v3: Option[String],v4: Option[String], | |
v5: Option[String],v6: Option[String], | |
v7: Option[String],v8: Option[String], | |
v9: Option[String],v10: Option[String], | |
v11: Option[String],v12: Option[String], | |
v13: Option[String],v14: Option[String], | |
v15: Option[String],v16: Option[String], | |
v17: Option[String],v18: Option[String], | |
v19: Option[String],v20: Option[String], | |
v21: Option[String],v22: Option[String], | |
v23: Option[String] | |
) | |
val fromXmlRule: Rule[Node, Foo] = ( | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule ~ | |
rule | |
) (Foo.apply) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.