ChildEditor.java
1.88 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.commons.JSONItem
* javax.jcr.Node
* javax.jcr.RepositoryException
* org.apache.sling.commons.json.JSONException
* org.apache.sling.commons.json.io.JSONWriter
* org.apache.sling.jcr.resource.JcrPropertyMap
*/
package com.day.cq.wcm.api.components;
import com.day.cq.commons.JSONItem;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
import org.apache.sling.jcr.resource.JcrPropertyMap;
public class ChildEditor
implements JSONItem {
private final String PN_CE_TITLE = "title";
private final String PN_CE_TYPE = "type";
private final String PN_CE_ICON = "icon";
private final String name;
private final String id;
private final String title;
private final String icon;
private final String type;
public ChildEditor(Node node) throws RepositoryException {
JcrPropertyMap map = new JcrPropertyMap(node);
this.id = this.name = node.getName();
this.type = (String)map.get("type", (Object)"");
this.title = (String)map.get("title", (Object)"");
this.icon = (String)map.get("icon", (Object)"");
}
public String getName() {
return this.name;
}
public String getId() {
return this.id;
}
public String getTitle() {
return this.title;
}
public String getType() {
return this.type;
}
public String getIcon() {
return this.icon;
}
public void write(JSONWriter out) throws JSONException {
out.object();
out.key("id").value((Object)this.name);
out.key("type").value((Object)this.type);
out.key("title").value((Object)this.title);
out.key("icon").value((Object)this.icon);
out.endObject();
}
}