本文整理了Java中de.pdark.decentxml.Document.getRootElement()
方法的一些代码示例,展示了Document.getRootElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.getRootElement()
方法的具体详情如下:
包路径:de.pdark.decentxml.Document
类名称:Document
方法名:getRootElement
暂无
代码示例来源:origin: org.eclipse.tycho/tycho-metadata-model
public Feature(Document document) {
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.sonatype.tycho/tycho-metadata-model
public Feature( Document document )
{
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.sonatype.tycho/tycho-metadata-model
public Target( Document document )
{
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.sonatype.tycho/tycho-metadata-model
public UpdateSite( Document document )
{
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.sonatype.tycho/tycho-metadata-model
public Category( Document document )
{
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.sonatype.tycho/tycho-metadata-model
public ProductConfiguration( Document document )
{
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: eclipse/tycho
public ProductConfiguration(Document document) {
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.eclipse.tycho/tycho-metadata-model
public ProductConfiguration(Document document) {
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: org.eclipse.tycho/tycho-metadata-model
public Category(Document document) {
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: eclipse/tycho
public Category(Document document) {
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: eclipse/tycho
public Feature(Document document) {
this.document = document;
this.dom = document.getRootElement();
}
代码示例来源:origin: io.jenkins.updatebot/updatebot-core
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;
}
代码示例来源:origin: io.fabric8.updatebot/updatebot-core
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;
}
代码示例来源:origin: eclipse/tycho
public UpdateSite(Document document) {
this.document = document;
this.dom = document.getRootElement();
if (dom.getAttribute("associateSitesURL") != null) {
associateSitesUrl = dom.getAttributeValue("associateSitesURL");
}
}
代码示例来源:origin: org.eclipse.tycho/tycho-metadata-model
public UpdateSite(Document document) {
this.document = document;
this.dom = document.getRootElement();
if (dom.getAttribute("associateSitesURL") != null) {
associateSitesUrl = dom.getAttributeValue("associateSitesURL");
}
}
代码示例来源:origin: io.fabric8.forge/camel-tooling-util
public void validate(Document doc) throws IOException, SAXException {
Validator validator = camelSchemas().newValidator();
validator.setErrorHandler(this);
validate(validator, doc.getRootElement());
}
代码示例来源:origin: jboss-fuse/fabric8
public void validate(Document doc) throws IOException, SAXException {
Validator validator = camelSchemas().newValidator();
validator.setErrorHandler(this);
validate(validator, doc.getRootElement());
}
代码示例来源:origin: io.takari.nexus/nexus-perf
/**
* 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;
}
代码示例来源:origin: io.fabric8.updatebot/updatebot-core
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;
}
代码示例来源:origin: io.takari/jdkget
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);
}
}
内容来源于网络,如有侵权,请联系作者删除!