Occur.java
3.09 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.template.formatting;
import com.adobe.xfa.Attribute;
import com.adobe.xfa.Element;
import com.adobe.xfa.Int;
import com.adobe.xfa.Node;
import com.adobe.xfa.ProtoableNode;
import com.adobe.xfa.XFA;
import org.xml.sax.Attributes;
public final class Occur
extends ProtoableNode {
public Occur(Element parent, Node prevSibling) {
super(parent, prevSibling, null, "occur", "occur", null, XFA.OCCURTAG, "occur");
}
@Override
public Attribute defaultAttribute(int eTag) {
Int oMin;
Element poParent = this.getXFAParent();
if (null != poParent && (poParent.isSameClass(XFA.PAGEAREATAG) || poParent.isSameClass(XFA.PAGESETTAG))) {
if (eTag == XFA.MINTAG) {
return new Int("min", 0, false);
}
if (eTag == XFA.MAXTAG) {
return new Int("max", -1, false);
}
}
if (eTag == XFA.INITIALTAG) {
return this.getAttribute(XFA.MINTAG);
}
if (eTag == XFA.MAXTAG && (oMin = (Int)this.getAttribute(XFA.MINTAG)).getValue() > 0) {
return oMin;
}
return super.defaultAttribute(eTag);
}
@Override
public Attribute getAttribute(int eTag, boolean bPeek, boolean bValidate) {
Int minVal;
Int oValue;
Attribute oProperty = super.getAttribute(eTag, bPeek, bValidate);
if (oProperty == null) {
return oProperty;
}
if (eTag == XFA.INITIALTAG) {
Int maxVal;
oValue = (Int)oProperty;
if (this.isPropertySpecified(XFA.MINTAG, true, 0)) {
minVal = (Int)this.getAttribute(XFA.MINTAG);
if (oValue.getValue() < minVal.getValue()) {
this.foundBadAttribute(eTag, oValue.toString());
return minVal;
}
}
if (this.isPropertySpecified(XFA.MAXTAG, true, 0) && (maxVal = (Int)this.getAttribute(XFA.MAXTAG)).getValue() != -1 && oValue.getValue() > maxVal.getValue()) {
this.foundBadAttribute(eTag, oValue.toString());
return maxVal;
}
}
if (eTag == XFA.MINTAG && (oValue = (Int)oProperty).getValue() < 0) {
this.foundBadAttribute(eTag, oValue.toString());
return this.defaultAttribute(eTag);
}
if (eTag == XFA.MAXTAG) {
oValue = (Int)oProperty;
minVal = (Int)this.getAttribute(XFA.MINTAG);
if (oValue.getValue() < -1 || oValue.getValue() != -1 && oValue.getValue() < minVal.getValue()) {
this.foundBadAttribute(eTag, oValue.toString());
return minVal;
}
}
return oProperty;
}
int getMaximum() {
Int oMax = (Int)this.getAttribute(XFA.MAXTAG);
return oMax.getValue();
}
int getMinimum() {
Int oMin = (Int)this.getAttribute(XFA.MINTAG);
return oMin.getValue();
}
int getInitial() {
Int oInit = (Int)this.getAttribute(XFA.INITIALTAG);
return oInit.getValue();
}
}