public Feature(Document document) { this.document = document; this.dom = document.getRootElement(); }
public Feature( Document document ) { this.document = document; this.dom = document.getRootElement(); }
public Target( Document document ) { this.document = document; this.dom = document.getRootElement(); }
public UpdateSite( Document document ) { this.document = document; this.dom = document.getRootElement(); }
public Category( Document document ) { this.document = document; this.dom = document.getRootElement(); }
public ProductConfiguration( Document document ) { this.document = document; this.dom = document.getRootElement(); }
public ProductConfiguration(Document document) { this.document = document; this.dom = document.getRootElement(); }
public ProductConfiguration(Document document) { this.document = document; this.dom = document.getRootElement(); }
public Category(Document document) { this.document = document; this.dom = document.getRootElement(); }
public Category(Document document) { this.document = document; this.dom = document.getRootElement(); }
public Feature(Document document) { this.document = document; this.dom = document.getRootElement(); }
public static boolean updateProperties(Document doc, Map<String, String> propertyChanges) { Element rootElement = doc.getRootElement(); boolean update = false; Element properties = DecentXmlHelper.firstChild(rootElement, "properties"); if (properties != null) { for (Map.Entry<String, String> entry : propertyChanges.entrySet()) { String propertyName = entry.getKey(); String propertyVersion = entry.getValue(); if (DecentXmlHelper.updateFirstChild(properties, propertyName, propertyVersion)) { update = true; } } } return update; }
public static boolean updateProperties(Document doc, Map<String, String> propertyChanges) { Element rootElement = doc.getRootElement(); boolean update = false; Element properties = DecentXmlHelper.firstChild(rootElement, "properties"); if (properties != null) { for (Map.Entry<String, String> entry : propertyChanges.entrySet()) { String propertyName = entry.getKey(); String propertyVersion = entry.getValue(); if (DecentXmlHelper.updateFirstChild(properties, propertyName, propertyVersion)) { update = true; } } } return update; }
public UpdateSite(Document document) { this.document = document; this.dom = document.getRootElement(); if (dom.getAttribute("associateSitesURL") != null) { associateSitesUrl = dom.getAttributeValue("associateSitesURL"); } }
public UpdateSite(Document document) { this.document = document; this.dom = document.getRootElement(); if (dom.getAttribute("associateSitesURL") != null) { associateSitesUrl = dom.getAttributeValue("associateSitesURL"); } }
public void validate(Document doc) throws IOException, SAXException { Validator validator = camelSchemas().newValidator(); validator.setErrorHandler(this); validate(validator, doc.getRootElement()); }
public void validate(Document doc) throws IOException, SAXException { Validator validator = camelSchemas().newValidator(); validator.setErrorHandler(this); validate(validator, doc.getRootElement()); }
/** * Deploys provided pom.xml file under specified groupId, artifactId and version. The contents of the pom is updated * to match specified groupId, artifactId and version. */ public long deployPom(String groupId, String artifactId, String version, File pomTemplate) throws IOException { final Document pom = XMLParser.parse(pomTemplate); pom.getRootElement().getChild("groupId").setText(groupId); pom.getRootElement().getChild("artifactId").setText(artifactId); pom.getRootElement().getChild("version").setText(version); // pom.getRootElement().getChild( "packaging" ).setText( "pom" ); StringWriter buf = new StringWriter(); XMLWriter writer = new XMLWriter(buf); pom.toXML(writer); String body = buf.toString(); HttpEntity pomEntity = new StringEntity(body, ContentType.TEXT_XML); deploy(pomEntity, groupId, artifactId, version, ".pom"); return body.getBytes(Charsets.UTF_8).length; }
public static boolean updateDependencyVersion(Document doc, DependencyVersionChange change, Map<String, String> propertyChanges) { Element rootElement = doc.getRootElement(); List<Element> dependencies = DecentXmlHelper.findElementsWithName(rootElement, "dependency"); String newVersion = change.getVersion(); boolean update = false; for (Element element : dependencies) { String groupId = DecentXmlHelper.firstChildTextContent(element, "groupId"); String artifactId = DecentXmlHelper.firstChildTextContent(element, "artifactId"); if (change.matches(groupId, artifactId)) { String version = DecentXmlHelper.firstChildTextContent(element, "version"); if (Strings.notEmpty(version)) { if (version.startsWith("${") && version.endsWith("}")) { String versionProperty = version.substring(2, version.length() - 1); propertyChanges.put(versionProperty, newVersion); } else { if (DecentXmlHelper.updateFirstChild(element, "version", newVersion)) { update = true; } } } } } return update; }
private void parseDoc(Document doc, JdkReleases.Builder builder) { Element defElem = doc.getRootElement().getChild("defaults"); String urlTemplate = defElem.getChild("url").getText(); for (Element jceElem : doc.getRootElement().getChildren("jce")) { String ver = jceElem.getAttributeValue("version"); String url = getText(jceElem, "url"); builder.addJCE(Integer.parseInt(ver), url); } for (Element relElem : doc.getRootElement().getChildren("jdk")) { String v = relElem.getAttributeValue("version"); boolean psu = Boolean.parseBoolean(relElem.getAttributeValue("psu")); String url = getText(relElem, "url"); if (url == null) { url = urlTemplate; } if (psu) { builder.setPSU(v); } parseBin(v, url, relElem.getChildren("bin"), builder); } }