MetaDataDefinitionImpl.java
1.53 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.cq.dam.cfm.MetaDataDefinition
* com.adobe.cq.dam.cfm.MetaDataProperty
* org.apache.sling.api.resource.Resource
*/
package com.adobe.cq.dam.cfm.impl;
import com.adobe.cq.dam.cfm.MetaDataDefinition;
import com.adobe.cq.dam.cfm.MetaDataProperty;
import com.adobe.cq.dam.cfm.impl.GenericMetaDataProperty;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.sling.api.resource.Resource;
public class MetaDataDefinitionImpl
implements MetaDataDefinition {
private final Map<String, MetaDataProperty> metaDataProperties = new LinkedHashMap<String, MetaDataProperty>();
public MetaDataDefinitionImpl(Resource resource) {
if (resource != null) {
Iterator defs = resource.listChildren();
while (defs.hasNext()) {
GenericMetaDataProperty property = new GenericMetaDataProperty((Resource)defs.next());
this.addMetaDataProperty(property);
}
}
}
public MetaDataDefinitionImpl() {
this(null);
}
public Iterator<MetaDataProperty> getMetaDataProperties() {
return this.metaDataProperties.values().iterator();
}
public MetaDataProperty getMetaDataPropertyByName(String name) {
return this.metaDataProperties.get(name);
}
protected void addMetaDataProperty(MetaDataProperty toAdd) {
this.metaDataProperties.put(toAdd.getName(), toAdd);
}
}