ContentPolicyStyle.java
3.73 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.wcm.api.designer.Cell
* com.day.cq.wcm.api.designer.Design
* com.day.cq.wcm.api.designer.Style
* com.day.cq.wcm.api.policies.ContentPolicy
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ValueMap
* org.apache.sling.api.wrappers.ValueMapDecorator
*/
package com.day.cq.wcm.scripting.impl;
import com.day.cq.wcm.api.designer.Cell;
import com.day.cq.wcm.api.designer.Design;
import com.day.cq.wcm.api.designer.Style;
import com.day.cq.wcm.api.policies.ContentPolicy;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.api.wrappers.ValueMapDecorator;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class ContentPolicyStyle
implements Style {
private final ContentPolicy contentPolicy;
private final Cell cell;
private ValueMap properties;
public ContentPolicyStyle(ContentPolicy contentPolicy, Cell cell) {
if (contentPolicy == null) {
throw new IllegalArgumentException("contentPolicy is null");
}
this.contentPolicy = contentPolicy;
this.cell = cell;
}
private void initProperties() {
if (this.properties == null) {
this.properties = this.contentPolicy.getProperties();
if (this.properties == null) {
this.properties = new ValueMapDecorator(new HashMap());
}
}
}
public Design getDesign() {
return null;
}
public String getPath() {
return this.contentPolicy.getPath();
}
public Cell getCell() {
return this.cell;
}
public <T> T get(String name, Class<T> type) {
this.initProperties();
return (T)this.properties.get(name, type);
}
public <T> T get(String name, T defaultValue) {
this.initProperties();
return (T)this.properties.get(name, defaultValue);
}
public Resource getDefiningResource(String name) {
return null;
}
public String getDefiningPath(String name) {
return null;
}
public Style getSubStyle(String relPath) {
return null;
}
public int size() {
this.initProperties();
return this.properties.size();
}
public boolean isEmpty() {
this.initProperties();
return this.properties.isEmpty();
}
public boolean containsKey(Object o) {
this.initProperties();
return this.properties.containsKey(o);
}
public boolean containsValue(Object o) {
this.initProperties();
return this.properties.containsValue(o);
}
public Object get(Object o) {
this.initProperties();
return this.properties.get(o);
}
public Object put(String s, Object o) {
this.initProperties();
return this.properties.put((Object)s, o);
}
public Object remove(Object o) {
this.initProperties();
return this.properties.remove(o);
}
public void putAll(Map<? extends String, ?> map) {
this.initProperties();
this.properties.putAll(map);
}
public void clear() {
this.initProperties();
this.properties.clear();
}
public Set<String> keySet() {
this.initProperties();
return this.properties.keySet();
}
public Collection<Object> values() {
this.initProperties();
return this.properties.values();
}
public Set<Map.Entry<String, Object>> entrySet() {
this.initProperties();
return this.properties.entrySet();
}
}