/** * * @param version */ public void setVersion(VersionProperty version){ setVersionName(version.getName()); setVersionNumber(version.getNumber()); }
/** * Returns a XML node for the given VersionProperty. * @param version VersionProperty to write * @param type type attribute for the VersionProperty * @return XML node for the given VersionProperty */ public static ConfigurationNode writeVersion(VersionProperty version, String type){ ConfigurationNode node = node(XML_VERSION); node.addAttribute(node(XML_VERSION_TYPE, type)); node.addChild(node(XML_VERSION_NAME, version.getName())); node.addChild(node(XML_VERSION_NUMBER, version.getNumber())); return node; }
/** * Writes a VersionProperty to XML. * @param xs XmlSerializer to write VersionProperty * @param p VersionProperty to write * @param type VersionProperty type attribute value * @throws IOException */ public static void writeVersionProperty(XmlSerializer xs, VersionProperty p, String type) throws IOException{ String namespace = VERSION_NAMESPACE; xs.startTag(namespace, XML_VERSION); xs.attribute(namespace, XML_VERSION_TYPE, type); xs.startTag(namespace, XML_VERSION_NAME); xs.text(p.getName()); xs.endTag(namespace, XML_VERSION_NAME); xs.startTag(namespace, XML_VERSION_NUMBER); xs.text(p.getNumber()); xs.endTag(namespace, XML_VERSION_NUMBER); xs.endTag(namespace, XML_VERSION); } }