ToJSONSubmitResultTransformer$.java
4.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.forms.transformer.impl.ToJSONSubmitResultTransformer$$anonfun
* com.adobe.forms.transformer.impl.ToJSONSubmitResultTransformer$$anonfun$transformValidationErrors
* net.liftweb.json.JsonAST
* net.liftweb.json.JsonAST$JArray
* net.liftweb.json.JsonAST$JField
* net.liftweb.json.JsonAST$JObject
* net.liftweb.json.JsonAST$JString
* net.liftweb.json.JsonAST$JValue
* net.liftweb.json.Printer
* net.liftweb.json.Printer$
* net.liftweb.json.package
* net.liftweb.json.package$
* scala.Function1
* scala.None
* scala.None$
* scala.Option
* scala.ScalaObject
* scala.Some
* scala.collection.Seq
* scala.collection.generic.CanBuildFrom
* scala.collection.immutable.List
* scala.collection.immutable.List$
* scala.collection.immutable.Nil
* scala.collection.immutable.Nil$
* scala.runtime.AbstractFunction1
* scala.text.Document
* scala.xml.Node
* scala.xml.NodeSeq
* scala.xml.XML
* scala.xml.XML$
*/
package com.adobe.forms.transformer.impl;
import com.adobe.forms.transformer.impl.ToJSONSubmitResultTransformer$;
import net.liftweb.json.JsonAST;
import net.liftweb.json.Printer;
import net.liftweb.json.package;
import scala.Function1;
import scala.None;
import scala.Option;
import scala.ScalaObject;
import scala.Some;
import scala.collection.Seq;
import scala.collection.generic.CanBuildFrom;
import scala.collection.immutable.List;
import scala.collection.immutable.Nil;
import scala.runtime.AbstractFunction1;
import scala.text.Document;
import scala.xml.Node;
import scala.xml.NodeSeq;
import scala.xml.XML;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public final class ToJSONSubmitResultTransformer$
implements ScalaObject {
public static final ToJSONSubmitResultTransformer$ MODULE$;
public static {
new com.adobe.forms.transformer.impl.ToJSONSubmitResultTransformer$();
}
public String transform(String mergedFormDom, String procInfo) {
JsonAST.JField jField = new JsonAST.JField("mergedformdom", (JsonAST.JValue)new JsonAST.JString(mergedFormDom));
JsonAST.JField jField2 = new JsonAST.JField("validationErrors", (JsonAST.JValue)this.transformValidationErrors(this.validationErrors(procInfo)));
return Printer..MODULE$.compact(package..MODULE$.render((JsonAST.JValue)new JsonAST.JObject(Nil..MODULE$.$colon$colon((Object)jField2).$colon$colon((Object)jField))));
}
public Option<Node> validationErrors(String procInfo) {
return procInfo != null && procInfo.length() > 0 ? XML..MODULE$.loadString(procInfo).$bslash("validationErrors").headOption() : None..MODULE$;
}
public JsonAST.JArray transformValidationErrors(Option<Node> validationErrors) {
Option<Node> option = validationErrors;
return option instanceof Some ? new JsonAST.JArray((List)((Node)((Some)option).x()).child().toList().map((Function1)new scala.Serializable(){
public static final long serialVersionUID;
public static {
long l = anonfun.transformValidationErrors.serialVersionUID = 0;
}
public final JsonAST.JObject apply(Node message$1) {
JsonAST.JField jField = new JsonAST.JField("text", (JsonAST.JValue)new JsonAST.JString(message$1.text()));
return new JsonAST.JObject(((List)List..MODULE$.apply((Seq)scala.Predef$.MODULE$.wrapRefArray((Object[])new String[]{"tid", "sev", "d", "ref"})).map((Function1)new scala.Serializable(this, message$1){
public static final long serialVersionUID;
private final Node message$1;
public static {
long l = com.adobe.forms.transformer.impl.ToJSONSubmitResultTransformer$$anonfun$transformValidationErrors$1$$anonfun$apply$1.serialVersionUID = 0;
}
public final JsonAST.JField apply(String attr) {
return new JsonAST.JField(attr, (JsonAST.JValue)new JsonAST.JString(this.message$1.$bslash(new scala.collection.mutable.StringBuilder().append((Object)"@").append((Object)attr).toString()).text()));
}
}, List..MODULE$.canBuildFrom())).$colon$colon((Object)jField));
}
}, List..MODULE$.canBuildFrom())) : new JsonAST.JArray((List)Nil..MODULE$);
}
private ToJSONSubmitResultTransformer$() {
MODULE$ = this;
}
}