MergedItemResource.java
1.29 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ResourceWrapper
*/
package com.day.cq.dam.commons.schemaforms.internal;
import com.day.cq.dam.commons.schemaforms.internal.MergeableResource;
import java.util.Iterator;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceWrapper;
public abstract class MergedItemResource
extends ResourceWrapper {
private static final String ITEMS = "items";
protected MergeableResource itemsResource;
public MergedItemResource(Resource resource) {
super(resource);
Resource itemsRes = resource.getChild("items");
this.itemsResource = new MergeableResource(itemsRes, this);
}
public Resource getChild(String relPath) {
if (!"items".equals(relPath)) {
return this.getResource().getChild(relPath);
}
return this.itemsResource;
}
public Iterator<Resource> listChildren() {
return this.itemsResource.listChildren();
}
public Iterable<Resource> getChildren() {
return this.itemsResource.getChildren();
}
protected abstract boolean merge(Resource var1);
protected abstract Resource getItemResource(Resource var1);
}