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
|
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class Chat extends AbstractRootEntity {
private List<ISiteUserChat> participants;
private String richTextContent;
public void addMessage(String message) {
richTextContent += "<br>" + message;
}
//je ne prend que les 1000 derniers caractères
@XmlAttribute
public String getRichTextContent() {
int length = richTextContent.length();
return richTextContent.substring(length - 1000 < 0 ? 0 : length - 1000, length);
}
@XmlElement
public List<ISiteUserChat> getParticipants() {
return participants;
}
} |
Partager