Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple Sling model showing the use of the Exporter framework
@Model(
adaptables = Resource.class,
resourceType = "acme/components/sling-model"
)
@Exporter(name = "jackson", extensions = "json")
public class MyModel {
@Inject @Named("jcr:title")
private String title;
@Inject @Named("jcr:created")
private Calendar createdAt;
public String getTitle() {
return title;
}
@JsonIgnore
public Calendar getCreatedAt() {
return createdAt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment