/** * Dumps the given OME-XML DOM tree to a string. * @param schemaLocation if null, no xmlns attribute will be added. * @param doc the {@link Document} representing the XML to be written * @param r the {@link Element} to use for adding the schema location * @return OME-XML as a string. */ public static String dumpXML(String schemaLocation, Document doc, Element r) { return dumpXML(schemaLocation, doc, r, true); }
/** * Dumps the given OME-XML DOM tree to a string. * @param schemaLocation if null, no xmlns attribute will be added. * @return OME-XML as a string. */ public static String dumpXML(String schemaLocation, Document doc, Element r) { return dumpXML(schemaLocation, doc, r, true); }
/** * Set the key/value metadata pair for this annotation. * @param key the original metadata key * @param value the original metadata value */ public void setKeyValue(String key, String value) { setNamespace(ORIGINAL_METADATA_NS); this.key = key; this.value = value; // Not XML value Document doc = BUILDER.newDocument(); Element r = makeOriginalMetadata(doc); super.setValue(XMLTools.dumpXML(null, doc, r, false)); }
/** * Set the key/value metadata pair for this annotation. * @param key the original metadata key * @param value the original metadata value */ public void setKeyValue(String key, String value) { setNamespace(ORIGINAL_METADATA_NS); this.key = key; this.value = value; // Not XML value Document doc = BUILDER.newDocument(); Element r = makeOriginalMetadata(doc); super.setValue(XMLTools.dumpXML(null, doc, r, false)); }
/** * Dumps the given OME-XML DOM tree to a string. * @return OME-XML as a string. */ @Override public String dumpXML() { if (root == null) { root = (OMEModelObject) getRoot(); if (root == null) return null; } Document doc = createNewDocument(); Element r = root.asXMLElement(doc); String schemaLocation = OME.NAMESPACE + " " + SCHEMA; return XMLTools.dumpXML(schemaLocation, doc, r); }
/** * Dumps the given OME-XML DOM tree to a string. * @return OME-XML as a string. */ @Override public String dumpXML() { if (root == null) { root = (OMEModelObject) getRoot(); if (root == null) return null; } Document doc = createNewDocument(); Element r = root.asXMLElement(doc); String schemaLocation = OME.NAMESPACE + " " + SCHEMA; return XMLTools.dumpXML(schemaLocation, doc, r); }
/** * Set the value of this annotation using the given Modulo object * @param meta the associated OMEXMLMetadata * @param m the Modulo object from which to retrieve dimension information */ public void setModulo(OMEXMLMetadata meta, Modulo m) { modulo = m; setNamespace(MODULO_NS); Document doc = XMLTools.createDocument(); Element r = makeModuloElement(doc); setValue(XMLTools.dumpXML(null, doc, r, false)); }
/** * Set the value of this annotation using the given Modulo object * @param meta the associated OMEXMLMetadata * @param m the Modulo object from which to retrieve dimension information */ public void setModulo(OMEXMLMetadata meta, Modulo m) { modulo = m; setNamespace(MODULO_NS); Document doc = XMLTools.createDocument(); Element r = makeModuloElement(doc); setValue(XMLTools.dumpXML(null, doc, r, false)); }