/** * Sets the document of this reply. * * @param doc The document to set. */ public void setDocument(Document doc) { buffer = null; decoder = null; document = doc; lastModified = document != null && document.getLastModified() != null ? document.getLastModified() : 0; }
@Override public Long getLastModified() { return doc.getLastModified(); }
@SuppressWarnings("deprecation") public static void printDocumentXml(Document doc, XmlStream xml) { xml.addAttribute("documenttype", doc.getDataType().getName()); xml.addAttribute("documentid", doc.getId()); final java.lang.Long lastModified = doc.getLastModified(); if (lastModified != null) { xml.addAttribute("lastmodifiedtime", lastModified); } doc.getHeader().printXml(xml); doc.getBody().printXml(xml); }
@Override public void write(FieldBase field, Document value) { buffer.beginTag("document"); buffer.addAttribute("documenttype", value.getDataType().getName()); buffer.addAttribute("documentid", value.getId()); final java.lang.Long lastModified = value.getLastModified(); if (lastModified != null) { buffer.addAttribute("lastmodifiedtime", lastModified); } write(null, value.getHeader()); write(null, value.getBody()); buffer.endTag(); }