BooleanValue.java
2.05 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.content;
import com.adobe.xfa.Bool;
import com.adobe.xfa.Element;
import com.adobe.xfa.Model;
import com.adobe.xfa.Node;
import com.adobe.xfa.ScriptTable;
import com.adobe.xfa.XFA;
import com.adobe.xfa.content.BooleanScript;
import com.adobe.xfa.content.Content;
import com.adobe.xfa.ut.ExFull;
import com.adobe.xfa.ut.MsgFormatPos;
import com.adobe.xfa.ut.ResId;
import org.xml.sax.Attributes;
public final class BooleanValue
extends Content {
public BooleanValue(Element parent, Node prevSibling) {
super(parent, prevSibling, null, "boolean", "boolean", null, XFA.BOOLEANTAG, "boolean");
}
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
return super.equals(object) && this.getValue() == ((BooleanValue)object).getValue();
}
@Override
public int hashCode() {
return super.hashCode() ^ Boolean.valueOf(this.getValue()).hashCode();
}
@Override
public ScriptTable getScriptTable() {
return BooleanScript.getScriptTable();
}
public boolean getValue() {
String sValue = this.getStrValue();
try {
return Bool.getBool(sValue) == Bool.trueValue();
}
catch (ExFull ex) {
MsgFormatPos message = new MsgFormatPos(ResId.FoundBadElementValueException);
message.format(sValue);
message.format(this.getSOMExpression());
message.format("0");
this.getModel().addErrorList(new ExFull(message), 3, this);
return false;
}
}
public void setValue(boolean bValue) {
this.setStrValue(Bool.toString(bValue), true, false);
}
@Override
public String toString() {
return Bool.toString(this.getValue());
}
public boolean valueHasTypeMismatch() {
String sValue = this.getStrValue();
try {
Bool.getBool(sValue);
return false;
}
catch (ExFull ex) {
return true;
}
}
}