XHTMLUtility$.java
13.5 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.forms.transformer.XHTMLUtility$$anonfun
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe$forms
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe$forms$transformer
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe$forms$transformer$XHTMLUtility
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe$forms$transformer$XHTMLUtility$
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe$forms$transformer$XHTMLUtility$$toHTMLString
* com.adobe.forms.transformer.XHTMLUtility$$anonfun$sequenceToXML
* scala.Function1
* scala.Predef
* scala.Predef$
* scala.ScalaObject
* scala.collection.Iterator
* scala.collection.Seq
* scala.collection.immutable.List
* scala.collection.immutable.List$
* scala.collection.mutable.StringBuilder
* scala.collection.mutable.WrappedArray
* scala.runtime.AbstractFunction1
* scala.runtime.BoxedUnit
* scala.xml.Comment
* scala.xml.Group
* scala.xml.MetaData
* scala.xml.NamespaceBinding
* scala.xml.Node
* scala.xml.SpecialNode
* scala.xml.Text
* scala.xml.TopScope
* scala.xml.TopScope$
*/
package com.adobe.forms.transformer;
import com.adobe.forms.transformer.XHTMLUtility$;
import scala.Function1;
import scala.Predef;
import scala.ScalaObject;
import scala.collection.Iterator;
import scala.collection.Seq;
import scala.collection.immutable.List;
import scala.collection.mutable.StringBuilder;
import scala.collection.mutable.WrappedArray;
import scala.runtime.AbstractFunction1;
import scala.runtime.BoxedUnit;
import scala.xml.Comment;
import scala.xml.Group;
import scala.xml.MetaData;
import scala.xml.NamespaceBinding;
import scala.xml.Node;
import scala.xml.SpecialNode;
import scala.xml.Text;
import scala.xml.TopScope;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public final class XHTMLUtility$
implements ScalaObject {
public static final XHTMLUtility$ MODULE$;
private final List<Object> com$adobe$forms$transformer$XHTMLUtility$$SPACE_CHARS;
public static {
new com.adobe.forms.transformer.XHTMLUtility$();
}
/*
* Unable to fully structure code
* Enabled aggressive block sorting
* Lifted jumps to return sites
*/
public String escapeHtmlAttrib(String text, boolean isDoubleQuote$1) {
s = new StringBuilder();
len = text.length();
pos = 0;
while (pos < len) {
var6_6 = text.charAt(pos);
switch (var6_6) {
default: {
var7_7 = var6_6;
** GOTO lbl21
}
case '\'': {
if (!this.gd1$1(isDoubleQuote$1)) ** GOTO lbl14
v0 = s.append("'");
** GOTO lbl34
lbl14: // 1 sources:
var7_7 = var6_6;
** GOTO lbl21
}
case '\"': {
if (this.gd2$1(isDoubleQuote$1)) {
v0 = s.append(""");
} else {
c = var6_6;
lbl21: // 3 sources:
v0 = c >= ' ' ? s.append(c) : BoxedUnit.UNIT;
}
** GOTO lbl34
}
case '\r': {
v0 = s.append('\r');
** GOTO lbl34
}
case '\t': {
v0 = s.append('\t');
** GOTO lbl34
}
case '&': {
v0 = s.append("&");
** GOTO lbl34
}
case '\n':
}
v0 = s.append('\n');
lbl34: // 7 sources:
++pos;
}
return s.toString();
}
public boolean escapeHtmlAttrib$default$2() {
return false;
}
public String toHTML(Node x) {
return this.com$adobe$forms$transformer$XHTMLUtility$$toHTMLString(x, this.toHTMLString$default$2(), this.toHTMLString$default$3(), this.toHTMLString$default$4(), this.toHTMLString$default$5(), this.toHTMLString$default$6(), this.toHTMLString$default$7()).toString();
}
public final List<Object> com$adobe$forms$transformer$XHTMLUtility$$SPACE_CHARS() {
return this.com$adobe$forms$transformer$XHTMLUtility$$SPACE_CHARS;
}
public final StringBuilder com$adobe$forms$transformer$XHTMLUtility$$toHTMLString(Node x$4, NamespaceBinding pscope, StringBuilder sb$1, boolean stripComments$1, boolean decodeEntities$1, boolean preserveWhitespace$1, boolean minimizeTags$1) {
StringBuilder stringBuilder;
Node node = x$4;
if (node instanceof Comment) {
stringBuilder = stripComments$1 ? sb$1 : ((Comment)node).buildString(sb$1);
} else if (node instanceof SpecialNode) {
stringBuilder = ((SpecialNode)node).buildString(sb$1);
} else if (node instanceof Group) {
((Group)node).nodes().foreach((Function1)new scala.Serializable(x$4, sb$1, stripComments$1, decodeEntities$1, preserveWhitespace$1, minimizeTags$1){
public static final long serialVersionUID;
private final Node x$4;
private final StringBuilder sb$1;
private final boolean stripComments$1;
private final boolean decodeEntities$1;
private final boolean preserveWhitespace$1;
private final boolean minimizeTags$1;
public static {
long l = anonfun.com.adobe.forms.transformer.XHTMLUtility..toHTMLString.serialVersionUID = 0;
}
public final StringBuilder apply(Node node) {
return XHTMLUtility$.MODULE$.com$adobe$forms$transformer$XHTMLUtility$$toHTMLString(node, this.x$4.scope(), this.sb$1, this.stripComments$1, this.decodeEntities$1, this.preserveWhitespace$1, this.minimizeTags$1);
}
});
stringBuilder = sb$1;
} else {
sb$1.append('<');
x$4.nameToString(sb$1);
if (x$4.attributes() != null) {
x$4.attributes().foreach((Function1)new scala.Serializable(sb$1){
public static final long serialVersionUID;
private final StringBuilder sb$1;
public static {
long l = anonfun.com.adobe.forms.transformer.XHTMLUtility..toHTMLString.serialVersionUID = 0;
}
public final Object apply(MetaData attr) {
BoxedUnit boxedUnit;
String k = attr.prefixedKey();
if (k.isEmpty()) {
boxedUnit = BoxedUnit.UNIT;
} else if (attr.value() == null || attr.value().isEmpty()) {
boxedUnit = BoxedUnit.UNIT;
} else {
String v = scala.xml.NodeSeq$.MODULE$.seqToNodeSeq(attr.value()).text().trim();
if (v.isEmpty()) {
boxedUnit = BoxedUnit.UNIT;
} else {
this.sb$1.append(' ');
this.sb$1.append(XHTMLUtility$.MODULE$.escapeHtmlAttrib(k, XHTMLUtility$.MODULE$.escapeHtmlAttrib$default$2()));
this.sb$1.append('=');
boolean dq = Predef..MODULE$.augmentString(v).contains((Object)scala.runtime.BoxesRunTime.boxToCharacter((char)'\"'));
boolean sq = Predef..MODULE$.augmentString(v).contains((Object)scala.runtime.BoxesRunTime.boxToCharacter((char)'\''));
boolean sch = Predef..MODULE$.augmentString(v).exists((Function1)new scala.Serializable(this){
public static final long serialVersionUID;
public static {
long l = com.adobe.forms.transformer.XHTMLUtility$$anonfun$com$adobe$forms$transformer$XHTMLUtility$$toHTMLString$2$$anonfun$1.serialVersionUID = 0;
}
public final boolean apply(char c) {
return XHTMLUtility$.MODULE$.com$adobe$forms$transformer$XHTMLUtility$$SPACE_CHARS().contains((Object)scala.runtime.BoxesRunTime.boxToCharacter((char)c));
}
});
if (dq || sq || sch) {
if (dq) {
this.sb$1.append('\'');
this.sb$1.append(XHTMLUtility$.MODULE$.escapeHtmlAttrib(v, XHTMLUtility$.MODULE$.escapeHtmlAttrib$default$2()));
boxedUnit = this.sb$1.append('\'');
} else {
this.sb$1.append('\"');
this.sb$1.append(XHTMLUtility$.MODULE$.escapeHtmlAttrib(v, true));
boxedUnit = this.sb$1.append('\"');
}
} else {
boxedUnit = this.sb$1.append(XHTMLUtility$.MODULE$.escapeHtmlAttrib(v, XHTMLUtility$.MODULE$.escapeHtmlAttrib$default$2()));
}
}
}
return boxedUnit;
}
});
}
x$4.scope().buildString(sb$1, pscope);
if (x$4.child().isEmpty() && minimizeTags$1) {
stringBuilder = sb$1.append(" />");
} else {
sb$1.append('>');
this.sequenceToXML(x$4.child(), x$4.scope(), sb$1, stripComments$1, decodeEntities$1, preserveWhitespace$1, minimizeTags$1);
sb$1.append("</");
x$4.nameToString(sb$1);
stringBuilder = sb$1.append('>');
}
}
return stringBuilder;
}
private boolean toHTMLString$default$7() {
return true;
}
private boolean toHTMLString$default$6() {
return false;
}
private boolean toHTMLString$default$5() {
return true;
}
private boolean toHTMLString$default$4() {
return true;
}
private StringBuilder toHTMLString$default$3() {
return new StringBuilder();
}
private NamespaceBinding toHTMLString$default$2() {
return TopScope..MODULE$;
}
public final boolean com$adobe$forms$transformer$XHTMLUtility$$isAtomAndNotText(Node x) {
return x.isAtom() && !(x instanceof Text);
}
public void sequenceToXML(Seq<Node> children, NamespaceBinding pscope$1, StringBuilder sb$2, boolean stripComments$2, boolean decodeEntities$2, boolean preserveWhitespace$2, boolean minimizeTags$2) {
if (children.isEmpty()) {
return;
}
if (children.forall((Function1)new scala.Serializable(){
public static final long serialVersionUID;
public static {
long l = anonfun.sequenceToXML.serialVersionUID = 0;
}
public final boolean apply(Node node) {
return XHTMLUtility$.MODULE$.com$adobe$forms$transformer$XHTMLUtility$$isAtomAndNotText(node);
}
})) {
Iterator it = children.iterator();
Node f = (Node)it.next();
this.com$adobe$forms$transformer$XHTMLUtility$$toHTMLString(f, pscope$1, sb$2, stripComments$2, decodeEntities$2, preserveWhitespace$2, minimizeTags$2);
while (it.hasNext()) {
Node x = (Node)it.next();
sb$2.append(' ');
this.com$adobe$forms$transformer$XHTMLUtility$$toHTMLString(x, pscope$1, sb$2, stripComments$2, decodeEntities$2, preserveWhitespace$2, minimizeTags$2);
}
} else {
children.foreach((Function1)new scala.Serializable(pscope$1, sb$2, stripComments$2, decodeEntities$2, preserveWhitespace$2, minimizeTags$2){
public static final long serialVersionUID;
private final NamespaceBinding pscope$1;
private final StringBuilder sb$2;
private final boolean stripComments$2;
private final boolean decodeEntities$2;
private final boolean preserveWhitespace$2;
private final boolean minimizeTags$2;
public static {
long l = anonfun.sequenceToXML.serialVersionUID = 0;
}
public final StringBuilder apply(Node node) {
return XHTMLUtility$.MODULE$.com$adobe$forms$transformer$XHTMLUtility$$toHTMLString(node, this.pscope$1, this.sb$2, this.stripComments$2, this.decodeEntities$2, this.preserveWhitespace$2, this.minimizeTags$2);
}
});
}
}
private final boolean gd1$1(boolean bl) {
return !bl;
}
private final boolean gd2$1(boolean bl) {
return bl;
}
private XHTMLUtility$() {
MODULE$ = this;
this.com$adobe$forms$transformer$XHTMLUtility$$SPACE_CHARS = List..MODULE$.apply((Seq)Predef..MODULE$.wrapCharArray(new char[]{' ', '\t', '\r', '\n', '\f'}));
}
}