IDValueMap.java
2.14 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa;
import com.adobe.xfa.Element;
import com.adobe.xfa.Model;
import com.adobe.xfa.Node;
import com.adobe.xfa.ut.*;
import java.util.ArrayList;
import java.util.List;
public final class IDValueMap {
private Model mpoInstalledModelImpl;
private IDValueMap mpoModelPreviousIDValueMap;
private String msPrefix;
private final List<String> mReferenceList = new ArrayList<String>();
public void destroy() {
if (this.mpoInstalledModelImpl != null) {
this.mpoInstalledModelImpl.setIDValueMap(this.mpoModelPreviousIDValueMap);
}
}
public void installOnModel(Model poModelImpl) {
this.mpoModelPreviousIDValueMap = poModelImpl.getIDValueMap();
this.mpoInstalledModelImpl = poModelImpl;
this.mpoInstalledModelImpl.setIDValueMap(this);
}
public String getPrefix() {
if (StringUtils.isEmpty(this.msPrefix)) {
this.msPrefix = UuidFactory.getUuid();
}
return this.msPrefix;
}
public List<String> getReferenceList() {
return this.mReferenceList;
}
public boolean isActive() {
return this.mpoInstalledModelImpl != null;
}
public boolean verifySelfContained(String sHRefExpression, String sNodeContainingHRef, Node srcNode) {
if (this.mpoInstalledModelImpl == null) {
return true;
}
for (int i = 0; i < this.mReferenceList.size(); ++i) {
Element targetNode;
String sReference = this.mReferenceList.get(i);
for (targetNode = srcNode.getModel().getNode((String)sReference); targetNode != null && targetNode != srcNode; targetNode = targetNode.getXMLParent()) {
}
if (targetNode != null) continue;
MsgFormatPos message = new MsgFormatPos(ResId.FragmentIDNotSelfContained);
message.format(sReference);
message.format(sHRefExpression);
message.format(sNodeContainingHRef);
this.mpoInstalledModelImpl.addErrorList(new ExFull(message), 3, this.mpoInstalledModelImpl);
return false;
}
return true;
}
}