/**
* Recursive method to populate.
*/
private void populate(TreeWalker walker, ThreadBean tb, Message message, int depth) {
MessageBean mb=new MessageBean();
mb.setDepth(depth);
mb.setAnonymous(message.isAnonymous());
mb.setApproved(message.isApproved());
mb.setContent(message.getBody());
mb.setCreationDate(message.getCreationDate());
mb.setMessageID(message.getID());
mb.setModifiedDate(message.getModifiedDate());
mb.setSubject(message.getSubject());
UserBean ub = new UserBean();
if(!message.isAnonymous()){
User messageUser = message.getUser();
ub.setId(messageUser.getID());
ub.setUserName(messageUser.getUsername());
ub.setName(messageUser.getName());
ub.setEmail(messageUser.getEmail());
}else{
//:NOTE: we suppose in front application : name & email message property for anonymous user
ub.setUserName(message.getProperty("name"));
ub.setEmail(message.getProperty("email"));
}
mb.setAuthor(ub);
//add message
tb.addMessagesTree(mb);
//children
for (int i = 0; i < walker.getChildCount(message); i++) {