/** * Assigns the root object of the JAXB structure for the content * and returns the handle as a fluent convenience. * @param content the root JAXB object * @return this handle */ public JAXBHandle<C> with(C content) { set(content); return this; }
/** * Assigns the root object of the JAXB structure for the content * and returns the handle as a fluent convenience. * @param content the root JAXB object * @return this handle */ public JAXBHandle<C> with(C content) { set(content); return this; }
/** * Write document using JAXBHandle with metadata * * @param client * @param product * @param uri * @param metadataHandle * @param type * @throws JAXBException */ public void writeDocumentUsingJAXBHandle(DatabaseClient client, Product product, String uri, DocumentMetadataHandle metadataHandle, String type) throws JAXBException { // set jaxb context JAXBContext context = JAXBContext.newInstance(Product.class); // create doc manager DocumentManager docMgr = null; docMgr = documentManagerSelector(client, docMgr, type); // create an identifier for the document String docId = uri + product.getName() + ".xml"; // create a handle on the content JAXBHandle contentHandle = new JAXBHandle(context); contentHandle.set(product); // write the doc docMgr.write(docId, metadataHandle, contentHandle); System.out.println("Write " + docId + " to the database"); }