Sightly Java return types
All the examples I have seen thus far (including official documentation) use simple return types for Java methods. In the following example taken from http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2014/01/sightly-preview-part2.html getMyTitle returns a String :-
<div data-sly-use.comp1="com.myproject.SightlyComponent"> <h1>${comp1.myTitle}</h1> </div> public class SightlyComponent extends WCMUse { private String myTitle; @Override public void activate() { myTitle = "My Project " + getCurrentPage().getTitle(); } public String getMyTitle() { return myTitle; } }Is is possible to return a an Object (or interface) type from a method .. say ? :-
<div data-sly-use.person="com.mycompany.aem.Person"> <h1>${person.address.zipCode}</h1> </div>package com.mycompany.aem; public class Person extends WCMUse { import com.mycompany.aem.Address; ... public String firstName; public String lastName; public Address address; public Address getAddress() { ... return address; } } package com.mycompany.aem;public class Address{ public String streetName; public String zipCode; ... }I tried something along these lines but couldn't get is to work so wondered whether there is a way of achieving it ??
Regards
Fraser.