ValueMapResourceWrapper.java
1.39 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ResourceWrapper
* org.apache.sling.api.resource.ValueMap
* org.apache.sling.api.wrappers.ValueMapDecorator
*/
package com.adobe.granite.ui.components;
import java.util.HashMap;
import java.util.Map;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceWrapper;
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 ValueMapResourceWrapper
extends ResourceWrapper {
private ValueMap vm = new ValueMapDecorator(new HashMap());
private String resourceType;
public ValueMapResourceWrapper(Resource resource, String resourceType) {
super(resource);
this.resourceType = resourceType;
this.vm.put((Object)"sling:resourceType", (Object)resourceType);
}
public String getResourceType() {
return this.resourceType;
}
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
if (ValueMap.class.equals(type)) {
return (AdapterType)this.vm;
}
return (AdapterType)super.adaptTo(type);
}
public ValueMap getValueMap() {
return this.vm;
}
}