XFANodeHolder.java
3.43 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.dom;
import com.adobe.xfa.Chars;
import com.adobe.xfa.Comment;
import com.adobe.xfa.Document;
import com.adobe.xfa.Element;
import com.adobe.xfa.Node;
import com.adobe.xfa.ProcessingInstruction;
import com.adobe.xfa.dom.CommentImpl;
import com.adobe.xfa.dom.DocumentImpl;
import com.adobe.xfa.dom.ElementImpl;
import com.adobe.xfa.dom.NodeImpl;
import com.adobe.xfa.dom.ParentNode;
import com.adobe.xfa.dom.ProcessingInstructionImpl;
import com.adobe.xfa.dom.TextImpl;
import org.w3c.dom.DOMException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.NodeList;
import org.w3c.dom.UserDataHandler;
public abstract class XFANodeHolder
extends NodeImpl {
private final Node mXFANode;
public Node getmXFANode() {
return this.mXFANode;
}
XFANodeHolder(ParentNode parent, Node newNode) {
super(parent);
if (newNode instanceof Element.DualDomNode) {
newNode = ((Element.DualDomNode)((Object)newNode)).getXmlPeer();
}
this.mXFANode = newNode;
}
@Override
public org.w3c.dom.Node getNextSibling() {
XFANodeHolder result = this.forceNext();
return result;
}
@Override
public org.w3c.dom.Node getPreviousSibling() {
XFANodeHolder result = this.forcePrev();
return result;
}
@Override
public boolean isSameNode(org.w3c.dom.Node other) {
if (!(other instanceof XFANodeHolder)) {
return false;
}
XFANodeHolder otherXFANodeHolder = (XFANodeHolder)other;
return this.mXFANode == otherXFANodeHolder.mXFANode;
}
XFANodeHolder forceNext() {
NodeImpl nextNode = this.getNext();
if (nextNode != null) {
assert (nextNode instanceof XFANodeHolder);
return (XFANodeHolder)nextNode;
}
ParentNode parent = this.getParent();
return parent != null ? parent.forceNext(this) : null;
}
XFANodeHolder forcePrev() {
NodeImpl prevNode = this.getPrev();
if (prevNode != null) {
assert (prevNode instanceof XFANodeHolder);
return (XFANodeHolder)prevNode;
}
ParentNode parent = this.getParent();
return parent != null ? parent.forcePrev(this) : null;
}
final Node getXFANode() {
return this.mXFANode;
}
static final Element getXFAParent(Node node) {
Element parent = node.getXMLParent();
if (parent instanceof Element.DualDomNode) {
parent = (Element)((Element.DualDomNode)((Object)parent)).getXmlPeer();
}
return parent;
}
static XFANodeHolder createNode(ParentNode parent, Node source) {
if (source instanceof Element.DualDomNode) {
source = ((Element.DualDomNode)((Object)source)).getXmlPeer();
}
if (source instanceof Chars) {
return new TextImpl(parent, (Chars)source);
}
if (source instanceof Comment) {
return new CommentImpl(parent, (Comment)source);
}
if (source instanceof Document) {
return new DocumentImpl((Document)source);
}
if (source instanceof Element) {
return new ElementImpl(parent, (Element)source);
}
if (source instanceof ProcessingInstruction) {
return new ProcessingInstructionImpl(parent, (ProcessingInstruction)source);
}
assert (false);
return null;
}
}