Packet.java
2.83 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa;
import com.adobe.xfa.*;
import java.io.IOException;
import java.io.OutputStream;
public final class Packet
extends Element
implements Element.DualDomNode {
private Element mXmlPeer;
public Packet(Element parent, Node prevSibling) {
super(parent, prevSibling, null, "packet", "packet", null, XFA.PACKETTAG, "packet");
if (parent != null) {
if (!(parent instanceof AppModel)) {
throw new IllegalArgumentException("parent is not an AppModel.");
}
this.setDocument(parent.getOwnerDocument());
this.setModel((AppModel)parent);
}
}
public String getAttribute(String sAttrName) {
int oAttr = this.findAttr(null, sAttrName.intern());
if (oAttr != -1) {
return this.getAttrVal(oAttr);
}
return "";
}
public String getContent() {
for (Node oChild = this.getFirstXMLChild(); oChild != null; oChild = oChild.getNextXMLSibling()) {
if (!(oChild instanceof Chars)) continue;
Chars oText = (Chars)oChild;
return oText.getText();
}
return "";
}
@Override
public String getName() {
return this.getLocalName();
}
@Override
public ScriptTable getScriptTable() {
return PacketScript.getScriptTable();
}
@Override
public boolean isValidAttr(int eTag, boolean bReport, String value) {
return true;
}
@Override
public Node getFirstXFAChild() {
return null;
}
@Override
public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException {
this.getXmlPeer().serialize(outStream, options, level, prevSibling);
}
public void removeAttribute(String sAttrName) {
String aAttrName = sAttrName.intern();
super.removeAttr(null, aAttrName);
}
public void setAttribute(String sValue, String sAttrName) {
this.setAttribute(null, sAttrName, sAttrName, sValue);
this.makeNonDefault(false);
}
public void setContent(String sContent) {
for (Node oChild = this.getFirstXMLChild(); oChild != null; oChild = oChild.getNextXMLSibling()) {
this.removeChild(oChild);
}
this.getModel().createTextNode(this, null, sContent);
this.makeNonDefault(false);
}
@Override
protected boolean compareVersions(Node oRollbackElement, Node oContainer, Node.ChangeLogger oChangeLogger, Object oUserData) {
return this.compareVersionsCanonically(oRollbackElement, oContainer, oChangeLogger, oUserData);
}
@Override
public void setXmlPeer(Node peer) {
this.mXmlPeer = (Element)peer;
}
@Override
public Node getXmlPeer() {
return this.mXmlPeer;
}
}