use of groovy.util.NodeList in project gradle by gradle.
the class Project method storeProjectLibraries.
private void storeProjectLibraries() {
Node libraryTable = findOrCreateLibraryTable();
if (projectLibraries.isEmpty()) {
getXml().remove(libraryTable);
return;
}
libraryTable.setValue(new NodeList());
for (ProjectLibrary library : projectLibraries) {
library.addToNode(libraryTable, pathFactory);
}
}
use of groovy.util.NodeList in project gradle by gradle.
the class WtpFacet method load.
@Override
protected void load(Node xml) {
NodeList fixed = (NodeList) xml.get("fixed");
NodeList installed = (NodeList) xml.get("installed");
for (Object n : fixed) {
facets.add(new Facet((Node) n));
}
for (Object n : installed) {
facets.add(new Facet((Node) n));
}
}
use of groovy.util.NodeList in project gradle by gradle.
the class WtpFacet method removeConfigurableDataFromXml.
private void removeConfigurableDataFromXml() {
Node xml = getXml();
NodeList fixed = (NodeList) xml.get("fixed");
NodeList installed = (NodeList) xml.get("installed");
for (Object n : fixed) {
xml.remove((Node) n);
}
for (Object n : installed) {
xml.remove((Node) n);
}
}
use of groovy.util.NodeList in project gradle by gradle.
the class AbstractClasspathEntry method writeEntryAttributes.
public void writeEntryAttributes(Node node) {
Map<String, Object> effectiveEntryAttrs = Maps.newLinkedHashMap();
for (String key : entryAttributes.keySet()) {
Object value = entryAttributes.get(key);
if (value != null) {
effectiveEntryAttrs.put(key, value);
}
}
if (effectiveEntryAttrs.isEmpty()) {
return;
}
Node attributesNode;
NodeList attributesNodes = (NodeList) node.get("attributes");
if (attributesNodes.size() == 0) {
attributesNode = node.appendNode("attributes");
} else {
attributesNode = (Node) attributesNodes.get(0);
}
for (String key : effectiveEntryAttrs.keySet()) {
Object value = effectiveEntryAttrs.get(key);
Map<String, Object> attrs = Maps.newLinkedHashMap();
attrs.put("name", key);
attrs.put("value", value);
attributesNode.appendNode("attribute", attrs);
}
}
use of groovy.util.NodeList in project gradle by gradle.
the class AbstractClasspathEntry method readAccessRules.
private Set<AccessRule> readAccessRules(Node node) {
Set<AccessRule> accessRules = Sets.newLinkedHashSet();
NodeList accessRulesNodes = (NodeList) node.get("accessrules");
for (Object accessRulesNode : accessRulesNodes) {
NodeList accessRuleNodes = (NodeList) ((Node) accessRulesNode).get("accessrule");
for (Object accessRuleNode : accessRuleNodes) {
Node ruleNode = (Node) accessRuleNode;
accessRules.add(new AccessRule((String) ruleNode.attribute("kind"), (String) ruleNode.attribute("pattern")));
}
}
return accessRules;
}
Aggregations