FormModelScript.java
2.95 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.form;
import com.adobe.xfa.Arg;
import com.adobe.xfa.Element;
import com.adobe.xfa.ModelScript;
import com.adobe.xfa.Node;
import com.adobe.xfa.NodeList;
import com.adobe.xfa.Obj;
import com.adobe.xfa.ScriptFuncObj;
import com.adobe.xfa.ScriptPropObj;
import com.adobe.xfa.ScriptTable;
import com.adobe.xfa.form.FormModel;
import com.adobe.xfa.ut.ExFull;
import com.adobe.xfa.ut.ResId;
public class FormModelScript
extends ModelScript {
protected static final ScriptTable moScriptTable = new ScriptTable(ModelScript.moScriptTable, "formModel", null, new ScriptFuncObj[]{new ScriptFuncObj(FormModelScript.class, "recalculate", "recalculate", 1, new int[]{3}, 1, 21, 9, 0), new ScriptFuncObj(FormModelScript.class, "execCalculate", "execCalculate", 1, new int[0], 0, 21, 63, 0), new ScriptFuncObj(FormModelScript.class, "execValidate", "execValidate", 3, new int[0], 0, 21, 63, 0), new ScriptFuncObj(FormModelScript.class, "execInitialize", "execInitialize", 1, new int[0], 0, 21, 63, 0), new ScriptFuncObj(FormModelScript.class, "remerge", "remerge", 1, new int[0], 0, 21, 9, 0), new ScriptFuncObj(FormModelScript.class, "formNodes", "formNodes", 7, new int[]{7}, 1, 21, 9, 0), new ScriptFuncObj(FormModelScript.class, "metaData", "metaData", 6, new int[0], 0, 26, 9, 0)});
public static ScriptTable getScriptTable() {
return moScriptTable;
}
public static void recalculate(Obj obj, Arg retVal, Arg[] args) {
FormModel formModel = (FormModel)obj;
FormModel.Validate validate = formModel.getDefaultValidate();
formModel.recalculate(args[0].getBool(), validate, false);
}
public static void execCalculate(Obj obj, Arg retVal, Arg[] args) {
FormModel formModel = (FormModel)obj;
FormModel.Validate validate = formModel.getDefaultValidate();
formModel.recalculate(true, validate, false);
}
public static void execValidate(Obj obj, Arg retVal, Arg[] args) {
FormModel formModel = (FormModel)obj;
FormModel.Validate validate = formModel.getDefaultValidate();
formModel.validate(validate, null, true, false);
if (validate != null && validate.getFailCount() > 0) {
retVal.setBool(Boolean.FALSE);
} else {
retVal.setBool(Boolean.TRUE);
}
}
public static void execInitialize(Obj obj, Arg retVal, Arg[] args) {
((FormModel)obj).initialize();
}
public static void remerge(Obj obj, Arg retVal, Arg[] args) {
((FormModel)obj).remerge();
}
public static void formNodes(Obj obj, Arg retVal, Arg[] args) {
Obj object = args[0].getObject();
if (!(object instanceof Node)) {
throw new ExFull(ResId.ArgumentMismatchException);
}
retVal.setObject(((FormModel)obj).getFormNodes((Node)object));
}
public static void metaData(Obj obj, Arg retVal, Arg[] args) {
retVal.setString(((FormModel)obj).metaData(0));
}
}