DPSBannerImpl.java
2.18 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
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.wcm.api.Page
* org.apache.sling.api.resource.ValueMap
* org.apache.sling.commons.json.JSONException
* org.apache.sling.commons.json.JSONObject
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.cq.mobile.dps.impl.metadata;
import com.adobe.cq.mobile.dps.AdType;
import com.adobe.cq.mobile.dps.DPSBanner;
import com.adobe.cq.mobile.dps.impl.metadata.AbstractDPSEntityImpl;
import com.adobe.cq.mobile.dps.impl.utils.MetadataJSONUtil;
import com.day.cq.wcm.api.Page;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DPSBannerImpl
extends AbstractDPSEntityImpl
implements DPSBanner {
private static final Logger LOGGER = LoggerFactory.getLogger(DPSBannerImpl.class);
public DPSBannerImpl(Page page) {
super(page);
if (!this.getDPSResourceType().equals("dps:Banner")) {
throw new IllegalArgumentException("Underlying page, " + page.getPath() + ", is not a " + "dps:Banner" + ".");
}
}
@Override
public boolean isAdvertisement() {
return (Boolean)this.page.getProperties().get("dps-isAdvertisement", (Object)false);
}
@Override
public AdType getAdType() {
return AdType.getAdType((String)this.page.getProperties().get("dps-adType", String.class));
}
@Override
public String getAdCategory() {
return (String)this.page.getProperties().get("dps-adCategory", String.class);
}
@Override
public String getAdvertiser() {
return (String)this.page.getProperties().get("dps-advertiser", String.class);
}
@Override
public String getTapAction() {
return (String)this.page.getProperties().get("dps-tapAction", String.class);
}
@Override
public String getTapActionURL() {
return (String)this.page.getProperties().get("dps-tapActionURL", String.class);
}
@Override
public JSONObject toJSON() throws JSONException {
return MetadataJSONUtil.getBannerJSON(this);
}
}