Paragraph.java
2.36 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.commons.DiffInfo
* com.day.cq.commons.DiffInfo$TYPE
* org.apache.sling.api.resource.Resource
* org.apache.sling.api.resource.ResourceWrapper
*/
package com.day.cq.wcm.foundation;
import com.day.cq.commons.DiffInfo;
import com.day.cq.wcm.foundation.DiffInfo;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceWrapper;
public class Paragraph
extends ResourceWrapper {
private final Type type;
private final int colNr;
private final int numCols;
private final String cssClass;
private com.day.cq.commons.DiffInfo diffInfo;
protected Paragraph(Resource resource, Type type, int colNr, String cssClass, int numCols) {
super(resource);
this.type = type;
this.colNr = colNr;
this.cssClass = cssClass;
this.numCols = numCols;
}
protected Paragraph(Resource resource, Type type) {
this(resource, type, 0, "", 0);
}
public Type getType() {
return this.type;
}
public int getColNr() {
return this.colNr;
}
public int getNumCols() {
return this.numCols;
}
public String getBaseCssClass() {
return this.cssClass;
}
public String getCssClass() {
return this.cssClass + "-c" + this.colNr;
}
public void setDiffInfo(com.day.cq.commons.DiffInfo di) {
this.diffInfo = di;
}
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
if (type == com.day.cq.commons.DiffInfo.class) {
return (AdapterType)this.diffInfo;
}
if (type == DiffInfo.class) {
return (AdapterType)((Object)(this.diffInfo == null ? null : new DiffInfo(this.diffInfo.getContent(), this.diffInfo.getType())));
}
return (AdapterType)super.adaptTo(type);
}
public String toString() {
return this.getClass().getSimpleName() + ", path=" + this.getPath() + ", type=" + this.getResourceType() + ", cssClass=" + this.getBaseCssClass() + ", column=" + this.getColNr() + "/" + this.getNumCols() + ", diffInfo=[" + (Object)this.diffInfo + "]" + ", resource=[" + (Object)this.getResource() + "]";
}
public static enum Type {
NORMAL,
START,
BREAK,
END;
private Type() {
}
}
}