EmptyDataSource.java
1.23 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.Resource
*/
package com.adobe.granite.ui.components.ds;
import com.adobe.granite.ui.components.ds.DataSource;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.sling.api.resource.Resource;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public final class EmptyDataSource
implements DataSource {
private static DataSource instance;
public static DataSource instance() {
if (instance == null) {
instance = new EmptyDataSource();
}
return instance;
}
private EmptyDataSource() {
}
@Override
public Iterator<Resource> iterator() {
return new Iterator<Resource>(){
@Override
public void remove() {
throw new UnsupportedOperationException("Empty iterator");
}
@Override
public Resource next() {
throw new NoSuchElementException("Empty iterator");
}
@Override
public boolean hasNext() {
return false;
}
};
}
}