AbstractFeature.java
2.1 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.felix.scr.annotations.Activate
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Property
* org.apache.sling.commons.osgi.PropertiesUtil
* org.apache.sling.featureflags.Feature
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.granite.frags.impl;
import java.util.Map;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.sling.commons.osgi.PropertiesUtil;
import org.apache.sling.featureflags.Feature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component(componentAbstract=1)
public abstract class AbstractFeature
implements Feature {
@Property(label="Name", description="The name of this feature flag", value={"Name is not available"})
public static String PROP_NAME = "feature.name";
@Property(label="Description", description="The description of this feature flag", value={"Description is not available"})
public static String PROP_DESCRIPTION = "feature.description";
static final String NAME_NOT_AVAILABLE = "Name is not available";
static final String DESCRIPTION_NOT_AVAILABLE = "Description is not available";
protected final Logger LOGGER;
private String name;
private String description;
public AbstractFeature() {
this.LOGGER = LoggerFactory.getLogger(this.getClass());
}
@Activate
protected final void activate(Map<String, Object> config) {
this.name = PropertiesUtil.toString((Object)config.get(PROP_NAME), (String)"Name is not available");
this.description = PropertiesUtil.toString((Object)config.get(PROP_DESCRIPTION), (String)"Description is not available");
this.configure(config);
this.LOGGER.info("{} activated", (Object)this);
}
protected void configure(Map<String, Object> config) {
}
public final String getName() {
return this.name;
}
public final String getDescription() {
return this.description;
}
}