Comment.java
2.31 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;
import com.adobe.xfa.*;
import com.adobe.xfa.ut.ExFull;
import com.adobe.xfa.ut.ResId;
import java.io.IOException;
import java.io.OutputStream;
public final class Comment
extends Node {
private static final String mClassName = "comment";
private final String mComment;
private final Document mDoc;
Comment(Document doc, String comment) {
super(null, null);
this.mComment = comment;
this.mDoc = doc;
if (doc != null) {
this.mDoc.appendChild(this);
}
}
public Comment(Element parent, Node prevSibling, String comment) {
super(parent, prevSibling);
this.mComment = comment;
this.mDoc = null;
}
@Override
public Node clone(Element parent) {
if (parent != null) {
return new Comment(parent, parent.getLastXMLChild(), this.mComment);
}
return new Comment(null, null, this.mComment);
}
@Override
public String getClassAtom() {
return "comment";
}
@Override
public String getClassName() {
return "comment";
}
@Override
public String getData() {
return this.mComment;
}
@Override
public String getName() {
return "#comment";
}
@Override
public boolean isLeaf() {
return true;
}
@Override
public void postSave() {
}
@Override
public void preSave(boolean bSaveXMLScript) {
}
@Override
public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException {
if (level != 0 || prevSibling != null) {
if (options.getDisplayFormat() == 2) {
options.writeIndent(outStream, level);
} else if (level == 0 && (options.getFormatOutside() || options.getDisplayFormat() == 1)) {
outStream.write(Document.MarkupReturn);
}
}
outStream.write(Document.MarkupCommentStart);
String sValue = this.getData();
outStream.write(sValue.getBytes("UTF-8"));
outStream.write(Document.MarkupCommentEnd);
}
public void setScriptProperty(String sPropertyName, Arg propertyValue) {
throw new ExFull(ResId.UNSUPPORTED_OPERATION, "Comment#setScriptProperty");
}
}