use of com.ibm.uma.om.Flags in project openj9 by eclipse.
the class FlaglistsParser method parse.
public static Vector<Flags> parse(Node node, String containingFile) throws UMAException {
Vector<Flags> flags = new Vector<Flags>();
NodeList nodeList = node.getChildNodes();
for (int j = 0; j < nodeList.getLength(); j++) {
Node item = nodeList.item(j);
Flags flagsContainer = new Flags(containingFile);
if (item.getNodeName().equalsIgnoreCase("flags")) {
NodeList flagsNodeList = item.getChildNodes();
for (int k = 0; j < flagsNodeList.getLength(); k++) {
Node fItem = flagsNodeList.item(k);
Flag f = FlagParser.parse(fItem, containingFile);
flagsContainer.addFlag(f);
}
}
flags.add(flagsContainer);
}
return flags;
}
use of com.ibm.uma.om.Flags in project openj9 by eclipse.
the class ModuleParser method parse.
public static Module parse(Document moduleXml, String modulePath) throws UMAException {
Module module = new Module(modulePath);
// Initialize the Module based on the XML document
Element elem = moduleXml.getDocumentElement();
NodeList nodeList = elem.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
String nodeName = node.getLocalName();
if (nodeName == null)
continue;
if (nodeName.equalsIgnoreCase("artifact")) {
Artifact artifact = ArtifactParser.parse(node, module);
module.addArtifact(artifact);
UMA.getUma().addArtifact(artifact);
} else if (nodeName.equalsIgnoreCase("exports")) {
Exports exps = ExportsParser.parse(node, module.getContainingFile());
module.addExports(exps.getGroup(), exps);
} else if (nodeName.equalsIgnoreCase("objects")) {
Objects objs = ObjectsParser.parse(node, module.getContainingFile());
module.addObjects(objs.getGroup(), objs);
} else if (nodeName.equalsIgnoreCase("exportlists")) {
Vector<Exports> exports = ExportlistsParser.parse(node, module.getContainingFile());
for (Exports exps : exports) {
module.addExports(exps.getGroup(), exps);
}
} else if (nodeName.equalsIgnoreCase("objectlists")) {
Vector<Objects> objects = ObjectlistsParser.parse(node, module.getContainingFile());
for (Objects objs : objects) {
module.addObjects(objs.getGroup(), objs);
}
} else if (nodeName.equalsIgnoreCase("flaglists")) {
Vector<Flags> flags = FlaglistsParser.parse(node, module.getContainingFile());
for (Flags f : flags) {
// System.out.println("Flag: " + (f == null ? "null" : f.getGroup()));
module.addFlags(f.getGroup(), f);
}
} else if (nodeName.equalsIgnoreCase("flags")) {
Flags flags = FlagsParser.parse(node, module.getContainingFile());
// System.out.println("GROUP: " + flags.getGroup());
for (Flag f : flags.getFlags()) {
/*
if (f != null) {
System.out.println("FLAG: "+ f.getName());
} else {
System.out.println("NULL FLAG");
}
*/
}
module.addFlags(flags.getGroup(), flags);
}
}
Parser.populatePredicateList(nodeList, module);
return module;
}
use of com.ibm.uma.om.Flags in project openj9 by eclipse.
the class FlagsParser method parse.
public static Flags parse(Node node, String containingFile) throws UMAException {
Flags flags = new Flags(containingFile);
NamedNodeMap attributes = node.getAttributes();
flags.setGroup(attributes.getNamedItem("group").getNodeValue());
NodeList nodeList = node.getChildNodes();
for (int j = 0; j < nodeList.getLength(); j++) {
Node item = nodeList.item(j);
if (item.getNodeName().equalsIgnoreCase("flag")) {
Flag f = FlagParser.parse(item, containingFile);
flags.addFlag(f);
} else if (item.getNodeName().equalsIgnoreCase("group")) {
NamedNodeMap attr = item.getAttributes();
String objectGroupName = attr.getNamedItem("name").getNodeValue();
Flag f = new Flag(objectGroupName, containingFile);
flags.addFlag(f);
}
}
Parser.populatePredicateList(nodeList, flags);
return flags;
}
Aggregations