NodeScript.java
4.66 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa;
import com.adobe.xfa.*;
public class NodeScript
extends ObjScript {
protected static final ScriptTable moScriptTable = new ScriptTable(ObjScript.moScriptTable, "node", new ScriptPropObj[]{new ScriptPropObj(NodeScript.class, "nodes", "getNodes", null, 7, 10, 9, 0), new ScriptPropObj(NodeScript.class, "name", "getName", "setName", 6, 10, 63, 0), new ScriptPropObj(NodeScript.class, "parent", "getParent", null, 7, 10, 9, 0), new ScriptPropObj(NodeScript.class, "index", "getIndex", null, 4, 10, 9, 0), new ScriptPropObj(NodeScript.class, "classIndex", "classIndex", null, 4, 10, 9, 0), new ScriptPropObj(NodeScript.class, "all", "getAll", null, 7, 10, 9, 0), new ScriptPropObj(NodeScript.class, "classAll", "classAll", null, 7, 10, 9, 0), new ScriptPropObj(NodeScript.class, "somExpression", "getSomExpression", null, 6, 10, 9, 0), new ScriptPropObj(NodeScript.class, "isContainer", "isContainer", null, 3, 10, 9, 0), new ScriptPropObj(NodeScript.class, "model", "getModel", null, 7, 10, 9, 0)}, new ScriptFuncObj[]{new ScriptFuncObj(NodeScript.class, "resolveNode", "resolveNode", 7, new int[]{6}, 1, 10, 63, 0), new ScriptFuncObj(NodeScript.class, "resolveNodes", "resolveNodes", 7, new int[]{6}, 1, 10, 63, 0)});
public static ScriptTable getScriptTable() {
return moScriptTable;
}
public static void classAll(Obj pObj, Arg oRetVal) {
oRetVal.setObject(((Node)pObj).getAll(false), false, true);
}
public static void classIndex(Obj pObj, Arg oRetVal) {
oRetVal.setInteger(((Node)pObj).getIndex(false));
}
public static void getAll(Obj pObj, Arg oRetVal) {
oRetVal.setObject(((Node)pObj).getAll(true), false, true);
}
public static void getIndex(Obj pObj, Arg oRetVal) {
oRetVal.setInteger(((Node)pObj).getIndex(true));
}
public static void getModel(Obj pObj, Arg oRetVal) {
oRetVal.setObject(((Node)pObj).getModel());
}
public static void getName(Obj pObj, Arg oRetVal) {
oRetVal.setString(((Node)pObj).getName());
}
public static void getNodes(Obj pObj, Arg oRetVal) {
oRetVal.setObject(((Node)pObj).getNodes(), false, true);
}
public static void getParent(Obj pObj, Arg oRetVal) {
oRetVal.setObject(((Node)pObj).getXFAParent(), false, true);
}
public static void getSomExpression(Obj pObj, Arg oRetVal) {
oRetVal.setString(((Node)pObj).getSOMExpression());
}
public static void isContainer(Obj pObj, Arg oRetVal) {
oRetVal.setBool(((Node)pObj).isContainer());
}
public static void setName(Obj pObj, Arg oArg) {
((Node)pObj).setName(oArg.getString());
}
public static void resolveNode(Obj pObj, Arg oRetVal, Arg[] pArgs) {
oRetVal.setObject(((Node)pObj).resolveNode(pArgs[0].getString()));
}
public static void resolveNodes(Obj pObj, Arg oRetVal, Arg[] pArgs) {
oRetVal.setObject(((Node)pObj).resolveNodes(pArgs[0].getString(), false, false, false));
}
static Node getScriptChild(Node n, String sChildName, boolean bByName) {
if (sChildName == null) {
return null;
}
for (Node child = n.getFirstXFAChild(); child != null; child = child.getNextXFASibling()) {
Node retval;
boolean bMatch = false;
bMatch = bByName ? sChildName.equals(child.getName()) : sChildName.equals(child.getClassAtom());
if (bMatch) {
int eType = 5;
if (n instanceof Element) {
eType = ((Element)n).getSchemaType(child.getClassTag());
}
if (eType == 4 || eType == 3) {
return child;
}
}
if (!(child instanceof Element) || !child.isTransparent() || (retval = NodeScript.getScriptChild(child, sChildName, bByName)) == null) continue;
return retval;
}
return null;
}
public static boolean scriptPropLocateChildByClass(Obj obj, Arg retVal, String sChildName) {
if (!(obj instanceof Element)) {
return false;
}
Node oChild = NodeScript.getScriptChild((Node)obj, sChildName, false);
if (oChild == null) {
return false;
}
retVal.setObject(oChild);
return true;
}
public static boolean scriptPropLocateChildByName(Obj obj, Arg retVal, String sChildName) {
if (!(obj instanceof Element)) {
return false;
}
Node oChild = NodeScript.getScriptChild((Node)obj, sChildName, true);
if (oChild == null) {
return false;
}
retVal.setObject(oChild);
return true;
}
}