ScriptPropObj.java
4.37 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa;
import com.adobe.xfa.Arg;
import com.adobe.xfa.DependencyTracker;
import com.adobe.xfa.Obj;
import com.adobe.xfa.ObjScript;
import com.adobe.xfa.ut.ExFull;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public final class ScriptPropObj {
private final String msName;
private final int meParamType;
private final int mnXFAVersion;
private final int mnAvailability;
private final int mnVersionDep;
private final Class<?> mClass;
private final Method mGetMethod;
private final boolean mbGetHasDependencyTracker;
private final Method mSetMethod;
public ScriptPropObj(Class<?> clazz, String sName, String sGetFunc, String sSetFunc, int eParamType, int nXFAVersion, int nAvailability, int nVersionDep) {
boolean bGetHasDependencyTracker;
Method m;
block11 : {
assert (clazz != null);
assert (sGetFunc != null || sSetFunc != null);
this.mClass = clazz;
this.msName = sName;
this.meParamType = eParamType;
this.mnXFAVersion = nXFAVersion;
this.mnAvailability = nAvailability;
this.mnVersionDep = nVersionDep;
m = null;
bGetHasDependencyTracker = false;
if (sGetFunc != null) {
try {
m = this.mClass.getMethod(sGetFunc, Obj.class, Arg.class);
}
catch (NoSuchMethodException ex) {
// empty catch block
}
}
if (sGetFunc != null && m == null) {
try {
m = this.mClass.getMethod(sGetFunc, Obj.class, Arg.class, DependencyTracker.class);
bGetHasDependencyTracker = true;
}
catch (NoSuchMethodException ex) {
if ($assertionsDisabled) break block11;
throw new AssertionError();
}
}
}
this.mGetMethod = m;
this.mbGetHasDependencyTracker = bGetHasDependencyTracker;
m = null;
if (sSetFunc != null) {
try {
m = this.mClass.getMethod(sSetFunc, Obj.class, Arg.class);
}
catch (NoSuchMethodException ex) {
// empty catch block
}
}
this.mSetMethod = m;
}
public boolean invokeGetProp(Obj scriptThis, Arg oRetValue, DependencyTracker dependencyTracker) {
boolean bError = false;
try {
if (this.mbGetHasDependencyTracker) {
this.mGetMethod.invoke(this, scriptThis, oRetValue, dependencyTracker);
} else {
this.mGetMethod.invoke(this, scriptThis, oRetValue);
}
assert (this.getParamType() == 0 || oRetValue.isCompatibleWith(this.getParamType()));
}
catch (IllegalAccessException e3) {
bError = true;
}
catch (InvocationTargetException e2) {
Throwable t = e2.getCause();
if (t instanceof ExFull) {
throw (ExFull)t;
}
bError = true;
}
return bError;
}
public boolean invokeSetProp(Obj scriptThis, Arg oRetValue) {
assert (this.hasSetter());
boolean bError = false;
try {
this.mSetMethod.invoke(scriptThis, scriptThis, oRetValue);
}
catch (IllegalAccessException e3) {
bError = true;
}
catch (InvocationTargetException e2) {
Throwable t = e2.getCause();
if (t instanceof ExFull) {
throw (ExFull)t;
}
bError = true;
}
return bError;
}
public boolean invokePermsFunc(Obj scriptThis) {
return ObjScript.setPropPermsCheck(scriptThis);
}
public boolean hasGetter() {
return this.mGetMethod != null;
}
public boolean hasSetter() {
return this.mSetMethod != null;
}
public int getXFAVersion() {
return this.mnXFAVersion;
}
public int getAvailability() {
return this.mnAvailability;
}
public int getVersionDeprecated() {
return this.mnVersionDep;
}
public int getParamType() {
return this.meParamType;
}
public String getName() {
return this.msName;
}
}