timestamp = System.currentTimeMillis();
}
@Override
public void writeXML(XMLOutput xmlOutput) throws IOException {
XMLAttributeList attributeList = new XMLAttributeList();
// all three of these xml attributes are optional
if (hasDesignationKey()) {
attributeList.addAttribute("designation", designation);
}
if (user != null && !"".equals(user)) {
attributeList.addAttribute("user", user);
}
if (dirty) {
attributeList.addAttribute("needsSync", "true");
}
if (timestamp > 0) {
attributeList.addAttribute("timestamp", String.valueOf(timestamp));
}
if ((annotationText != null && !"".equals(annotationText))) {
xmlOutput.openTag("UserAnnotation", attributeList);
xmlOutput.writeCDATA(annotationText);