-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleModel.java
48 lines (35 loc) · 1.13 KB
/
SampleModel.java
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
package com.szokone.aem.gokotlin.java.model;
import com.szokone.aem.gokotlin.java.service.ConfigurableService;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
@Model(adaptables = Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class SampleModel {
@Inject
private String textfield;
@Inject
private Long numberfield;
@Inject
private boolean checkbox;
private String calculatedValue;
@Inject
private ConfigurableService service;
@PostConstruct
public void init() {
calculatedValue = service.getReplacements().toString() + " | " + textfield + " | " + numberfield + " | " + checkbox;
}
public String getTextfield() {
return textfield;
}
public Long getNumberfield() {
return numberfield;
}
public boolean isCheckbox() {
return checkbox;
}
public String getCalculatedValue() {
return calculatedValue;
}
}