Search in sources :

Example 1 with IPlatform

use of com.ibm.uma.IPlatform in project openj9 by eclipse.

the class ObjectParser method parse.

public static Object parse(Node node, String containingFile) throws UMAException {
    NamedNodeMap attributes = node.getAttributes();
    NodeList nodeList = node.getChildNodes();
    String nodeName = node.getNodeName();
    IPlatform platform = UMA.getUma().getPlatform();
    int objectType = Object.GROUP;
    if (nodeName.equalsIgnoreCase("object")) {
        objectType = Object.SINGLE;
    }
    String name = attributes.getNamedItem("name").getNodeValue();
    if (objectType == Object.SINGLE) {
        if (name.split("\\.").length == 1) {
            name = name + platform.getObjectExtension();
        }
    }
    Object object = new Object(name, containingFile);
    object.setType(objectType);
    Parser.populatePredicateList(nodeList, object);
    return object;
}
Also used : NamedNodeMap(org.w3c.dom.NamedNodeMap) NodeList(org.w3c.dom.NodeList) IPlatform(com.ibm.uma.IPlatform) Object(com.ibm.uma.om.Object)

Example 2 with IPlatform

use of com.ibm.uma.IPlatform in project openj9 by eclipse.

the class VPath method getObjectFile.

public String getObjectFile() throws UMAException {
    String objFile = "";
    IPlatform platform = UMA.getUma().getPlatform();
    String[] parts = pattern.split("\\.");
    if (parts.length == 1) {
        objFile = pattern + platform.getObjectExtension();
    } else {
        for (int i = 0; i < parts.length - 1; i++) {
            objFile += parts[i];
        }
        objFile += platform.getObjectExtension();
    }
    return objFile;
}
Also used : IPlatform(com.ibm.uma.IPlatform)

Aggregations

IPlatform (com.ibm.uma.IPlatform)2 Object (com.ibm.uma.om.Object)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1 NodeList (org.w3c.dom.NodeList)1